REST Resource: providers.trips

Resource: Trip

Trip metadata.

JSON representation
{
  "name": string,
  "vehicleId": string,
  "tripStatus": enum (TripStatus),
  "tripType": enum (TripType),
  "pickupPoint": {
    object (TerminalLocation)
  },
  "actualPickupPoint": {
    object (StopLocation)
  },
  "actualPickupArrivalPoint": {
    object (StopLocation)
  },
  "pickupTime": string,
  "intermediateDestinations": [
    {
      object (TerminalLocation)
    }
  ],
  "intermediateDestinationsVersion": string,
  "intermediateDestinationIndex": integer,
  "actualIntermediateDestinationArrivalPoints": [
    {
      object (StopLocation)
    }
  ],
  "actualIntermediateDestinations": [
    {
      object (StopLocation)
    }
  ],
  "dropoffPoint": {
    object (TerminalLocation)
  },
  "actualDropoffPoint": {
    object (StopLocation)
  },
  "dropoffTime": string,
  "remainingWaypoints": [
    {
      object (TripWaypoint)
    }
  ],
  "vehicleWaypoints": [
    {
      object (TripWaypoint)
    }
  ],
  "route": [
    {
      object (LatLng)
    }
  ],
  "currentRouteSegment": string,
  "currentRouteSegmentVersion": string,
  "currentRouteSegmentTraffic": {
    object (ConsumableTrafficPolyline)
  },
  "currentRouteSegmentTrafficVersion": string,
  "currentRouteSegmentEndPoint": {
    object (TripWaypoint)
  },
  "remainingDistanceMeters": integer,
  "etaToFirstWaypoint": string,
  "remainingTimeToFirstWaypoint": string,
  "remainingWaypointsVersion": string,
  "remainingWaypointsRouteVersion": string,
  "numberOfPassengers": integer,
  "lastLocation": {
    object (VehicleLocation)
  },
  "lastLocationSnappable": boolean,
  "view": enum (TripView)
}
Fields
name

string

Output only. In the format "providers/{provider}/trips/{trip}"

vehicleId

string

ID of the vehicle making this trip.

tripStatus

enum (TripStatus)

Current status of the trip.

tripType

enum (TripType)

The type of the trip.

pickupPoint

object (TerminalLocation)

Location where customer indicates they will be picked up.

actualPickupPoint

object (StopLocation)

Input only. The actual location when and where customer was picked up. This field is for provider to provide feedback on actual pickup information.

actualPickupArrivalPoint

object (StopLocation)

Input only. The actual time and location of the driver arrival at the pickup point. This field is for provider to provide feedback on actual arrival information at the pickup point.

pickupTime

string (Timestamp format)

Output only. Either the estimated future time when the rider(s) will be picked up, or the actual time when they were picked up.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

intermediateDestinations[]

object (TerminalLocation)

Intermediate stops in order that the trip requests (in addition to pickup and dropoff). Initially this will not be supported for shared trips.

intermediateDestinationsVersion

string (Timestamp format)

Indicates the last time the intermediateDestinations was modified. Your server should cache this value and pass it in UpdateTripRequest when update intermediateDestinationIndex to ensure the intermediateDestinations is not changed.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

intermediateDestinationIndex

integer

When TripStatus is ENROUTE_TO_INTERMEDIATE_DESTINATION, a number between [0..N-1] indicating which intermediate destination the vehicle will cross next. When TripStatus is ARRIVED_AT_INTERMEDIATE_DESTINATION, a number between [0..N-1] indicating which intermediate destination the vehicle is at. The provider sets this value. If there are no intermediateDestinations, this field is ignored.

actualIntermediateDestinationArrivalPoints[]

object (StopLocation)

Input only. The actual time and location of the driver's arrival at an intermediate destination. This field is for provider to provide feedback on actual arrival information at intermediate destinations.

actualIntermediateDestinations[]

object (StopLocation)

Input only. The actual time and location when and where the customer was picked up from an intermediate destination. This field is for provider to provide feedback on actual pickup information at intermediate destinations.

dropoffPoint

object (TerminalLocation)

Location where customer indicates they will be dropped off.

actualDropoffPoint

object (StopLocation)

Input only. The actual time and location when and where customer was dropped off. This field is for provider to provide feedback on actual dropoff information.

dropoffTime

string (Timestamp format)

Output only. Either the estimated future time when the rider(s) will be dropped off at the final destination, or the actual time when they were dropped off.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

remainingWaypoints[]

object (TripWaypoint)

Output only. The full path from the current location to the dropoff point, inclusive. This path could include waypoints from other trips.

vehicleWaypoints[]

object (TripWaypoint)

This field supports manual ordering of the waypoints for the trip. It contains all of the remaining waypoints for the assigned vehicle, as well as the pickup and drop-off waypoints for this trip. If the trip hasn't been assigned to a vehicle, then Fleet Engine ignores this field. For privacy reasons, this field is only populated by the server on trips.update and trips.create calls, NOT on trips.get calls.

