vehicle_api.proto 30 KB

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