xref: /aosp_15_r20/external/googleapis/google/maps/fleetengine/v1/vehicle_api.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/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/api/routing.proto";
24import "google/geo/type/viewport.proto";
25import "google/maps/fleetengine/v1/fleetengine.proto";
26import "google/maps/fleetengine/v1/header.proto";
27import "google/maps/fleetengine/v1/vehicles.proto";
28import "google/protobuf/duration.proto";
29import "google/protobuf/field_mask.proto";
30import "google/protobuf/timestamp.proto";
31import "google/protobuf/wrappers.proto";
32import "google/type/latlng.proto";
33
34option csharp_namespace = "Google.Maps.FleetEngine.V1";
35option go_package = "cloud.google.com/go/maps/fleetengine/apiv1/fleetenginepb;fleetenginepb";
36option java_multiple_files = true;
37option java_outer_classname = "VehicleApi";
38option java_package = "google.maps.fleetengine.v1";
39option objc_class_prefix = "CFE";
40
41// Vehicle management service.
42service VehicleService {
43  option (google.api.default_host) = "fleetengine.googleapis.com";
44  option (google.api.oauth_scopes) =
45      "https://www.googleapis.com/auth/cloud-platform";
46
47  // Instantiates a new vehicle associated with an on-demand rideshare or
48  // deliveries provider. Each `Vehicle` must have a unique vehicle ID.
49  //
50  // The following `Vehicle` fields are required when creating a `Vehicle`:
51  //
52  // * `vehicleState`
53  // * `supportedTripTypes`
54  // * `maximumCapacity`
55  // * `vehicleType`
56  //
57  // The following `Vehicle` fields are ignored when creating a `Vehicle`:
58  //
59  // * `name`
60  // * `currentTrips`
61  // * `availableCapacity`
62  // * `current_route_segment`
63  // * `current_route_segment_end_point`
64  // * `current_route_segment_version`
65  // * `current_route_segment_traffic`
66  // * `route`
67  // * `waypoints`
68  // * `waypoints_version`
69  // * `remaining_distance_meters`
70  // * `remaining_time_seconds`
71  // * `eta_to_next_waypoint`
72  // * `navigation_status`
73  //
74  // All other fields are optional and used if provided.
75  rpc CreateVehicle(CreateVehicleRequest) returns (Vehicle) {
76    option (google.api.http) = {
77      post: "/v1/{parent=providers/*}/vehicles"
78      body: "vehicle"
79    };
80    option (google.api.routing) = {
81      routing_parameters {
82        field: "parent"
83        path_template: "{provider_id=providers/*}"
84      }
85    };
86  }
87
88  // Returns a vehicle from the Fleet Engine.
89  rpc GetVehicle(GetVehicleRequest) returns (Vehicle) {
90    option (google.api.http) = {
91      get: "/v1/{name=providers/*/vehicles/*}"
92    };
93    option (google.api.routing) = {
94      routing_parameters {
95        field: "name"
96        path_template: "{provider_id=providers/*}"
97      }
98    };
99  }
100
101  // Writes updated vehicle data to the Fleet Engine.
102  //
103  // When updating a `Vehicle`, the following fields cannot be updated since
104  // they are managed by the server:
105  //
106  // * `currentTrips`
107  // * `availableCapacity`
108  // * `current_route_segment_version`
109  // * `waypoints_version`
110  //
111  // The vehicle `name` also cannot be updated.
112  //
113  // If the `attributes` field is updated, **all** the vehicle's attributes are
114  // replaced with the attributes provided in the request. If you want to update
115  // only some attributes, see the `UpdateVehicleAttributes` method. Likewise,
116  // the `waypoints` field can be updated, but must contain all the waypoints
117  // currently on the vehicle, and no other waypoints.
118  rpc UpdateVehicle(UpdateVehicleRequest) returns (Vehicle) {
119    option (google.api.http) = {
120      put: "/v1/{name=providers/*/vehicles/*}"
121      body: "vehicle"
122    };
123    option (google.api.routing) = {
124      routing_parameters {
125        field: "name"
126        path_template: "{provider_id=providers/*}"
127      }
128    };
129  }
130
131  // Deprecated: Use the `UpdateVehicle` method instead.
132  // UpdateVehicleLocation updates the location of the vehicle.
133  rpc UpdateVehicleLocation(UpdateVehicleLocationRequest)
134      returns (VehicleLocation) {
135    option deprecated = true;
136    option (google.api.http) = {
137      put: "/v1/{name=providers/*/vehicles/*}:updateLocation"
138      body: "*"
139    };
140    option (google.api.routing) = {
141      routing_parameters {
142        field: "name"
143        path_template: "{provider_id=providers/*}"
144      }
145    };
146  }
147
148  // Partially updates a vehicle's attributes.
149  // Only the attributes mentioned in the request will be updated, other
150  // attributes will NOT be altered. Note: this is different in `UpdateVehicle`,
151  // where the whole `attributes` field will be replaced by the one in
152  // `UpdateVehicleRequest`, attributes not in the request would be removed.
153  rpc UpdateVehicleAttributes(UpdateVehicleAttributesRequest)
154      returns (UpdateVehicleAttributesResponse) {
155    option (google.api.http) = {
156      post: "/v1/{name=providers/*/vehicles/*}:updateAttributes"
157      body: "*"
158    };
159    option (google.api.routing) = {
160      routing_parameters {
161        field: "name"
162        path_template: "{provider_id=providers/*}"
163      }
164    };
165  }
166
167  // Returns a paginated list of vehicles associated with
168  // a provider that match the request options.
169  rpc ListVehicles(ListVehiclesRequest) returns (ListVehiclesResponse) {
170    option (google.api.http) = {
171      get: "/v1/{parent=providers/*}/vehicles"
172    };
173    option (google.api.routing) = {
174      routing_parameters {
175        field: "parent"
176        path_template: "{provider_id=providers/*}"
177      }
178    };
179  }
180
181  // Returns a list of vehicles that match the request options.
182  rpc SearchVehicles(SearchVehiclesRequest) returns (SearchVehiclesResponse) {
183    option (google.api.http) = {
184      post: "/v1/{parent=providers/*}/vehicles:search"
185      body: "*"
186    };
187    option (google.api.routing) = {
188      routing_parameters {
189        field: "parent"
190        path_template: "{provider_id=providers/*}"
191      }
192    };
193  }
194
195  // Deprecated: Use `SearchVehicles` instead.
196  rpc SearchFuzzedVehicles(SearchVehiclesRequest)
197      returns (SearchVehiclesResponse) {
198    option deprecated = true;
199    option (google.api.http) = {
200      post: "/v1/{parent=providers/*}/vehicles:searchFuzzed"
201      body: "*"
202    };
203    option (google.api.routing) = {
204      routing_parameters {
205        field: "parent"
206        path_template: "{provider_id=providers/*}"
207      }
208    };
209  }
210}
211
212// `CreateVehicle` request message.
213message CreateVehicleRequest {
214  // The standard Fleet Engine request header.
215  RequestHeader header = 1;
216
217  // Required. Must be in the format `providers/{provider}`.
218  // The provider must be the Project ID (for example, `sample-cloud-project`)
219  // of the Google Cloud Project of which the service account making
220  // this call is a member.
221  string parent = 3 [(google.api.field_behavior) = REQUIRED];
222
223  // Required. Unique Vehicle ID.
224  // Subject to the following restrictions:
225  //
226  // * Must be a valid Unicode string.
227  // * Limited to a maximum length of 64 characters.
228  // * Normalized according to [Unicode Normalization Form C]
229  // (http://www.unicode.org/reports/tr15/).
230  // * May not contain any of the following ASCII characters: '/', ':', '?',
231  // ',', or '#'.
232  string vehicle_id = 4 [(google.api.field_behavior) = REQUIRED];
233
234  // Required. The Vehicle entity to create. When creating a Vehicle, the
235  // following fields are required:
236  //
237  // * `vehicleState`
238  // * `supportedTripTypes`
239  // * `maximumCapacity`
240  // * `vehicleType`
241  //
242  // When creating a Vehicle, the following fields are ignored:
243  //
244  // * `name`
245  // * `currentTrips`
246  // * `availableCapacity`
247  // * `current_route_segment`
248  // * `current_route_segment_end_point`
249  // * `current_route_segment_version`
250  // * `current_route_segment_traffic`
251  // * `route`
252  // * `waypoints`
253  // * `waypoints_version`
254  // * `remaining_distance_meters`
255  // * `remaining_time_seconds`
256  // * `eta_to_next_waypoint`
257  // * `navigation_status`
258  //
259  // All other fields are optional and used if provided.
260  Vehicle vehicle = 5 [(google.api.field_behavior) = REQUIRED];
261}
262
263// `GetVehicle` request message.
264message GetVehicleRequest {
265  // The standard Fleet Engine request header.
266  RequestHeader header = 1;
267
268  // Required. Must be in the format
269  // `providers/{provider}/vehicles/{vehicle}`.
270  // The provider must be the Project ID (for example, `sample-cloud-project`)
271  // of the Google Cloud Project of which the service account making
272  // this call is a member.
273  string name = 3 [
274    (google.api.field_behavior) = REQUIRED,
275    (google.api.resource_reference) = {
276      type: "fleetengine.googleapis.com/Vehicle"
277    }
278  ];
279
280  // Indicates the minimum timestamp (exclusive) for which
281  // `Vehicle.current_route_segment` is retrieved.
282  // If the route is unchanged since this timestamp, the `current_route_segment`
283  // field is not set in the response. If a minimum is unspecified, the
284  // `current_route_segment` is always retrieved.
285  google.protobuf.Timestamp current_route_segment_version = 4;
286
287  // Indicates the minimum timestamp (exclusive) for which `Vehicle.waypoints`
288  // data is retrieved. If the waypoints are unchanged since this timestamp, the
289  // `vehicle.waypoints` data is not set in the response. If this field is
290  // unspecified, `vehicle.waypoints` is always retrieved.
291  google.protobuf.Timestamp waypoints_version = 5;
292}
293
294// `UpdateVehicle request message.
295message UpdateVehicleRequest {
296  // The standard Fleet Engine request header.
297  RequestHeader header = 1;
298
299  // Required. Must be in the format
300  // `providers/{provider}/vehicles/{vehicle}`.
301  // The {provider} must be the Project ID (for example, `sample-cloud-project`)
302  // of the Google Cloud Project of which the service account making
303  // this call is a member.
304  string name = 3 [(google.api.field_behavior) = REQUIRED];
305
306  // Required. The `Vehicle` entity values to apply.  When updating a `Vehicle`,
307  // the following fields may not be updated as they are managed by the
308  // server.
309  //
310  // * `available_capacity`
311  // * `current_route_segment_version`
312  // * `current_trips`
313  // * `name`
314  // * `waypoints_version`
315  //
316  // If the `attributes` field is updated, **all** the vehicle's attributes are
317  // replaced with the attributes provided in the request. If you want to update
318  // only some attributes, see the `UpdateVehicleAttributes` method.
319  //
320  // Likewise, the `waypoints` field can be updated, but must contain all the
321  // waypoints currently on the vehicle, and no other waypoints.
322  Vehicle vehicle = 4 [(google.api.field_behavior) = REQUIRED];
323
324  // Required. A field mask indicating which fields of the `Vehicle` to update.
325  // At least one field name must be provided.
326  google.protobuf.FieldMask update_mask = 5
327      [(google.api.field_behavior) = REQUIRED];
328}
329
330// `UpdateVehicleLocation` request message.
331message UpdateVehicleLocationRequest {
332  option deprecated = true;
333
334  // The standard Fleet Engine request header.
335  RequestHeader header = 1;
336
337  // Required. Must be in the format
338  // `providers/{provider}/vehicles/{vehicle}`.
339  // The {provider} must be the Project ID (for example, `sample-cloud-project`)
340  // of the Google Cloud Project of which the service account making
341  // this call is a member.
342  string name = 3 [(google.api.field_behavior) = REQUIRED];
343
344  // Required. The vehicle's most recent location.  The `location` and
345  // `update_time` subfields are required.
346  VehicleLocation current_location = 4 [(google.api.field_behavior) = REQUIRED];
347
348  // Set the vehicle's state to either `ONLINE` or `OFFLINE`.
349  // If set to `UNKNOWN_VEHICLE_STATE`, the vehicle's state will not be altered.
350  VehicleState current_state = 5;
351}
352
353// `UpdateVehicleAttributes` request message.
354message UpdateVehicleAttributesRequest {
355  // The standard Fleet Engine request header.
356  RequestHeader header = 1;
357
358  // Required. Must be in the format `providers/{provider}/vehicles/{vehicle}`.
359  // The provider must be the Project ID (for example, `sample-cloud-project`)
360  // of the Google Cloud Project of which the service account making
361  // this call is a member.
362  string name = 3 [(google.api.field_behavior) = REQUIRED];
363
364  // Required. The vehicle attributes to update. Unmentioned attributes are not
365  // altered or removed.
366  repeated VehicleAttribute attributes = 4
367      [(google.api.field_behavior) = REQUIRED];
368}
369
370// `UpdateVehicleAttributes` response message.
371message UpdateVehicleAttributesResponse {
372  // Required. The updated full list of vehicle attributes, including new,
373  // altered, and untouched attributes.
374  repeated VehicleAttribute attributes = 1
375      [(google.api.field_behavior) = REQUIRED];
376}
377
378// `SearchVehicles` request message.
379message SearchVehiclesRequest {
380  // Specifies the order of the vehicle matches in the response.
381  enum VehicleMatchOrder {
382    // Default, used for unspecified or unrecognized vehicle matches order.
383    UNKNOWN_VEHICLE_MATCH_ORDER = 0;
384
385    // Ascending order by vehicle driving time to the pickup point.
386    PICKUP_POINT_ETA = 1;
387
388    // Ascending order by vehicle driving distance to the pickup point.
389    PICKUP_POINT_DISTANCE = 2;
390
391    // Ascending order by vehicle driving time to the dropoff point. This order
392    // can only be used if the dropoff point is specified in the request.
393    DROPOFF_POINT_ETA = 3;
394
395    // Ascending order by straight-line distance from the vehicle's last
396    // reported location to the pickup point.
397    PICKUP_POINT_STRAIGHT_DISTANCE = 4;
398
399    // Ascending order by the configured match cost. Match cost is defined as a
400    // weighted calculation between straight-line distance and ETA. Weights are
401    // set with default values and can be modified per customer. Please contact
402    // Google support if these weights need to be modified for your project.
403    COST = 5;
404  }
405
406  // Specifies the types of restrictions on a vehicle's current trips.
407  enum CurrentTripsPresent {
408    // The availability of vehicles with trips present is governed by the
409    // `include_back_to_back` field.
410    CURRENT_TRIPS_PRESENT_UNSPECIFIED = 0;
411
412    // Vehicles without trips can appear in search results. When this value is
413    // used, `include_back_to_back` cannot be `true`.
414    NONE = 1;
415
416    // Vehicles with at most 5 current trips and 10 waypoints are included
417    // in the search results. When this value is used, `include_back_to_back`
418    // cannot be `true`.
419    ANY = 2;
420  }
421
422  // The standard Fleet Engine request header.
423  RequestHeader header = 1;
424
425  // Required. Must be in the format `providers/{provider}`.
426  // The provider must be the Project ID (for example, `sample-cloud-project`)
427  // of the Google Cloud Project of which the service account making
428  // this call is a member.
429  string parent = 3 [(google.api.field_behavior) = REQUIRED];
430
431  // Required. The pickup point to search near.
432  TerminalLocation pickup_point = 4 [(google.api.field_behavior) = REQUIRED];
433
434  // The customer's intended dropoff location. The field is required if
435  // `trip_types` contains `TripType.SHARED`.
436  TerminalLocation dropoff_point = 5;
437
438  // Required. Defines the vehicle search radius around the pickup point. Only
439  // vehicles within the search radius will be returned. Value must be between
440  // 400 and 10000 meters (inclusive).
441  int32 pickup_radius_meters = 6 [(google.api.field_behavior) = REQUIRED];
442
443  // Required. Specifies the maximum number of vehicles to return. The value
444  // must be between 1 and 50 (inclusive).
445  int32 count = 7 [(google.api.field_behavior) = REQUIRED];
446
447  // Required. Specifies the number of passengers being considered for a trip.
448  // The value must be greater than or equal to one. The driver is not
449  // considered in the capacity value.
450  int32 minimum_capacity = 8 [(google.api.field_behavior) = REQUIRED];
451
452  // Required. Represents the type of proposed trip. Must include exactly one
453  // type. `UNKNOWN_TRIP_TYPE` is not allowed. Restricts the search to only
454  // those vehicles that can support that trip type.
455  repeated TripType trip_types = 9 [(google.api.field_behavior) = REQUIRED];
456
457  // Restricts the search to only those vehicles that have sent location updates
458  // to Fleet Engine within the specified duration. Stationary vehicles still
459  // transmitting their locations are not considered stale. If this field is not
460  // set, the server uses five minutes as the default value.
461  google.protobuf.Duration maximum_staleness = 10;
462
463  // Required. Restricts the search to vehicles with one of the specified types.
464  // At least one vehicle type must be specified. VehicleTypes with a category
465  // of `UNKNOWN` are not allowed.
466  repeated Vehicle.VehicleType vehicle_types = 14
467      [(google.api.field_behavior) = REQUIRED];
468
469  // Callers can form complex logical operations using any combination of the
470  // `required_attributes`, `required_one_of_attributes`, and
471  // `required_one_of_attribute_sets` fields.
472  //
473  // `required_attributes` is a list; `required_one_of_attributes` uses a
474  // message which allows a list of lists. In combination, the two fields allow
475  // the composition of this expression:
476  //
477  // ```
478  // (required_attributes[0] AND required_attributes[1] AND ...)
479  // AND
480  // (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR
481  // ...)
482  // AND
483  // (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR
484  // ...)
485  // ```
486  //
487  // Restricts the search to only those vehicles with the specified attributes.
488  // This field is a conjunction/AND operation. A max of 50 required_attributes
489  // is allowed. This matches the maximum number of attributes allowed on a
490  // vehicle.
491  repeated VehicleAttribute required_attributes = 12;
492
493  // Restricts the search to only those vehicles with at least one of
494  // the specified attributes in each `VehicleAttributeList`. Within each
495  // list, a vehicle must match at least one of the attributes. This field is an
496  // inclusive disjunction/OR operation in each `VehicleAttributeList` and a
497  // conjunction/AND operation across the collection of `VehicleAttributeList`.
498  repeated VehicleAttributeList required_one_of_attributes = 15;
499
500  // `required_one_of_attribute_sets` provides additional functionality.
501  //
502  // Similar to `required_one_of_attributes`, `required_one_of_attribute_sets`
503  // uses a message which allows a list of lists, allowing expressions such as
504  // this one:
505  //
506  // ```
507  // (required_attributes[0] AND required_attributes[1] AND ...)
508  // AND
509  // (
510  //   (required_one_of_attribute_sets[0][0] AND
511  //   required_one_of_attribute_sets[0][1] AND
512  //   ...)
513  //   OR
514  //   (required_one_of_attribute_sets[1][0] AND
515  //   required_one_of_attribute_sets[1][1] AND
516  //   ...)
517  // )
518  // ```
519  //
520  // Restricts the search to only those vehicles with all the attributes in a
521  // `VehicleAttributeList`. Within each list, a
522  // vehicle must match all of the attributes. This field is a conjunction/AND
523  // operation in each `VehicleAttributeList` and inclusive disjunction/OR
524  // operation across the collection of `VehicleAttributeList`.
525  repeated VehicleAttributeList required_one_of_attribute_sets = 20;
526
527  // Required. Specifies the desired ordering criterion for results.
528  VehicleMatchOrder order_by = 13 [(google.api.field_behavior) = REQUIRED];
529
530  // This indicates if vehicles with a single active trip are eligible for this
531  // search. This field is only used when `current_trips_present` is
532  // unspecified. When `current_trips_present` is unspecified  and  this field
533  // is `false`, vehicles with assigned trips are excluded from the search
534  // results. When `current_trips_present` is unspecified and this field is
535  // `true`, search results can include vehicles with one active trip that has a
536  // status of `ENROUTE_TO_DROPOFF`. When `current_trips_present` is specified,
537  // this field cannot be set to true.
538  //
539  // The default value is `false`.
540  bool include_back_to_back = 18;
541
542  // Indicates the trip associated with this `SearchVehicleRequest`.
543  string trip_id = 19;
544
545  // This indicates if vehicles with active trips are eligible for this search.
546  // This must be set to something other than
547  // `CURRENT_TRIPS_PRESENT_UNSPECIFIED` if `trip_type` includes `SHARED`.
548  CurrentTripsPresent current_trips_present = 21;
549
550  // Optional. A filter query to apply when searching vehicles. See
551  // http://aip.dev/160 for examples of the filter syntax.
552  //
553  // This field is designed to replace the `required_attributes`,
554  // `required_one_of_attributes`, and `required_one_of_attributes_sets` fields.
555  // If a non-empty value is specified here, the following fields must be empty:
556  // `required_attributes`, `required_one_of_attributes`, and
557  // `required_one_of_attributes_sets`.
558  //
559  // This filter functions as an AND clause with other constraints,
560  // such as `minimum_capacity` or `vehicle_types`.
561  //
562  // Note that the only queries supported are on vehicle attributes (for
563  // example, `attributes.<key> = <value>` or `attributes.<key1> = <value1> AND
564  // attributes.<key2> = <value2>`). The maximum number of restrictions allowed
565  // in a filter query is 50.
566  //
567  // Also, all attributes are stored as strings, so the only supported
568  // comparisons against attributes are string comparisons. In order to compare
569  // against number or boolean values, the values must be explicitly quoted to
570  // be treated as strings (for example, `attributes.<key> = "10"` or
571  // `attributes.<key> = "true"`).
572  string filter = 22 [(google.api.field_behavior) = OPTIONAL];
573}
574
575// `SearchVehicles` response message.
576message SearchVehiclesResponse {
577  // List of vehicles that match the `SearchVehiclesRequest` criteria, ordered
578  // according to `SearchVehiclesRequest.order_by` field.
579  repeated VehicleMatch matches = 1;
580}
581
582// `ListVehicles` request message.
583message ListVehiclesRequest {
584  // The standard Fleet Engine request header.
585  RequestHeader header = 12;
586
587  // Required. Must be in the format `providers/{provider}`.
588  // The provider must be the Project ID (for example, `sample-cloud-project`)
589  // of the Google Cloud Project of which the service account making
590  // this call is a member.
591  string parent = 1 [(google.api.field_behavior) = REQUIRED];
592
593  // The maximum number of vehicles to return.
594  // Default value: 100.
595  int32 page_size = 3;
596
597  // The value of the `next_page_token` provided by a previous call to
598  // `ListVehicles` so that you can paginate through groups of vehicles. The
599  // value is undefined if the filter criteria of the request is not the same as
600  // the filter criteria for the previous call to `ListVehicles`.
601  string page_token = 4;
602
603  // Specifies the required minimum capacity of the vehicle. All vehicles
604  // returned will have a `maximum_capacity` greater than or equal to this
605  // value. If set, must be greater or equal to 0.
606  google.protobuf.Int32Value minimum_capacity = 6;
607
608  // Restricts the response to vehicles that support at least one of the
609  // specified trip types.
610  repeated TripType trip_types = 7;
611
612  // Restricts the response to vehicles that have sent location updates to Fleet
613  // Engine within the specified duration. Stationary vehicles still
614  // transmitting their locations are not considered stale. If present, must be
615  // a valid positive duration.
616  google.protobuf.Duration maximum_staleness = 8;
617
618  // Required. Restricts the response to vehicles with one of the specified type
619  // categories. `UNKNOWN` is not allowed.
620  repeated Vehicle.VehicleType.Category vehicle_type_categories = 9
621      [(google.api.field_behavior) = REQUIRED];
622
623  // Callers can form complex logical operations using any combination of the
624  // `required_attributes`, `required_one_of_attributes`, and
625  // `required_one_of_attribute_sets` fields.
626  //
627  // `required_attributes` is a list; `required_one_of_attributes` uses a
628  // message which allows a list of lists. In combination, the two fields allow
629  // the composition of this expression:
630  //
631  // ```
632  // (required_attributes[0] AND required_attributes[1] AND ...)
633  // AND
634  // (required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR
635  // ...)
636  // AND
637  // (required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR
638  // ...)
639  // ```
640  //
641  // Restricts the response to vehicles with the specified attributes. This
642  // field is a conjunction/AND operation. A max of 50 required_attributes is
643  // allowed. This matches the maximum number of attributes allowed on a
644  // vehicle. Each repeated string should be of the format "key:value".
645  repeated string required_attributes = 10;
646
647  // Restricts the response to vehicles with at least one of the specified
648  // attributes in each `VehicleAttributeList`. Within each list, a vehicle must
649  // match at least one of the attributes. This field is an inclusive
650  // disjunction/OR operation in each `VehicleAttributeList` and a
651  // conjunction/AND operation across the collection of `VehicleAttributeList`.
652  // Each repeated string should be of the format
653  // "key1:value1|key2:value2|key3:value3".
654  repeated string required_one_of_attributes = 13;
655
656  // `required_one_of_attribute_sets` provides additional functionality.
657  //
658  // Similar to `required_one_of_attributes`, `required_one_of_attribute_sets`
659  // uses a message which allows a list of lists, allowing expressions such as
660  // this one:
661  //
662  // ```
663  // (required_attributes[0] AND required_attributes[1] AND ...)
664  // AND
665  // (
666  //   (required_one_of_attribute_sets[0][0] AND
667  //   required_one_of_attribute_sets[0][1] AND
668  //   ...)
669  //   OR
670  //   (required_one_of_attribute_sets[1][0] AND
671  //   required_one_of_attribute_sets[1][1] AND
672  //   ...)
673  // )
674  // ```
675  //
676  // Restricts the response to vehicles that match all the attributes in a
677  // `VehicleAttributeList`. Within each list, a vehicle must match all of the
678  // attributes. This field is a conjunction/AND operation in each
679  // `VehicleAttributeList` and inclusive disjunction/OR operation across the
680  // collection of `VehicleAttributeList`. Each repeated string should be of the
681  // format "key1:value1|key2:value2|key3:value3".
682  repeated string required_one_of_attribute_sets = 15;
683
684  // Restricts the response to vehicles that have this vehicle state.
685  VehicleState vehicle_state = 11;
686
687  // Only return the vehicles with current trip(s).
688  bool on_trip_only = 14;
689
690  // Optional. A filter query to apply when listing vehicles. See
691  // http://aip.dev/160 for examples of the filter syntax.
692  //
693  // This field is designed to replace the `required_attributes`,
694  // `required_one_of_attributes`, and `required_one_of_attributes_sets` fields.
695  // If a non-empty value is specified here, the following fields must be empty:
696  // `required_attributes`, `required_one_of_attributes`, and
697  // `required_one_of_attributes_sets`.
698  //
699  // This filter functions as an AND clause with other constraints,
700  // such as `vehicle_state` or `on_trip_only`.
701  //
702  // Note that the only queries supported are on vehicle attributes (for
703  // example, `attributes.<key> = <value>` or `attributes.<key1> = <value1> AND
704  // attributes.<key2> = <value2>`). The maximum number of restrictions allowed
705  // in a filter query is 50.
706  //
707  // Also, all attributes are stored as strings, so the only supported
708  // comparisons against attributes are string comparisons. In order to compare
709  // against number or boolean values, the values must be explicitly quoted to
710  // be treated as strings (for example, `attributes.<key> = "10"` or
711  // `attributes.<key> = "true"`).
712  string filter = 16 [(google.api.field_behavior) = OPTIONAL];
713
714  // Optional. A filter that limits the vehicles returned to those whose last
715  // known location was in the rectangular area defined by the viewport.
716  google.geo.type.Viewport viewport = 17
717      [(google.api.field_behavior) = OPTIONAL];
718}
719
720// `ListVehicles` response message.
721message ListVehiclesResponse {
722  // Vehicles matching the criteria in the request.
723  // The maximum number of vehicles returned is determined by the `page_size`
724  // field in the request.
725  repeated Vehicle vehicles = 1;
726
727  // Token to retrieve the next page of vehicles, or empty if there are no
728  // more vehicles that meet the request criteria.
729  string next_page_token = 2;
730
731  // Required. Total number of vehicles matching the request criteria across all
732  // pages.
733  int64 total_size = 3 [(google.api.field_behavior) = REQUIRED];
734}
735
736// Describes intermediate points along a route for a `VehicleMatch` in a
737// `SearchVehiclesResponse`. This concept is represented as a `TripWaypoint` in
738// all other endpoints.
739message Waypoint {
740  // The location of this waypoint.
741  google.type.LatLng lat_lng = 1;
742
743  // The estimated time that the vehicle will arrive at this waypoint.
744  google.protobuf.Timestamp eta = 2;
745}
746
747// Contains the vehicle and related estimates for a vehicle that match the
748// points of active trips for the vehicle `SearchVehiclesRequest`.
749message VehicleMatch {
750  // Type of vehicle match.
751  enum VehicleMatchType {
752    // Unknown vehicle match type
753    UNKNOWN = 0;
754
755    // The vehicle currently has no trip assigned to it and can proceed to the
756    // pickup point.
757    EXCLUSIVE = 1;
758
759    // The vehicle is currently assigned to a trip, but can proceed to the
760    // pickup point after completing the in-progress trip.  ETA and distance
761    // calculations take the existing trip into account.
762    BACK_TO_BACK = 2;
763
764    // The vehicle has sufficient capacity for a shared ride.
765    CARPOOL = 3;
766
767    // The vehicle will finish its current, active trip before proceeding to the
768    // pickup point.  ETA and distance calculations take the existing trip into
769    // account.
770    CARPOOL_BACK_TO_BACK = 4;
771  }
772
773  // Required. A vehicle that matches the request.
774  Vehicle vehicle = 1 [(google.api.field_behavior) = REQUIRED];
775
776  // The vehicle's driving ETA to the pickup point specified in the
777  // request. An empty value indicates a failure in calculating ETA for the
778  // vehicle.  If `SearchVehiclesRequest.include_back_to_back` was `true` and
779  // this vehicle has an active trip, `vehicle_pickup_eta` includes the time
780  // required to complete the current active trip.
781  google.protobuf.Timestamp vehicle_pickup_eta = 2;
782
783  // The distance from the Vehicle's current location to the pickup point
784  // specified in the request, including any intermediate pickup or dropoff
785  // points for existing trips. This distance comprises the calculated driving
786  // (route) distance, plus the straight line distance between the navigation
787  // end point and the requested pickup point. (The distance between the
788  // navigation end point and the requested pickup point is typically small.) An
789  // empty value indicates an error in calculating the distance.
790  google.protobuf.Int32Value vehicle_pickup_distance_meters = 3;
791
792  // Required. The straight-line distance between the vehicle and the pickup
793  // point specified in the request.
794  google.protobuf.Int32Value vehicle_pickup_straight_line_distance_meters = 11
795      [(google.api.field_behavior) = REQUIRED];
796
797  // The complete vehicle's driving ETA to the drop off point specified in the
798  // request. The ETA includes stopping at any waypoints before the
799  // `dropoff_point` specified in the request. The value will only be populated
800  // when a drop off point is specified in the request. An empty value indicates
801  // an error calculating the ETA.
802  google.protobuf.Timestamp vehicle_dropoff_eta = 4;
803
804  // The vehicle's driving distance (in meters) from the pickup point
805  // to the drop off point specified in the request. The distance is only
806  // between the two points and does not include the vehicle location or any
807  // other points that must be visited before the vehicle visits either the
808  // pickup point or dropoff point. The value will only be populated when a
809  // `dropoff_point` is specified in the request. An empty value indicates
810  // a failure in calculating the distance from the pickup to
811  // drop off point specified in the request.
812  google.protobuf.Int32Value vehicle_pickup_to_dropoff_distance_meters = 5;
813
814  // Required. The trip type of the request that was used to calculate the ETA
815  // to the pickup point.
816  TripType trip_type = 6 [(google.api.field_behavior) = REQUIRED];
817
818  // The ordered list of waypoints used to calculate the ETA. The list
819  // includes vehicle location, the pickup points of active
820  // trips for the vehicle, and the pickup points provided in the
821  // request. An empty list indicates a failure in calculating ETA for the
822  // vehicle.
823  repeated Waypoint vehicle_trips_waypoints = 7;
824
825  // Type of the vehicle match.
826  VehicleMatchType vehicle_match_type = 8;
827
828  // The order requested for sorting vehicle matches.
829  SearchVehiclesRequest.VehicleMatchOrder requested_ordered_by = 9;
830
831  // The actual order that was used for this vehicle. Normally this
832  // will match the 'order_by' field from the request; however, in certain
833  // circumstances such as an internal server error, a different method
834  // may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`).
835  SearchVehiclesRequest.VehicleMatchOrder ordered_by = 10;
836}
837
838// A list-of-lists datatype for vehicle attributes.
839message VehicleAttributeList {
840  // A list of attributes in this collection.
841  repeated VehicleAttribute attributes = 1;
842}
843