summaryrefslogtreecommitdiff
path: root/third_party/googleapis/google/maps/fleetengine/v1/vehicles.proto
blob: be9e73dd634f0f8e43f344e7e661cc85b2be94f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package maps.fleetengine.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/maps/fleetengine/v1/fleetengine.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

option go_package = "google.golang.org/genproto/googleapis/maps/fleetengine/v1;fleetengine";
option java_multiple_files = true;
option java_outer_classname = "Vehicles";
option java_package = "google.maps.fleetengine.v1";
option objc_class_prefix = "CFE";

// Vehicle metadata.
message Vehicle {
  option (google.api.resource) = {
    type: "fleetengine.googleapis.com/Vehicle"
    pattern: "providers/{provider}/vehicles/{vehicle}"
  };

  // The type of vehicle.
  message VehicleType {
    // Vehicle type categories
    enum Category {
      // Default, used for unspecified or unrecognized vehicle categories.
      UNKNOWN = 0;

      // An automobile.
      AUTO = 1;

      // Any vehicle that acts as a taxi (typically licensed or regulated).
      TAXI = 2;

      // Generally, a vehicle with a large storage capacity.
      TRUCK = 3;

      // A motorcycle, moped, or other two-wheeled vehicle
      TWO_WHEELER = 4;
    }

    // Vehicle type category
    Category category = 1;
  }

  // Output only. The unique name for this vehicle.
  // The format is `providers/{provider}/vehicles/{vehicle}`.
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // The vehicle state.
  VehicleState vehicle_state = 2;

  // Trip types supported by this vehicle.
  repeated TripType supported_trip_types = 3;

  // Output only. List of `trip_id`'s for trips currently assigned to this vehicle.
  repeated string current_trips = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Last reported location of the vehicle.
  VehicleLocation last_location = 5;

  // The total numbers of riders this vehicle can carry.  The driver is not
  // considered in this value. This value must be greater than or equal to one.
  int32 maximum_capacity = 6;

  // List of vehicle attributes. A vehicle can have at most 50
  // attributes, and each attribute must have a unique key.
  repeated VehicleAttribute attributes = 8;

  // The type of this vehicle.  Can be used to filter vehicles in
  // `SearchVehicles` results.  Also influences ETA and route calculations.
  VehicleType vehicle_type = 9;

  // License plate information for the vehicle.
  LicensePlate license_plate = 10;

  // Deprecated: Use `Vehicle.waypoints` instead.
  repeated TerminalLocation route = 12 [deprecated = true];

  // The polyline specifying the route the driver app intends to take to
  // the next waypoint. This list is also returned in
  // `Trip.current_route_segment` for all active trips assigned to the vehicle.
  //
  // Note: This field is intended only for use by the Driver SDK. Decoding is
  // not yet supported.
  string current_route_segment = 20;

  // Input only. Fleet Engine uses this information to improve Journey Sharing.
  TrafficPolylineData current_route_segment_traffic = 28 [(google.api.field_behavior) = INPUT_ONLY];

  // Output only. Time when `current_route_segment` was set. It can be stored by the client
  // and passed in future `GetVehicle` requests to prevent returning routes that
  // haven't changed.
  google.protobuf.Timestamp current_route_segment_version = 15 [(google.api.field_behavior) = OUTPUT_ONLY];

  // The waypoint where `current_route_segment` ends. This can be supplied by
  // drivers on `UpdateVehicle` calls either as a full trip waypoint, a waypoint
  // `LatLng`, or as the last `LatLng` of the `current_route_segment`. Fleet
  // Engine will then do its best to interpolate to an actual waypoint if it is
  // not fully specified. This field is ignored in `UpdateVehicle` calls unless
  // `current_route_segment` is also specified.
  TripWaypoint current_route_segment_end_point = 24;

  // The remaining driving distance for the `current_route_segment`.
  // This value is also returned in `Trip.remaining_distance_meters` for all
  // active trips assigned to the vehicle. The value is unspecified if the
  // `current_route_segment` field is empty.
  google.protobuf.Int32Value remaining_distance_meters = 18;

  // The ETA to the first entry in the `waypoints` field.  The value is
  // unspecified if the `waypoints` field is empty or the
  // `Vehicle.current_route_segment` field is empty.
  //
  // When updating a vehicle, `remaining_time_seconds` takes precedence over
  // `eta_to_first_waypoint` in the same request.
  google.protobuf.Timestamp eta_to_first_waypoint = 19;

  // Input only. The remaining driving time for the `current_route_segment`. The value is
  // unspecified if the `waypoints` field is empty or the
  // `Vehicle.current_route_segment` field is empty. This value should match
  // `eta_to_first_waypoint` - `current_time` if all parties are using the same
  // clock.
  //
  // When updating a vehicle, `remaining_time_seconds` takes precedence over
  // `eta_to_first_waypoint` in the same request.
  google.protobuf.Int32Value remaining_time_seconds = 25 [(google.api.field_behavior) = INPUT_ONLY];

  // The remaining waypoints assigned to this Vehicle.
  repeated TripWaypoint waypoints = 22;

  // Output only. Last time the `waypoints` field was updated. Clients should cache this
  // value and pass it in `GetVehicleRequest` to ensure the `waypoints` field is
  // only returned if it is updated.
  google.protobuf.Timestamp waypoints_version = 16 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Indicates if the driver accepts back-to-back trips. If `true`,
  // `SearchVehicles` may include the vehicle even if it is currently assigned
  // to a trip. The default value is `false`.
  bool back_to_back_enabled = 23;

  // The vehicle's navigation status.
  NavigationStatus navigation_status = 26;

  // Input only. Information about settings in the mobile device being used by the driver.
  DeviceSettings device_settings = 27 [(google.api.field_behavior) = INPUT_ONLY];
}

