trips.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/maps/fleetengine/v1/fleetengine.proto";
  19. import "google/maps/fleetengine/v1/traffic.proto";
  20. import "google/protobuf/duration.proto";
  21. import "google/protobuf/timestamp.proto";
  22. import "google/protobuf/wrappers.proto";
  23. import "google/type/latlng.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/maps/fleetengine/v1;fleetengine";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "Trips";
  27. option java_package = "google.maps.fleetengine.v1";
  28. option objc_class_prefix = "CFE";
  29. // Trip metadata.
  30. message Trip {
  31. option (google.api.resource) = {
  32. type: "fleetengine.googleapis.com/Trip"
  33. pattern: "providers/{provider}/trips/{trip}"
  34. };
  35. // Output only. In the format "providers/{provider}/trips/{trip}"
  36. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  37. // ID of the vehicle making this trip.
  38. string vehicle_id = 2;
  39. // Current status of the trip.
  40. TripStatus trip_status = 3;
  41. // The type of the trip.
  42. TripType trip_type = 4;
  43. // Location where customer indicates they will be picked up.
  44. TerminalLocation pickup_point = 5;
  45. // Input only. The actual location when and where customer was picked up.
  46. // This field is for provider to provide feedback on actual pickup
  47. // information.
  48. StopLocation actual_pickup_point = 22
  49. [(google.api.field_behavior) = INPUT_ONLY];
  50. // Input only. The actual time and location of the driver arrival at
  51. // the pickup point.
  52. // This field is for provider to provide feedback on actual arrival
  53. // information at the pickup point.
  54. StopLocation actual_pickup_arrival_point = 32
  55. [(google.api.field_behavior) = INPUT_ONLY];
  56. // Output only. Either the estimated future time when the rider(s) will be
  57. // picked up, or the actual time when they were picked up.
  58. google.protobuf.Timestamp pickup_time = 6
  59. [(google.api.field_behavior) = OUTPUT_ONLY];
  60. // Intermediate stops in order that the trip requests (in addition
  61. // to pickup and dropoff). Initially this will not be supported for shared
  62. // trips.
  63. repeated TerminalLocation intermediate_destinations = 14;
  64. // Indicates the last time the `intermediate_destinations` was modified.
  65. // Your server should cache this value and pass it in `UpdateTripRequest`
  66. // when update `intermediate_destination_index` to ensure the
  67. // `intermediate_destinations` is not changed.
  68. google.protobuf.Timestamp intermediate_destinations_version = 25;
  69. // When `TripStatus` is `ENROUTE_TO_INTERMEDIATE_DESTINATION`, a number
  70. // between [0..N-1] indicating which intermediate destination the vehicle will
  71. // cross next. When `TripStatus` is `ARRIVED_AT_INTERMEDIATE_DESTINATION`, a
  72. // number between [0..N-1] indicating which intermediate destination the
  73. // vehicle is at. The provider sets this value. If there are no
  74. // `intermediate_destinations`, this field is ignored.
  75. int32 intermediate_destination_index = 15;
  76. // Input only. The actual time and location of the driver's arrival at
  77. // an intermediate destination.
  78. // This field is for provider to provide feedback on actual arrival
  79. // information at intermediate destinations.
  80. repeated StopLocation actual_intermediate_destination_arrival_points = 33
  81. [(google.api.field_behavior) = INPUT_ONLY];
  82. // Input only. The actual time and location when and where the customer was
  83. // picked up from an intermediate destination. This field is for provider to
  84. // provide feedback on actual pickup information at intermediate destinations.
  85. repeated StopLocation actual_intermediate_destinations = 34
  86. [(google.api.field_behavior) = INPUT_ONLY];
  87. // Location where customer indicates they will be dropped off.
  88. TerminalLocation dropoff_point = 7;
  89. // Input only. The actual time and location when and where customer was
  90. // dropped off. This field is for provider to provide feedback on actual
  91. // dropoff information.
  92. StopLocation actual_dropoff_point = 23
  93. [(google.api.field_behavior) = INPUT_ONLY];
  94. // Output only. Either the estimated future time when the rider(s) will be
  95. // dropped off at the final destination, or the actual time when they were
  96. // dropped off.
  97. google.protobuf.Timestamp dropoff_time = 8
  98. [(google.api.field_behavior) = OUTPUT_ONLY];
  99. // Output only. The full path from the current location to the dropoff point,
  100. // inclusive. This path could include waypoints from other trips.
  101. repeated TripWaypoint remaining_waypoints = 16
  102. [(google.api.field_behavior) = OUTPUT_ONLY];
  103. // This field supports manual ordering of the waypoints for the trip. It
  104. // contains all of the remaining waypoints for the assigned vehicle, as well
  105. // as the pickup and drop-off waypoints for this trip. If the trip hasn't been
  106. // assigned to a vehicle, then this field is ignored. For privacy reasons,
  107. // this field is only populated by the server on UpdateTrip and CreateTrip
  108. // calls, NOT on GetTrip calls.
  109. repeated TripWaypoint vehicle_waypoints = 20;
  110. // Output only. Anticipated route for this trip to the first entry in
  111. // remaining_waypoints. Note that the first waypoint may belong to a different
  112. // trip.
  113. repeated google.type.LatLng route = 9
  114. [(google.api.field_behavior) = OUTPUT_ONLY];
  115. // Output only. An encoded path to the next waypoint.
  116. //
  117. // Note: This field is intended only for use by the Driver SDK and Consumer
  118. // SDK. Decoding is not yet supported.
  119. string current_route_segment = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
  120. // Output only. Indicates the last time the route was modified.
  121. //
  122. // Note: This field is intended only for use by the Driver SDK and Consumer
  123. // SDK.
  124. google.protobuf.Timestamp current_route_segment_version = 17
  125. [(google.api.field_behavior) = OUTPUT_ONLY];
  126. // Output only. Indicates the traffic conditions along the
  127. // `current_route_segment` when they're available.
  128. //
  129. // Note: This field is intended only for use by the Driver SDK and Consumer
  130. // SDK.
  131. ConsumableTrafficPolyline current_route_segment_traffic = 28
  132. [(google.api.field_behavior) = OUTPUT_ONLY];
  133. // Output only. Indicates the last time the `current_route_segment_traffic`
  134. // was modified.
  135. //
  136. // Note: This field is intended only for use by the Driver SDK and Consumer
  137. // SDK.
  138. google.protobuf.Timestamp current_route_segment_traffic_version = 30
  139. [(google.api.field_behavior) = OUTPUT_ONLY];
  140. // Output only. The waypoint where `current_route_segment` ends.
  141. TripWaypoint current_route_segment_end_point = 24
  142. [(google.api.field_behavior) = OUTPUT_ONLY];
  143. // Output only. The remaining driving distance in the `current_route_segment`
  144. // field. The value is unspecified if the trip is not assigned to a vehicle,
  145. // or the trip is completed or cancelled.
  146. google.protobuf.Int32Value remaining_distance_meters = 12
  147. [(google.api.field_behavior) = OUTPUT_ONLY];
  148. // Output only. The ETA to the next waypoint (the first entry in the
  149. // `remaining_waypoints` field). The value is unspecified if the trip is not
  150. // assigned to a vehicle, or the trip is inactive (completed or cancelled).
  151. google.protobuf.Timestamp eta_to_first_waypoint = 13
  152. [(google.api.field_behavior) = OUTPUT_ONLY];
  153. // Output only. The duration from when the Trip data is returned to the time
  154. // in `Trip.eta_to_first_waypoint`. The value is unspecified if the trip is
  155. // not assigned to a vehicle, or the trip is inactive (completed or
  156. // cancelled).
  157. google.protobuf.Duration remaining_time_to_first_waypoint = 27
  158. [(google.api.field_behavior) = OUTPUT_ONLY];
  159. // Output only. Indicates the last time that `remaining_waypoints` was changed
  160. // (a waypoint was added, removed, or changed).
  161. google.protobuf.Timestamp remaining_waypoints_version = 19
  162. [(google.api.field_behavior) = OUTPUT_ONLY];
  163. // Output only. Indicates the last time the
  164. // `remaining_waypoints.path_to_waypoint` and
  165. // `remaining_waypoints.traffic_to_waypoint` were modified. Your client app
  166. // should cache this value and pass it in `GetTripRequest` to ensure the
  167. // paths and traffic for `remaining_waypoints` are only returned if updated.
  168. google.protobuf.Timestamp remaining_waypoints_route_version = 29
  169. [(google.api.field_behavior) = OUTPUT_ONLY];
  170. // Immutable. Indicates the number of passengers on this trip and does not
  171. // include the driver. A vehicle must have available capacity to be returned
  172. // in SearchVehicles.
  173. int32 number_of_passengers = 10 [(google.api.field_behavior) = IMMUTABLE];
  174. // Output only. Indicates the last reported location of the vehicle along the
  175. // route.
  176. VehicleLocation last_location = 11
  177. [(google.api.field_behavior) = OUTPUT_ONLY];
  178. // Output only. Indicates whether the vehicle's `last_location` can be snapped
  179. // to the current_route_segment. False if `last_location` or
  180. // `current_route_segment` doesn't exist.
  181. // It is computed by Fleet Engine. Any update from clients will be ignored.
  182. bool last_location_snappable = 26 [(google.api.field_behavior) = OUTPUT_ONLY];
  183. // The subset of Trip fields that are populated and how they should be
  184. // interpreted.
  185. TripView view = 31;
  186. }
  187. // The actual location where a stop (pickup/dropoff) happened.
  188. message StopLocation {
  189. // Required. Denotes the actual location.
  190. google.type.LatLng point = 1 [(google.api.field_behavior) = REQUIRED];
  191. // Indicates when the stop happened.
  192. google.protobuf.Timestamp timestamp = 2;
  193. // Input only. Deprecated. Use the timestamp field.
  194. google.protobuf.Timestamp stop_time = 3
  195. [deprecated = true, (google.api.field_behavior) = INPUT_ONLY];
  196. }
  197. // The status of a trip indicating its progression.
  198. enum TripStatus {
  199. // Default, used for unspecified or unrecognized trip status.
  200. UNKNOWN_TRIP_STATUS = 0;
  201. // Newly created trip.
  202. NEW = 1;
  203. // The driver is on their way to the pickup point.
  204. ENROUTE_TO_PICKUP = 2;
  205. // The driver has arrived at the pickup point.
  206. ARRIVED_AT_PICKUP = 3;
  207. // The driver has arrived at an intermediate destination and is waiting for
  208. // the rider.
  209. ARRIVED_AT_INTERMEDIATE_DESTINATION = 7;
  210. // The driver is on their way to an intermediate destination
  211. // (not the dropoff point).
  212. ENROUTE_TO_INTERMEDIATE_DESTINATION = 8;
  213. // The driver has picked up the rider and is on their way to the
  214. // next destination.
  215. ENROUTE_TO_DROPOFF = 4;
  216. // The rider has been dropped off and the trip is complete.
  217. COMPLETE = 5;
  218. // The trip was canceled prior to pickup by the driver, rider, or
  219. // rideshare provider.
  220. CANCELED = 6;
  221. }
  222. // A set of values that indicate upon which platform the request was issued.
  223. enum BillingPlatformIdentifier {
  224. // Default. Used for unspecified platforms.
  225. BILLING_PLATFORM_IDENTIFIER_UNSPECIFIED = 0;
  226. // The platform is a client server.
  227. SERVER = 1;
  228. // The platform is a web browser.
  229. WEB = 2;
  230. // The platform is an Android mobile device.
  231. ANDROID = 3;
  232. // The platform is an IOS mobile device.
  233. IOS = 4;
  234. // Other platforms that are not listed in this enumeration.
  235. OTHERS = 5;
  236. }
  237. // Selector for different sets of Trip fields in a `GetTrip` response. See
  238. // [AIP-157](https://google.aip.dev/157) for context. Additional views are
  239. // likely to be added.
  240. enum TripView {
  241. // The default value. For backwards-compatibility, the API will default to an
  242. // SDK view. To ensure stability and support, customers are
  243. // advised to select a `TripView` other than `SDK`.
  244. TRIP_VIEW_UNSPECIFIED = 0;
  245. // Includes fields that may not be interpretable or supportable using
  246. // publicly available libraries.
  247. SDK = 1;
  248. // Trip fields are populated for the Journey Sharing use case. This view is
  249. // intended for server-to-server communications.
  250. JOURNEY_SHARING_V1S = 2;
  251. }