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