GoogleRidesharingConsumer Framework Reference

GMTSTrip

@interface GMTSTrip : GMTCImmutableData

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

  • Name of the trip.

    Declaration

    Swift

    var tripName: String? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *tripName;
  • ID of vehicle servicing the trip.

    Declaration

    Swift

    var vehicleID: String? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) GMTCFleetEngineIDString *vehicleID;
  • The current trip type, see GMTSTripType for all the options.

    Declaration

    Swift

    var tripType: GMTSTripType { get }

    Objective-C

    @property (nonatomic, readonly) GMTSTripType tripType;
  • The current trip status, GMTSTripStatus listed for all the possible statuses.

    Declaration

    Swift

    var tripStatus: GMTSTripStatus { get }

    Objective-C

    @property (nonatomic, readonly) GMTSTripStatus tripStatus;
  • The pickup location of the trip.

    Declaration

    Swift

    var pickupLocation: GMTSTerminalLocation? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) GMTSTerminalLocation *pickupLocation;
  • The estimated time of arrival at the pickup location.

    Declaration

    Swift

    var pickupTime: TimeInterval { get }

    Objective-C

    @property (nonatomic, readonly) NSTimeInterval pickupTime;
  • The drop off location of the trip.

    Declaration

    Swift

    var dropoffLocation: GMTSTerminalLocation? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) GMTSTerminalLocation *dropoffLocation;
  • The estimated time of arrival at the drop off location.

    Declaration

    Swift

    var dropoffTime: TimeInterval { get }

    Objective-C

    @property (nonatomic, readonly) NSTimeInterval dropoffTime;
  • The last location information of the vehicle for the trip.

    Declaration

    Swift

    var lastVehicleLocation: GMTSVehicleLocation? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) GMTSVehicleLocation *lastVehicleLocation;
  • The number of passengers allowed for the current trip.

    Declaration

    Swift

    var numberOfPassengers: UInt { get }

    Objective-C

    @property (nonatomic, readonly) NSUInteger numberOfPassengers;
  • Array of waypoints on the trip route.

    Declaration

    Swift

    var remainingWaypoints: [GMTSTripWaypoint]? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) NSArray<GMTSTripWaypoint *> *remainingWaypoints;
  • The array of the consumer’s remaining waypoints.

    Declaration

    Swift

    var intermediateDestinations: [GMTSTerminalLocation]? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) NSArray<GMTSTerminalLocation *> *intermediateDestinations;
  • 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;
  • Returns the tripID for the current trip, converted from tripName.

    Declaration

    Swift

    func tripID() -> String?

    Objective-C

    - (nullable GMTCFleetEngineIDString *)tripID;
  • Returns the first waypoint in the remaining waypoints list.

    Declaration

    Swift

    func nextTripWaypoint() -> GMTSTripWaypoint?

    Objective-C

    - (nullable GMTSTripWaypoint *)nextTripWaypoint;
  • 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() -> GMTSTripWaypoint?

    Objective-C

    - (nullable GMTSTripWaypoint *)nextWaypoint;
  • 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() -> [GMTSLatLng]?

    Objective-C

    - (nullable NSArray<GMTSLatLng *> *)activeRoute;
  • 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() -> [GMTSLatLng]?

    Objective-C

    - (nullable NSArray<GMTSLatLng *> *)remainingRoute;
  • 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() -> GMTSTrafficData?

    Objective-C

    - (nullable GMTSTrafficData *)activeRouteTraffic;
  • 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() -> GMTSTrafficData?

    Objective-C

    - (nullable GMTSTrafficData *)remainingRouteTraffic;
  • 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;
  • 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;
  • 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) -> GMTSTripPropertyFields

    Objective-C

    + (GMTSTripPropertyFields)
        propertyValueDifferencesBetweenTrip1:(nonnull GMTSTrip *)trip1
                                    andTrip2:(nonnull GMTSTrip *)trip2;

    Parameters

    trip1

    The first trip candidate.

    trip2

    The second trip candidate.

  • Instantiates an instance of this class.

    Declaration

    Swift

    init(tripName: String?, vehicleID: String?, tripType: GMTSTripType, tripStatus: GMTSTripStatus, pickupLocation: GMTSTerminalLocation?, pickupTime: TimeInterval, dropoffLocation: GMTSTerminalLocation?, dropoffTime: TimeInterval, last lastVehicleLocation: GMTSVehicleLocation?, numberOfPassengers: UInt, remaining remainingWaypoints: [GMTSTripWaypoint]?, intermediateDestinations: [GMTSTerminalLocation]?, intermediateDestinationIndex: Int32)

    Objective-C

    - (nonnull instancetype)
                    initWithTripName:(nullable NSString *)tripName
                           vehicleID:(nullable GMTCFleetEngineIDString *)vehicleID
                            tripType:(GMTSTripType)tripType
                          tripStatus:(GMTSTripStatus)tripStatus
                      pickupLocation:(nullable GMTSTerminalLocation *)pickupLocation
                          pickupTime:(NSTimeInterval)pickupTime
                     dropoffLocation:
                         (nullable GMTSTerminalLocation *)dropoffLocation
                         dropoffTime:(NSTimeInterval)dropoffTime
                 lastVehicleLocation:
                     (nullable GMTSVehicleLocation *)lastVehicleLocation
                  numberOfPassengers:(NSUInteger)numberOfPassengers
                  remainingWaypoints:
                      (nullable NSArray<GMTSTripWaypoint *> *)remainingWaypoints
            intermediateDestinations:
                (nullable NSArray<GMTSTerminalLocation *> *)intermediateDestinations
        intermediateDestinationIndex:(int32_t)intermediateDestinationIndex;

    Parameters

    tripName

    Name of the trip.

    vehicleID

    The ID of vehicle servicing the trip.

    tripType

    Trip type, see enum GMTSTripType for all the options.

    tripStatus

    Trip status, see enum GMTSTripStatus 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.

  • Unavailable

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

    Declaration

    Objective-C

    - (nonnull instancetype)init;