vehicles.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. // Copyright 2021 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. // Types of vehicles that may be filtered for in SearchVehicles.
  33. message VehicleType {
  34. // Vehicle type categories
  35. enum Category {
  36. // Default, used for unspecified or unrecognized vehicle types.
  37. UNKNOWN = 0;
  38. // An automobile.
  39. AUTO = 1;
  40. // Any vehicle that acts as a taxi.
  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. // The unique name for this vehicle.
  51. // The format is providers/{provider}/vehicles/{vehicle}
  52. string name = 1;
  53. // The vehicle state.
  54. VehicleState vehicle_state = 2;
  55. // Supported trip types.
  56. repeated TripType supported_trip_types = 3;
  57. // List of IDs for trips in progress.
  58. repeated string current_trips = 4;
  59. // Last reported location of the vehicle.
  60. VehicleLocation last_location = 5;
  61. // Maximum capacity of the vehicle. This is the total numbers of riders
  62. // on trips this vehicle can contain. The driver is not considered in
  63. // this value. This value must be greater than or equal to one.
  64. int32 maximum_capacity = 6;
  65. // The current available capacity of the vehicle. This is the
  66. // maximum_capacity minus the current number of riders.
  67. int32 available_capacity = 7;
  68. // List of vehicle service attributes.
  69. repeated VehicleAttribute attributes = 8;
  70. // The type of this Vehicle. Can be filtered during SearchVehicles. Also
  71. // influences ETA and route calculations.
  72. VehicleType vehicle_type = 9;
  73. // License plate information for the vehicle.
  74. LicensePlate license_plate = 10;
  75. // Deprecated. Use vehicle.waypoint instead.
  76. repeated TerminalLocation route = 12 [deprecated = true];
  77. // The polyline specifying the route the driver app intends to take to
  78. // the next waypoint. Your driver app updates this every time a waypoint is
  79. // passed or the driver reroutes. This list is also returned in
  80. // Trip.current_route_segment for all active trips assigned to the vehicle.
  81. // Note: This field is intended only for use by the Driver SDK.
  82. string current_route_segment = 20;
  83. // Time when current_route_segment was set. This field is ignored in
  84. // UpdateVehicleRequests as it is calculated by the server. It should be
  85. // stored by client and passed in to future requests to prevent returning
  86. // routes to first way point that haven't changed.
  87. google.protobuf.Timestamp current_route_segment_version = 15;
  88. // The waypoint where current_route_segment ends. This can be supplied by
  89. // drivers on UpdateVehicle calls either as a full trip waypoint, a waypoint
  90. // latlnt, or as a the last latlng of the current_route_segment. FleetEngine
  91. // will then do its best to interpolate to an actual waypoint if it is not
  92. // fully specified. This field is ignored in UpdateVehicle calls unless
  93. // current_route_segment is also specified.
  94. TripWaypoint current_route_segment_end_point = 24;
  95. // The remaining driving distance for the 'current_route_segment'. This field
  96. // facilitates journey sharing between the Driver app and the Consumer app.
  97. // This value is updated by the Driver SDK. Fleet Engine does not update it.
  98. // This field is also returned in Trip.remaining_distance_meters for all
  99. // active trips assigned to the vehicle. The value is unspecified if the
  100. // `Vehicle.current_route_segment` field is empty, or if the Driver app has
  101. // not updated its value.
  102. google.protobuf.Int32Value remaining_distance_meters = 18;
  103. // The ETA to the next waypoint that is the first entry in Vehicle.waypoint
  104. // field. This field facilitates journey sharing between a Driver app and a
  105. // Consumer app and is updated by the Driver SDK, and Fleet Engine does not
  106. // update it. This field is also returned in Trip.eta_to_first_waypoint for
  107. // all active trips assigned to the vehicle. The value is unspecified if the
  108. // Vehicle.waypoint field is empty, or the Driver app has not updated its
  109. // value.
  110. google.protobuf.Timestamp eta_to_first_waypoint = 19;
  111. // The remaining driving time for the 'current_route_segment'. This field
  112. // facilitates journey sharing between the Driver app and the Consumer app.
  113. // This value is updated by the Driver SDK. Fleet Engine does not update it.
  114. // The value is unspecified if the `Vehicle.current_route_segment` field is
  115. // empty, or if the Driver app has not updated its value. This value should
  116. // match eta_to_first_waypoint - current_time if all parties are using the
  117. // same clock. This field is currently write-only and will not yet be
  118. // populated in Vehicle's get/update/search operations. When updating a
  119. // vehicle, if you update both eta_to_first_waypoint and
  120. // remaining_time_seconds in the same request, then only
  121. // remaining_time_seconds is considered.
  122. google.protobuf.Int32Value remaining_time_seconds = 25;
  123. // The remaining set of waypoints assigned to this Vehicle.
  124. repeated TripWaypoint waypoints = 22;
  125. // Last time the waypoints was updated. Client should cache
  126. // this value and pass it in GetVehicleRequest to ensure the
  127. // waypoints.path_to_waypoint is only returned if it is updated
  128. google.protobuf.Timestamp waypoints_version = 16;
  129. // Indicates if the driver accepts back-to-back rides. If
  130. // `true`, services include the vehicle for back-to-back matches.
  131. // If `false`, services exclude the vehicle from back-to-back matches.
  132. // Default value is `false`.
  133. bool back_to_back_enabled = 23;
  134. // Vehicle's navigation status.
  135. NavigationStatus navigation_status = 26;
  136. // Information about various device settings. This is internal debug only
  137. // field, not included in the response.
  138. DeviceSettings device_settings = 27;
  139. }
  140. // Information about the device's battery.
  141. message BatteryInfo {
  142. // Status of the battery, whether full or charging etc.
  143. BatteryStatus battery_status = 1;
  144. // Status of battery power source.
  145. PowerSource power_source = 2;
  146. // Current battery percentage [0-100].
  147. float battery_percentage = 3;
  148. }
  149. // Information about various settings on the device.
  150. message DeviceSettings {
  151. // How location features are set to behave on the device when battery saver is
  152. // on.
  153. LocationPowerSaveMode location_power_save_mode = 1;
  154. // Whether the device is currently in power save mode.
  155. bool is_power_save_mode = 2;
  156. // Whether the device is in an interactive state.
  157. bool is_interactive = 3;
  158. // Information about the battery state.
  159. BatteryInfo battery_info = 4;
  160. }
  161. // The license plate information of the Vehicle. This is used to support
  162. // congestion pricing restrictions in certain areas. To avoid storing
  163. // personally-identifiable information, only the minimum information
  164. // about the license plate is stored as part of the entity.
  165. message LicensePlate {
  166. // Required. CLDR Country/Region Code. For example, "US" for United States,
  167. // or "IN" for India.
  168. string country_code = 1 [(google.api.field_behavior) = REQUIRED];
  169. // The last digit of the license plate or "-1" to denote no numeric value
  170. // present in the license plate.
  171. //
  172. // * "ABC 1234" -> "4"
  173. // * "AB 123 CD" -> "3"
  174. // * "ABCDEF" -> "-1"
  175. string last_character = 2;
  176. }
  177. // The state of a Vehicle.
  178. enum VehicleState {
  179. // Default, used for unspecified or unrecognized vehicle states.
  180. UNKNOWN_VEHICLE_STATE = 0;
  181. // The vehicle is not accepting new trips.
  182. OFFLINE = 1;
  183. // The vehicle is accepting new trips.
  184. ONLINE = 2;
  185. }
  186. // How location features are set to behave on the device when battery saver is
  187. // on.
  188. // (https://developer.android.com/reference/android/os/PowerManager#getLocationPowerSaveMode())
  189. enum LocationPowerSaveMode {
  190. // Undefined LocationPowerSaveMode
  191. UNKNOWN_LOCATION_POWER_SAVE_MODE = 0;
  192. // Either the location providers shouldn't be affected by battery saver, or
  193. // battery saver is off.
  194. LOCATION_MODE_NO_CHANGE = 1;
  195. // The GPS based location provider should be disabled when battery saver is on
  196. // and the device is non-interactive.
  197. LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 2;
  198. // All location providers should be disabled when battery saver is on and the
  199. // device is non-interactive.
  200. LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 3;
  201. // All the location providers will be kept available, but location fixes
  202. // should only be provided to foreground apps.
  203. LOCATION_MODE_FOREGROUND_ONLY = 4;
  204. // Location will not be turned off, but LocationManager will throttle all
  205. // requests to providers when the device is non-interactive.
  206. LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 5;
  207. }
  208. // Status of the battery, whether full or charging etc.
  209. enum BatteryStatus {
  210. // Battery status unknown.
  211. UNKNOWN_BATTERY_STATUS = 0;
  212. // Battery is being charged.
  213. BATTERY_STATUS_CHARGING = 1;
  214. // Battery is discharging.
  215. BATTERY_STATUS_DISCHARGING = 2;
  216. // Battery is full.
  217. BATTERY_STATUS_FULL = 3;
  218. // Battery is not charging.
  219. BATTERY_STATUS_NOT_CHARGING = 4;
  220. // Battery is low on power.
  221. BATTERY_STATUS_POWER_LOW = 5;
  222. }
  223. // Type of the charger being used to charge the battery.
  224. enum PowerSource {
  225. // Power source unknown.
  226. UNKNOWN_POWER_SOURCE = 0;
  227. // Power source is an AC charger.
  228. POWER_SOURCE_AC = 1;
  229. // Power source is a USB port.
  230. POWER_SOURCE_USB = 2;
  231. // Power source is wireless.
  232. POWER_SOURCE_WIRELESS = 3;
  233. // Battery is unplugged.
  234. POWER_SOURCE_UNPLUGGED = 4;
  235. }