# GoogleRidesharingConsumer Framework Reference

# GMTSTrip

    @interface GMTSTrip : https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCImmutableData.html

Object that contains logistical information about a trip such as
`vehicleId`, type of trip, pickup or dropoff times, and route.
- `


  ### [tripName](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)tripName)


  ` Name of the trip.

  #### Declaration

  Swift

      var tripName: String? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) NSString *tripName;

- `


  ### [vehicleID](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)vehicleID)


  ` ID of vehicle servicing the trip.

  #### Declaration

  Swift

      var vehicleID: String? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Type-Definitions/GMTCFleetEngineIDString.html *vehicleID;

- `


  ### [tripType](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)tripType)


  ` The current trip type, see `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripType.html` for all the options.

  #### Declaration

  Swift

      var tripType: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripType.html { get }

  Objective-C

      @property (nonatomic, readonly) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripType.html tripType;

- `


  ### [tripStatus](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)tripStatus)


  ` The current trip status, `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripStatus.html` listed for all the possible statuses.

  #### Declaration

  Swift

      var tripStatus: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripStatus.html { get }

  Objective-C

      @property (nonatomic, readonly) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripStatus.html tripStatus;

- `


  ### [pickupLocation](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)pickupLocation)


  ` The pickup location of the trip.

  #### Declaration

  Swift

      var pickupLocation: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html *pickupLocation;

- `


  ### [pickupTime](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)pickupTime)


  ` The estimated time of arrival at the pickup location.

  #### Declaration

  Swift

      var pickupTime: TimeInterval { get }

  Objective-C

      @property (nonatomic, readonly) NSTimeInterval pickupTime;

- `


  ### [dropoffLocation](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)dropoffLocation)


  ` The drop off location of the trip.

  #### Declaration

  Swift

      var dropoffLocation: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html *dropoffLocation;

- `


  ### [dropoffTime](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)dropoffTime)


  ` The estimated time of arrival at the drop off location.

  #### Declaration

  Swift

      var dropoffTime: TimeInterval { get }

  Objective-C

      @property (nonatomic, readonly) NSTimeInterval dropoffTime;

- `


  ### [lastVehicleLocation](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)lastVehicleLocation)


  ` The last location information of the vehicle for the trip.

  #### Declaration

  Swift

      var lastVehicleLocation: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSVehicleLocation.html? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSVehicleLocation.html *lastVehicleLocation;

- `


  ### [numberOfPassengers](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)numberOfPassengers)


  ` The number of passengers allowed for the current trip.

  #### Declaration

  Swift

      var numberOfPassengers: UInt { get }

  Objective-C

      @property (nonatomic, readonly) NSUInteger numberOfPassengers;

- `


  ### [remainingWaypoints](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)remainingWaypoints)


  ` Array of waypoints on the trip route.

  #### Declaration

  Swift

      var remainingWaypoints: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html]? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html *> *remainingWaypoints;

- `


  ### [intermediateDestinations](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)intermediateDestinations)


  ` The array of the consumer's remaining waypoints.

  #### Declaration

  Swift

      var intermediateDestinations: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html]? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html *> *intermediateDestinations;

- `


  ### [intermediateDestinationIndex](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(py)intermediateDestinationIndex)


  ` Index of the intermediate waypoint that the vehicle will arrive at next. If there are no
  intermediate waypoints, this field is ignored.

  #### Declaration

  Swift

      var intermediateDestinationIndex: Int32 { get }

  Objective-C

      @property (nonatomic, readonly) int32_t intermediateDestinationIndex;

- `


  ### [-tripID](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)tripID)


  ` Returns the tripID for the current trip, converted from tripName.

  #### Declaration

  Swift

      func tripID() -> String?

  Objective-C

      - (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Type-Definitions/GMTCFleetEngineIDString.html *)tripID;

- `


  ### [-nextTripWaypoint](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)nextTripWaypoint)


  ` Returns the first waypoint in the remaining waypoints list.

  #### Declaration

  Swift

      func nextTripWaypoint() -> https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html?

  Objective-C

      - (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html *)nextTripWaypoint;

- `


  ### [-nextWaypoint](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)nextWaypoint)


  ` Returns the next waypoint to be visited. The next waypoint might not belong
  to this trip if this trip is chained or shared.

  #### Declaration

  Swift

      func nextWaypoint() -> https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html?

  Objective-C

      - (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html *)nextWaypoint;

- `


  ### [-activeRoute](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)activeRoute)


  ` Returns the active route of the given trip.
  This route is from the current location of the vehicle to the current user's
  next destination. Unlike the next waypoint in a back-to-back or carpool trip, the next waypoint
  may not be related to the current user. The return value is generated the first time it is
  accessed, and then cached.

  #### Declaration

  Swift

      func activeRoute() -> [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html]?

  Objective-C

      - (nullable NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html *> *)activeRoute;

- `


  ### [-remainingRoute](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)remainingRoute)


  ` Returns the remaining route of the given trip.
  The remaining route is the route segment from the current user's next destination to the
  user's final destination.

  #### Declaration

  Swift

      func remainingRoute() -> [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html]?

  Objective-C

      - (nullable NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html *> *)remainingRoute;

- `


  ### [-activeRouteTraffic](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)activeRouteTraffic)


  ` Returns the traffic data for the active route of this trip.
  This route is from the current location of the vehicle to the current user's
  next destination. Unlike the next waypoint in a back-to-back or carpool trip, the next waypoint
  may not be related to the current user. The return value is generated the first time it is
  accessed, and then cached.

  #### Declaration

  Swift

      func activeRouteTraffic() -> https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData.html?

  Objective-C

      - (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData.html *)activeRouteTraffic;