route[]

object (LatLng)

Output only. Anticipated route for this trip to the first entry in remainingWaypoints. Note that the first waypoint may belong to a different trip.

currentRouteSegment

string

Output only. An encoded path to the next waypoint.

Note: This field is intended only for use by the Driver SDK and Consumer SDK. Decoding is not yet supported.

currentRouteSegmentVersion

string (Timestamp format)

Output only. Indicates the last time the route was modified.

Note: This field is intended only for use by the Driver SDK and Consumer SDK.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

currentRouteSegmentTraffic

object (ConsumableTrafficPolyline)

Output only. Indicates the traffic conditions along the currentRouteSegment when they're available.

Note: This field is intended only for use by the Driver SDK and Consumer SDK.

currentRouteSegmentTrafficVersion

string (Timestamp format)

Output only. Indicates the last time the currentRouteSegmentTraffic was modified.

Note: This field is intended only for use by the Driver SDK and Consumer SDK.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

currentRouteSegmentEndPoint

object (TripWaypoint)

Output only. The waypoint where currentRouteSegment ends.

remainingDistanceMeters

integer

Output only. The remaining driving distance in the currentRouteSegment field. The value is unspecified if the trip is not assigned to a vehicle, or the trip is completed or cancelled.

etaToFirstWaypoint

string (Timestamp format)

Output only. The ETA to the next waypoint (the first entry in the remainingWaypoints field). The value is unspecified if the trip is not assigned to a vehicle, or the trip is inactive (completed or cancelled).

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

remainingTimeToFirstWaypoint

string (Duration format)

Output only. The duration from when the Trip data is returned to the time in Trip.eta_to_first_waypoint. The value is unspecified if the trip is not assigned to a vehicle, or the trip is inactive (completed or cancelled).

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

remainingWaypointsVersion

string (Timestamp format)

Output only. Indicates the last time that remainingWaypoints was changed (a waypoint was added, removed, or changed).

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

remainingWaypointsRouteVersion

string (Timestamp format)

Output only. Indicates the last time the remainingWaypoints.path_to_waypoint and remainingWaypoints.traffic_to_waypoint were modified. Your client app should cache this value and pass it in GetTripRequest to ensure the paths and traffic for remainingWaypoints are only returned if updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

numberOfPassengers

integer

Immutable. Indicates the number of passengers on this trip and does not include the driver. A vehicle must have available capacity to be returned in a vehicles.search response.

lastLocation

object (VehicleLocation)

Output only. Indicates the last reported location of the vehicle along the route.

lastLocationSnappable

boolean

Output only. Indicates whether the vehicle's lastLocation can be snapped to the currentRouteSegment. False if lastLocation or currentRouteSegment doesn't exist. It is computed by Fleet Engine. Any update from clients will be ignored.

view

enum (TripView)

The subset of Trip fields that are populated and how they should be interpreted.

TripStatus

The status of a trip indicating its progression.

Enums
UNKNOWN_TRIP_STATUS Default, used for unspecified or unrecognized trip status.
NEW Newly created trip.
ENROUTE_TO_PICKUP The driver is on their way to the pickup point.
ARRIVED_AT_PICKUP The driver has arrived at the pickup point.
ARRIVED_AT_INTERMEDIATE_DESTINATION The driver has arrived at an intermediate destination and is waiting for the rider.
ENROUTE_TO_INTERMEDIATE_DESTINATION The driver is on their way to an intermediate destination (not the dropoff point).
ENROUTE_TO_DROPOFF The driver has picked up the rider and is on their way to the next destination.
COMPLETE The rider has been dropped off and the trip is complete.
CANCELED The trip was canceled prior to pickup by the driver, rider, or rideshare provider.

StopLocation

The actual location where a stop (pickup/dropoff) happened.

JSON representation
{
  "point": {
    object (LatLng)
  },
  "timestamp": string,
  "stopTime": string
}
Fields
point

object (LatLng)

Required. Denotes the actual location.

timestamp

string (Timestamp format)

Indicates when the stop happened.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

stopTime
(deprecated)

string (Timestamp format)

Input only. Deprecated. Use the timestamp field.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

TripView

Selector for different sets of Trip fields in a trips.get response. See AIP-157 for context. Additional views are likely to be added.

Enums
TRIP_VIEW_UNSPECIFIED The default value. For backwards-compatibility, the API will default to an SDK view. To ensure stability and support, customers are advised to select a TripView other than SDK.
SDK Includes fields that may not be interpretable or supportable using publicly available libraries.
JOURNEY_SHARING_V1S Trip fields are populated for the Journey Sharing use case. This view is intended for server-to-server communications.

Methods

create

Creates a trip in the Fleet Engine and returns the new trip.

get

Get information about a single trip.
Get all the trips for a specific vehicle.

update

Updates trip data.