Skip to content

Commit

Permalink
Update Swagger Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Samsara CI committed Jul 1, 2021
1 parent 827d4e4 commit 2e034b0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 314 deletions.
14 changes: 1 addition & 13 deletions markdown/getsafetyactivityeventfeed.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,14 @@
| Property Name | Description |
| :------------ | :---------- |
| **data**<br/>_object array_ | Paginated safety event activity feed limited to 10 events. |
| **&nbsp;&nbsp;&nbsp;&nbsp;id**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;string_ | The ID of the activity feed line item. |
| **&nbsp;&nbsp;&nbsp;&nbsp;operation**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;string_ | The type of operation that occured in the safety event. Valid values: `create`, `update`, `delete`. |
| **&nbsp;&nbsp;&nbsp;&nbsp;id**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;string_ | The ID of the activity event feed line item. |
| **&nbsp;&nbsp;&nbsp;&nbsp;safetyEvent**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;object_ | The safety event that was updated. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;behaviorLabels**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object array_ | List of behavior labels associated with this safety event. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | The label associated with the safety event. This list often changes, so it is recommended that clients gracefully handle any types not enumerated in this list. Valid values: `invalid`, `genericTailgating`, `genericDistraction`, `defensiveDriving`, `rollingStop`, `nearCollision`, `speeding`, `obstructedCamera`, `didNotYield`, `noSeatbelt`, `mobileUsage`, `drowsy`, `laneDeparture`, `followingDistanceSevere`, `followingDistanceModerate`, `lateResponse`, `acceleration`, `braking`, `harshTurn`, `crash`, `rolloverProtection`, `yawControl`, `ranRedLight`, `forwardCollisionWarning`, `eatingDrinking`, `smoking`, `followingDistance`, `edgeDistractedDriving`, `policyViolationMask`, `eating`, `drinking`, `edgeRailroadCrossingViolation`. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;source**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | The source of the label associated with the safety event. Valid values: `invalid`, `system`, `samsaraUser`, `customerUser`, `dataMigration`, `device`, `driverUser`. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;downloadForwardVideoUrl**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | URL to download the forward video. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;downloadInwardVideoUrl**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | URL to download the inward video. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;driver**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object_ | A minified driver object. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | ID of the driver. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | Name of the driver. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | The unique Samsara ID of the safety event. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object_ | Location object |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;latitude**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number_ | GPS latitude represented in degrees |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;longitude**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number_ | GPS longitude represented in degrees |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxAccelerationGForce**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number_ | The maximum acceleration value as a multiplier on the force of gravity (g). |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | The time the safety event occurred in RFC 3339 milliseconds format. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vehicle**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object_ | A minified vehicle object. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | ID of the vehicle. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string_ | Name of the vehicle. |
| **&nbsp;&nbsp;&nbsp;&nbsp;time**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;string_ | The time the activity occurred in the corresponding safety event in RFC 3339 milliseconds format. |
| **&nbsp;&nbsp;&nbsp;&nbsp;type**<br/>_&nbsp;&nbsp;&nbsp;&nbsp;string_ | The type of activity that occurred in the safety event. We currently only support InboxActivityType, BehaviorLabelActivityType, and CreateSafetyEventType, but we may add support for more activity types in the future. Valid values: `BehaviorLabelActivityType`, `CreateSafetyEventActivityType`, `InboxActivityType`. |
| **pagination**<br/>_object_ | Pagination parameters. |
Expand Down
176 changes: 26 additions & 150 deletions swagger-readme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1788,65 +1788,6 @@
},
"type": "object"
},
"BehaviorLabelsObjectResponseBody": {
"description": "The most up-to-date behavior labels associated with the safety event. These labels can be updated by the Safety Report Admin.",
"properties": {
"label": {
"description": "The label associated with the safety event. This list often changes, so it is recommended that clients gracefully handle any types not enumerated in this list.",
"enum": [
"invalid",
"genericTailgating",
"genericDistraction",
"defensiveDriving",
"rollingStop",
"nearCollision",
"speeding",
"obstructedCamera",
"didNotYield",
"noSeatbelt",
"mobileUsage",
"drowsy",
"laneDeparture",
"followingDistanceSevere",
"followingDistanceModerate",
"lateResponse",
"acceleration",
"braking",
"harshTurn",
"crash",
"rolloverProtection",
"yawControl",
"ranRedLight",
"forwardCollisionWarning",
"eatingDrinking",
"smoking",
"followingDistance",
"edgeDistractedDriving",
"policyViolationMask",
"eating",
"drinking",
"edgeRailroadCrossingViolation"
],
"example": "genericTailgating",
"type": "string"
},
"source": {
"description": "The source of the label associated with the safety event.",
"enum": [
"invalid",
"system",
"samsaraUser",
"customerUser",
"dataMigration",
"device",
"driverUser"
],
"example": "automated",
"type": "string"
}
},
"type": "object"
},
"CameraMediaGetCameraMediaBadGatewayErrorResponseBody": {
"description": "Bad Gateway",
"properties": {
Expand Down Expand Up @@ -5340,22 +5281,6 @@
"maxLength": 4096,
"type": "string"
},
"DriverObjectResponseBody": {
"description": "A minified driver object.",
"properties": {
"id": {
"description": "ID of the driver.",
"example": "0987",
"type": "string"
},
"name": {
"description": "Name of the driver.",
"example": "Driver Name",
"type": "string"
}
},
"type": "object"
},
"DriverPassword": {
"description": "Password that the driver can use to login to the Samsara driver app.",
"example": "aSecurePassword1234",
Expand Down Expand Up @@ -13378,18 +13303,8 @@
"description": "Safety event activity feed item.",
"properties": {
"id": {
"description": "The ID of the activity feed line item.",
"example": "212014918174029-1550954461759-1622151765",
"type": "string"
},
"operation": {
"description": "The type of operation that occured in the safety event.",
"enum": [
"create",
"update",
"delete"
],
"example": "create",
"description": "The ID of the activity event feed line item.",
"example": "1622151765-212014918174029-1550954461759",
"type": "string"
},
"safetyEvent": {
Expand All @@ -13413,7 +13328,6 @@
},
"required": [
"id",
"operation",
"safetyEvent",
"time",
"type"
Expand Down Expand Up @@ -13519,6 +13433,17 @@
"SafetyEventDriver": {
"$ref": "#/components/schemas/driverTinyResponse"
},
"SafetyEventDriverObjectResponseBody": {
"description": "A minified driver object.",
"properties": {
"id": {
"description": "ID of the driver.",
"example": "0987",
"type": "string"
}
},
"type": "object"
},
"SafetyEventId": {
"description": "The unique Samsara ID of the safety event.",
"example": "212014918174029-1550954461759",
Expand All @@ -13535,47 +13460,21 @@
"SafetyEventObjectResponseBody": {
"description": "The safety event that was updated.",
"properties": {
"behaviorLabels": {
"description": "List of behavior labels associated with this safety event.",
"items": {
"$ref": "#/components/schemas/BehaviorLabelsObjectResponseBody"
},
"type": "array"
},
"downloadForwardVideoUrl": {
"description": "URL to download the forward video.",
"example": "https://s3.console.aws.amazon.com/s3/buckets/samsara-dashcam-videos/21575/212014918400828/1553060687222/huKA7IhpBV-camera-video-segment-1244214895.mp4",
"type": "string"
},
"downloadInwardVideoUrl": {
"description": "URL to download the inward video.",
"example": "https://s3.console.aws.amazon.com/s3/buckets/samsara-dashcam-videos/21575/212014918400828/1553060687222/huKA7IhpBV-camera-video-segment-1244214895.mp4",
"type": "string"
},
"driver": {
"$ref": "#/components/schemas/DriverObjectResponseBody"
"$ref": "#/components/schemas/SafetyEventDriverObjectResponseBody"
},
"id": {
"description": "The unique Samsara ID of the safety event.",
"example": "212014918174029-1550954461759",
"type": "string"
},
"location": {
"$ref": "#/components/schemas/locationResponseBody"
},
"maxAccelerationGForce": {
"description": "The maximum acceleration value as a multiplier on the force of gravity (g).",
"example": 0.123,
"format": "double",
"type": "number"
},
"time": {
"description": "The time the safety event occurred in RFC 3339 milliseconds format.",
"example": "2019-06-13T19:08:25.455Z",
"type": "string"
},
"vehicle": {
"$ref": "#/components/schemas/VehicleObjectResponseBody"
"$ref": "#/components/schemas/SafetyEventVehicleObjectResponseBody"
}
},
"type": "object"
Expand All @@ -13588,6 +13487,17 @@
"SafetyEventVehicle": {
"$ref": "#/components/schemas/vehicleTinyResponse"
},
"SafetyEventVehicleObjectResponseBody": {
"description": "A minified vehicle object.",
"properties": {
"id": {
"description": "ID of the vehicle.",
"example": "1234",
"type": "string"
}
},
"type": "object"
},
"SafetyEventsGetSafetyActivityEventFeedBadGatewayErrorResponseBody": {
"description": "Bad Gateway",
"properties": {
Expand Down Expand Up @@ -24282,22 +24192,6 @@
"maxLength": 255,
"type": "string"
},
"VehicleObjectResponseBody": {
"description": "A minified vehicle object.",
"properties": {
"id": {
"description": "ID of the vehicle.",
"example": "1234",
"type": "string"
},
"name": {
"description": "Name of the vehicle.",
"example": "Vehicle Name",
"type": "string"
}
},
"type": "object"
},
"VehicleOdometerMeters": {
"description": "A manual override for the vehicle's odometer. You may only override a vehicle's odometer if it cannot be read from on-board diagnostics. When you provide a manual odometer override, Samsara will begin updating a vehicle's odometer using GPS distance traveled since this override was set. See \u003ca href=\"https://kb.samsara.com/hc/en-us/articles/115005273667\" target=\"_blank\"\u003ehere\u003c/a\u003e for more details.",
"example": 9182,
Expand Down Expand Up @@ -28242,24 +28136,6 @@
],
"type": "object"
},
"locationResponseBody": {
"description": "Location object",
"properties": {
"latitude": {
"description": "GPS latitude represented in degrees",
"example": 37.456345,
"format": "double",
"type": "number"
},
"longitude": {
"description": "\tGPS longitude represented in degrees",
"example": 34.5633749,
"format": "double",
"type": "number"
}
},
"type": "object"
},
"longitude": {
"description": "The longitude of the asset in decimal degrees.",
"example": -122.403098,
Expand Down
Loading

0 comments on commit 2e034b0

Please sign in to comment.