- `


  ### [-remainingRouteTraffic](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)remainingRouteTraffic)


  ` Returns the traffic data for the remaining route of this trip.
  The remaining route is the route segment from the current user's next destination to the
  user's final destination.

  #### Declaration

  Swift

      func remainingRouteTraffic() -> https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData.html?

  Objective-C

      - (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData.html *)remainingRouteTraffic;

- `


  ### [-remainingDistanceOfActiveRouteInMeters](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)remainingDistanceOfActiveRouteInMeters)


  ` Returns the remaining distance of the active route.
  The active route means the route segment from the vehicle's location to the current user's next
  destination.

  #### Declaration

  Swift

      func remainingDistanceOfActiveRouteInMeters() -> Int32

  Objective-C

      - (int32_t)remainingDistanceOfActiveRouteInMeters;

- `


  ### [-distanceOfRemainingRouteInMeters](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)distanceOfRemainingRouteInMeters)


  ` Returns the distance of the remaining route.
  The remaining route means the route segment from the current user's next destination to their
  last destination.

  #### Declaration

  Swift

      func distanceOfRemainingRouteInMeters() -> Int32

  Objective-C

      - (int32_t)distanceOfRemainingRouteInMeters;

- `


  ### [+propertyValueDifferencesBetweenTrip1:andTrip2:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(cm)propertyValueDifferencesBetweenTrip1:andTrip2:)


  ` Calculate the difference between two given trips. Each property difference will be accumulated
  into the return result.

  #### Declaration

  Swift

      class func propertyValueDifferencesBetweenTrip1(_ trip1: GMTSTrip, andTrip2 trip2: GMTSTrip) -> https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripPropertyFields.html

  Objective-C

      + (https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripPropertyFields.html)
          propertyValueDifferencesBetweenTrip1:(nonnull GMTSTrip *)trip1
                                      andTrip2:(nonnull GMTSTrip *)trip2;

  #### Parameters

  |---|---|
  | ` trip1 ` | The first trip candidate. |
  | ` trip2 ` | The second trip candidate. |

- `


  ### [-initWithTripName:vehicleID:tripType:tripStatus:pickupLocation:pickupTime:dropoffLocation:dropoffTime:lastVehicleLocation:numberOfPassengers:remainingWaypoints:intermediateDestinations:intermediateDestinationIndex:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)initWithTripName:vehicleID:tripType:tripStatus:pickupLocation:pickupTime:dropoffLocation:dropoffTime:lastVehicleLocation:numberOfPassengers:remainingWaypoints:intermediateDestinations:intermediateDestinationIndex:)


  ` Instantiates an instance of this class.

  #### Declaration

  Swift

      init(tripName: String?, vehicleID: String?, tripType: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripType.html, tripStatus: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripStatus.html, pickupLocation: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html?, pickupTime: TimeInterval, dropoffLocation: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html?, dropoffTime: TimeInterval, last lastVehicleLocation: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSVehicleLocation.html?, numberOfPassengers: UInt, remaining remainingWaypoints: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html]?, intermediateDestinations: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html]?, intermediateDestinationIndex: Int32)

  Objective-C

      - (nonnull instancetype)
                      initWithTripName:(nullable NSString *)tripName
                             vehicleID:(nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Type-Definitions/GMTCFleetEngineIDString.html *)vehicleID
                              tripType:(https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripType.html)tripType
                            tripStatus:(https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripStatus.html)tripStatus
                        pickupLocation:(nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html *)pickupLocation
                            pickupTime:(NSTimeInterval)pickupTime
                       dropoffLocation:
                           (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html *)dropoffLocation
                           dropoffTime:(NSTimeInterval)dropoffTime
                   lastVehicleLocation:
                       (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSVehicleLocation.html *)lastVehicleLocation
                    numberOfPassengers:(NSUInteger)numberOfPassengers
                    remainingWaypoints:
                        (nullable NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTripWaypoint.html *> *)remainingWaypoints
              intermediateDestinations:
                  (nullable NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTerminalLocation.html *> *)intermediateDestinations
          intermediateDestinationIndex:(int32_t)intermediateDestinationIndex;

  #### Parameters

  |---|---|
  | ` tripName ` | Name of the trip. |
  | ` vehicleID ` | The ID of vehicle servicing the trip. |
  | ` tripType ` | Trip type, see enum `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripType.html` for all the options. |
  | ` tripStatus ` | Trip status, see enum `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTSTripStatus.html` for all the possible statuses. |
  | ` pickupLocation ` | The target pickup location. |
  | ` pickupTime ` | The estimated time for arriving at the pickup location. |
  | ` dropoffLocation ` | The target drop off location. |
  | ` dropoffTime ` | The estimated time for arriving at the drop off location. |
  | ` lastVehicleLocation ` | The last vehicle location information. |
  | ` numberOfPassengers ` | The number of passengers allowed in the trip. |
  | ` remainingWaypoints ` | The array of waypoints remaining on the trip. |
  | ` intermediateDestinations ` | The array of the consumer's remaining waypoints. |
  | ` intermediateDestinationIndex ` | Index of the intermediate waypoint that the vehicle will arrive at next. |

- `


  ### [-init](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrip#/c:objc(cs)GMTSTrip(im)init)


  ` Unavailable
  Use `-initWithTripName:vehicleID:tripType:tripStatus:pickupLocation:pickupTime:dropoffLocation:
  dropoffTime:route:lastVehicleLocation:numberOfPassengers:remainingWaypoints:
  intermediateDestinations:intermediateDestinationIndex:` instead.

  #### Declaration

  Objective-C

      - (nonnull instancetype)init;