// Information about the device's battery.
message BatteryInfo {
  // Status of the battery, whether full or charging etc.
  BatteryStatus battery_status = 1;

  // Status of battery power source.
  PowerSource power_source = 2;

  // Current battery percentage [0-100].
  float battery_percentage = 3;
}

// Information about various settings on the mobile device.
message DeviceSettings {
  // How location features are set to behave on the device when battery saver is
  // on.
  LocationPowerSaveMode location_power_save_mode = 1;

  // Whether the device is currently in power save mode.
  bool is_power_save_mode = 2;

  // Whether the device is in an interactive state.
  bool is_interactive = 3;

  // Information about the battery state.
  BatteryInfo battery_info = 4;
}

// The license plate information of the Vehicle.  To avoid storing
// personally-identifiable information, only the minimum information
// about the license plate is stored as part of the entity.
message LicensePlate {
  // Required. CLDR Country/Region Code.  For example, `US` for United States,
  // or `IN` for India.
  string country_code = 1 [(google.api.field_behavior) = REQUIRED];

  // The last digit of the license plate or "-1" to denote no numeric value
  // is present in the license plate.
  //
  // * "ABC 1234" -> "4"
  // * "AB 123 CD" -> "3"
  // * "ABCDEF" -> "-1"
  string last_character = 2;
}

// Describes how clients should color one portion of the polyline along the
// route.
message VisualTrafficReportPolylineRendering {
  // One road stretch that should be rendered.
  message RoadStretch {
    // The traffic style, indicating traffic speed.
    enum Style {
      // No style selected.
      STYLE_UNSPECIFIED = 0;

      // Traffic is slowing down.
      SLOWER_TRAFFIC = 1;

      // There is a traffic jam.
      TRAFFIC_JAM = 2;
    }

    // Required. The style to apply.
    Style style = 1 [(google.api.field_behavior) = REQUIRED];

    // Required. The style should be applied between `[offset_meters, offset_meters +
    // length_meters)`.
    int32 offset_meters = 2 [(google.api.field_behavior) = REQUIRED];

    // Required. The length of the path where to apply the style.
    int32 length_meters = 3 [(google.api.field_behavior) = REQUIRED];
  }

  // Optional. Road stretches that should be rendered along the polyline. Stretches
  // <ul>
  // <li>are
  // guaranteed to not overlap, and</li>
  // <li>do not necessarily
  // span the full route.</li>
  // </ul>
  //
  // <p>In the absence of a road stretch to style, the client should apply the
  // default for the route.
  repeated RoadStretch road_stretch = 1 [(google.api.field_behavior) = OPTIONAL];
}

// Traffic conditions along the expected vehicle route.
message TrafficPolylineData {
  // A polyline rendering of how fast traffic is for all regions along
  // one stretch of a customer ride.
  VisualTrafficReportPolylineRendering traffic_rendering = 1;
}

// The state of a `Vehicle`.
enum VehicleState {
  // Default, used for unspecified or unrecognized vehicle states.
  UNKNOWN_VEHICLE_STATE = 0;

  // The vehicle is not accepting new trips. Note: the vehicle may continue to
  // operate in this state while completing a trip assigned to it.
  OFFLINE = 1;

  // The vehicle is accepting new trips.
  ONLINE = 2;
}

// How location features are configured to behave on the mobile device when the
// devices "battery saver" feature is on.
// (https://developer.android.com/reference/android/os/PowerManager#getLocationPowerSaveMode())
enum LocationPowerSaveMode {
  // Undefined LocationPowerSaveMode
  UNKNOWN_LOCATION_POWER_SAVE_MODE = 0;

  // Either the location providers shouldn't be affected by battery saver, or
  // battery saver is off.
  LOCATION_MODE_NO_CHANGE = 1;

  // The GPS based location provider should be disabled when battery saver is on
  // and the device is non-interactive.
  LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 2;

  // All location providers should be disabled when battery saver is on and the
  // device is non-interactive.
  LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 3;

  // All the location providers will be kept available, but location fixes
  // should only be provided to foreground apps.
  LOCATION_MODE_FOREGROUND_ONLY = 4;

  // Location will not be turned off, but LocationManager will throttle all
  // requests to providers when the device is non-interactive.
  LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 5;
}

// Status of the battery, whether full or charging etc.
enum BatteryStatus {
  // Battery status unknown.
  UNKNOWN_BATTERY_STATUS = 0;

  // Battery is being charged.
  BATTERY_STATUS_CHARGING = 1;

  // Battery is discharging.
  BATTERY_STATUS_DISCHARGING = 2;

  // Battery is full.
  BATTERY_STATUS_FULL = 3;

  // Battery is not charging.
  BATTERY_STATUS_NOT_CHARGING = 4;

  // Battery is low on power.
  BATTERY_STATUS_POWER_LOW = 5;
}

// Type of the charger being used to charge the battery.
enum PowerSource {
  // Power source unknown.
  UNKNOWN_POWER_SOURCE = 0;

  // Power source is an AC charger.
  POWER_SOURCE_AC = 1;

  // Power source is a USB port.
  POWER_SOURCE_USB = 2;

  // Power source is wireless.
  POWER_SOURCE_WIRELESS = 3;

  // Battery is unplugged.
  POWER_SOURCE_UNPLUGGED = 4;
}