trips.proto 11 KB

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