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