vehicles.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package maps.fleetengine.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/maps/fleetengine/v1/fleetengine.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/protobuf/wrappers.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/maps/fleetengine/v1;fleetengine";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "Vehicles";
  24. option java_package = "google.maps.fleetengine.v1";
  25. option objc_class_prefix = "CFE";
  26. // Vehicle metadata.
  27. message Vehicle {
  28. option (google.api.resource) = {
  29. type: "fleetengine.googleapis.com/Vehicle"
  30. pattern: "providers/{provider}/vehicles/{vehicle}"
  31. };
  32. // The type of vehicle.
  33. message VehicleType {
  34. // Vehicle type categories
  35. enum Category {
  36. // Default, used for unspecified or unrecognized vehicle categories.
  37. UNKNOWN = 0;
  38. // An automobile.
  39. AUTO = 1;
  40. // Any vehicle that acts as a taxi (typically licensed or regulated).
  41. TAXI = 2;
  42. // Generally, a vehicle with a large storage capacity.
  43. TRUCK = 3;
  44. // A motorcycle, moped, or other two-wheeled vehicle
  45. TWO_WHEELER = 4;
  46. }
  47. // Vehicle type category
  48. Category category = 1;
  49. }
  50. // Output only. The unique name for this vehicle.
  51. // The format is `providers/{provider}/vehicles/{vehicle}`.
  52. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  53. // The vehicle state.
  54. VehicleState vehicle_state = 2;
  55. // Trip types supported by this vehicle.
  56. repeated TripType supported_trip_types = 3;
  57. // Output only. List of `trip_id`'s for trips currently assigned to this vehicle.
  58. repeated string current_trips = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  59. // Last reported location of the vehicle.
  60. VehicleLocation last_location = 5;
  61. // The total numbers of riders this vehicle can carry. The driver is not
  62. // considered in this value. This value must be greater than or equal to one.
  63. int32 maximum_capacity = 6;
  64. // List of vehicle attributes. A vehicle can have at most 50
  65. // attributes, and each attribute must have a unique key.
  66. repeated VehicleAttribute attributes = 8;
  67. // The type of this vehicle. Can be used to filter vehicles in
  68. // `SearchVehicles` results. Also influences ETA and route calculations.
  69. VehicleType vehicle_type = 9;
  70. // License plate information for the vehicle.
  71. LicensePlate license_plate = 10;
  72. // Deprecated: Use `Vehicle.waypoints` instead.
  73. repeated TerminalLocation route = 12 [deprecated = true];
  74. // The polyline specifying the route the driver app intends to take to
  75. // the next waypoint. This list is also returned in
  76. // `Trip.current_route_segment` for all active trips assigned to the vehicle.
  77. //
  78. // Note: This field is intended only for use by the Driver SDK. Decoding is
  79. // not yet supported.
  80. string current_route_segment = 20;
  81. // Input only. Fleet Engine uses this information to improve Journey Sharing.
  82. TrafficPolylineData current_route_segment_traffic = 28 [(google.api.field_behavior) = INPUT_ONLY];
  83. // Output only. Time when `current_route_segment` was set. It can be stored by the client
  84. // and passed in future `GetVehicle` requests to prevent returning routes that
  85. // haven't changed.
  86. google.protobuf.Timestamp current_route_segment_version = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  87. // The waypoint where `current_route_segment` ends. This can be supplied by
  88. // drivers on `UpdateVehicle` calls either as a full trip waypoint, a waypoint
  89. // `LatLng`, or as the last `LatLng` of the `current_route_segment`. Fleet
  90. // Engine will then do its best to interpolate to an actual waypoint if it is
  91. // not fully specified. This field is ignored in `UpdateVehicle` calls unless
  92. // `current_route_segment` is also specified.
  93. TripWaypoint current_route_segment_end_point = 24;
  94. // The remaining driving distance for the `current_route_segment`.
  95. // This value is also returned in `Trip.remaining_distance_meters` for all
  96. // active trips assigned to the vehicle. The value is unspecified if the
  97. // `current_route_segment` field is empty.
  98. google.protobuf.Int32Value remaining_distance_meters = 18;
  99. // The ETA to the first entry in the `waypoints` field. The value is
  100. // unspecified if the `waypoints` field is empty or the
  101. // `Vehicle.current_route_segment` field is empty.
  102. //
  103. // When updating a vehicle, `remaining_time_seconds` takes precedence over
  104. // `eta_to_first_waypoint` in the same request.
  105. google.protobuf.Timestamp eta_to_first_waypoint = 19;
  106. // Input only. The remaining driving time for the `current_route_segment`. The value is
  107. // unspecified if the `waypoints` field is empty or the
  108. // `Vehicle.current_route_segment` field is empty. This value should match
  109. // `eta_to_first_waypoint` - `current_time` if all parties are using the same
  110. // clock.
  111. //
  112. // When updating a vehicle, `remaining_time_seconds` takes precedence over
  113. // `eta_to_first_waypoint` in the same request.
  114. google.protobuf.Int32Value remaining_time_seconds = 25 [(google.api.field_behavior) = INPUT_ONLY];
  115. // The remaining waypoints assigned to this Vehicle.
  116. repeated TripWaypoint waypoints = 22;
  117. // Output only. Last time the `waypoints` field was updated. Clients should cache this
  118. // value and pass it in `GetVehicleRequest` to ensure the `waypoints` field is
  119. // only returned if it is updated.
  120. google.protobuf.Timestamp waypoints_version = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  121. // Indicates if the driver accepts back-to-back trips. If `true`,
  122. // `SearchVehicles` may include the vehicle even if it is currently assigned
  123. // to a trip. The default value is `false`.
  124. bool back_to_back_enabled = 23;
  125. // The vehicle's navigation status.
  126. NavigationStatus navigation_status = 26;
  127. // Input only. Information about settings in the mobile device being used by the driver.
  128. DeviceSettings device_settings = 27 [(google.api.field_behavior) = INPUT_ONLY];
  129. }
  130. // Information about the device's battery.
  131. message BatteryInfo {
  132. // Status of the battery, whether full or charging etc.
  133. BatteryStatus battery_status = 1;
  134. // Status of battery power source.
  135. PowerSource power_source = 2;
  136. // Current battery percentage [0-100].
  137. float battery_percentage = 3;
  138. }
  139. // Information about various settings on the mobile device.
  140. message DeviceSettings {
  141. // How location features are set to behave on the device when battery saver is
  142. // on.
  143. LocationPowerSaveMode location_power_save_mode = 1;
  144. // Whether the device is currently in power save mode.
  145. bool is_power_save_mode = 2;
  146. // Whether the device is in an interactive state.
  147. bool is_interactive = 3;
  148. // Information about the battery state.
  149. BatteryInfo battery_info = 4;
  150. }
  151. // The license plate information of the Vehicle. To avoid storing
  152. // personally-identifiable information, only the minimum information
  153. // about the license plate is stored as part of the entity.
  154. message LicensePlate {
  155. // Required. CLDR Country/Region Code. For example, `US` for United States,
  156. // or `IN` for India.
  157. string country_code = 1 [(google.api.field_behavior) = REQUIRED];
  158. // The last digit of the license plate or "-1" to denote no numeric value
  159. // is present in the license plate.
  160. //
  161. // * "ABC 1234" -> "4"
  162. // * "AB 123 CD" -> "3"
  163. // * "ABCDEF" -> "-1"
  164. string last_character = 2;
  165. }
  166. // Describes how clients should color one portion of the polyline along the
  167. // route.
  168. message VisualTrafficReportPolylineRendering {
  169. // One road stretch that should be rendered.
  170. message RoadStretch {
  171. // The traffic style, indicating traffic speed.
  172. enum Style {
  173. // No style selected.
  174. STYLE_UNSPECIFIED = 0;
  175. // Traffic is slowing down.
  176. SLOWER_TRAFFIC = 1;
  177. // There is a traffic jam.
  178. TRAFFIC_JAM = 2;
  179. }
  180. // Required. The style to apply.
  181. Style style = 1 [(google.api.field_behavior) = REQUIRED];
  182. // Required. The style should be applied between `[offset_meters, offset_meters +
  183. // length_meters)`.
  184. int32 offset_meters = 2 [(google.api.field_behavior) = REQUIRED];
  185. // Required. The length of the path where to apply the style.
  186. int32 length_meters = 3 [(google.api.field_behavior) = REQUIRED];
  187. }
  188. // Optional. Road stretches that should be rendered along the polyline. Stretches
  189. // <ul>
  190. // <li>are
  191. // guaranteed to not overlap, and</li>
  192. // <li>do not necessarily
  193. // span the full route.</li>
  194. // </ul>
  195. //
  196. // <p>In the absence of a road stretch to style, the client should apply the
  197. // default for the route.
  198. repeated RoadStretch road_stretch = 1 [(google.api.field_behavior) = OPTIONAL];
  199. }
  200. // Traffic conditions along the expected vehicle route.
  201. message TrafficPolylineData {
  202. // A polyline rendering of how fast traffic is for all regions along
  203. // one stretch of a customer ride.
  204. VisualTrafficReportPolylineRendering traffic_rendering = 1;
  205. }
  206. // The state of a `Vehicle`.
  207. enum VehicleState {
  208. // Default, used for unspecified or unrecognized vehicle states.
  209. UNKNOWN_VEHICLE_STATE = 0;
  210. // The vehicle is not accepting new trips. Note: the vehicle may continue to
  211. // operate in this state while completing a trip assigned to it.
  212. OFFLINE = 1;
  213. // The vehicle is accepting new trips.
  214. ONLINE = 2;
  215. }
  216. // How location features are configured to behave on the mobile device when the
  217. // devices "battery saver" feature is on.
  218. // (https://developer.android.com/reference/android/os/PowerManager#getLocationPowerSaveMode())
  219. enum LocationPowerSaveMode {
  220. // Undefined LocationPowerSaveMode
  221. UNKNOWN_LOCATION_POWER_SAVE_MODE = 0;
  222. // Either the location providers shouldn't be affected by battery saver, or
  223. // battery saver is off.
  224. LOCATION_MODE_NO_CHANGE = 1;
  225. // The GPS based location provider should be disabled when battery saver is on
  226. // and the device is non-interactive.
  227. LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 2;
  228. // All location providers should be disabled when battery saver is on and the
  229. // device is non-interactive.
  230. LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 3;
  231. // All the location providers will be kept available, but location fixes
  232. // should only be provided to foreground apps.
  233. LOCATION_MODE_FOREGROUND_ONLY = 4;
  234. // Location will not be turned off, but LocationManager will throttle all
  235. // requests to providers when the device is non-interactive.
  236. LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 5;
  237. }
  238. // Status of the battery, whether full or charging etc.
  239. enum BatteryStatus {
  240. // Battery status unknown.
  241. UNKNOWN_BATTERY_STATUS = 0;
  242. // Battery is being charged.
  243. BATTERY_STATUS_CHARGING = 1;
  244. // Battery is discharging.
  245. BATTERY_STATUS_DISCHARGING = 2;
  246. // Battery is full.
  247. BATTERY_STATUS_FULL = 3;
  248. // Battery is not charging.
  249. BATTERY_STATUS_NOT_CHARGING = 4;
  250. // Battery is low on power.
  251. BATTERY_STATUS_POWER_LOW = 5;
  252. }
  253. // Type of the charger being used to charge the battery.
  254. enum PowerSource {
  255. // Power source unknown.
  256. UNKNOWN_POWER_SOURCE = 0;
  257. // Power source is an AC charger.
  258. POWER_SOURCE_AC = 1;
  259. // Power source is a USB port.
  260. POWER_SOURCE_USB = 2;
  261. // Power source is wireless.
  262. POWER_SOURCE_WIRELESS = 3;
  263. // Battery is unplugged.
  264. POWER_SOURCE_UNPLUGGED = 4;
  265. }