GoogleRidesharingConsumer Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMTSVehicle
Object that contains functional data related to a vehicle. This data can be profile data, such as
the max capacity, or tracking data, such as current trips and location.
-
Declaration
Swift
var vehicleName: String? { get }
Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *vehicleName;
-
-
-
An array contains all the current trip ID.
Declaration
Swift
var currentTrips: [String]? { get }
Objective-C
@property (nonatomic, copy, readonly, nullable) NSArray<NSString *> *currentTrips;
-
The last location of the vehicle.
-
Declaration
Swift
var maximumCapacity: Int32 { get }
Objective-C
@property (nonatomic, readonly) int32_t maximumCapacity;
-
An array contains all the vehicle attributes.
-
The vehicle type information.
Declaration
Objective-C
@property (nonatomic, copy, readonly) GMTSVehicleType *_Nonnull vehicleType;
-
Initialization of the object.
Parameters
vehicleName
|
|
vehicleState
|
|
supportedTripTypes
|
All the supported trip types.
|
currentTrips
|
An array contains all the current trip ID.
|
lastLocation
|
The last location of the vehicle.
|
maximumCapacity
|
|
attributes
|
A dictionary contains all the vehicle attributes.
|
vehicleType
|
The vehicle type information.
|
-
Will return nil.
Use -initWithvehicleName:vehicleState:supportedTripTypes:currentTrips:lastLocation:
maximumCapacity:attributes:vehicleType:
instead.
Declaration
Objective-C
- (nonnull instancetype)init;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003eGMTSVehicle is an object containing both profile data, like maximum capacity, and tracking data, such as current trips and location, related to a vehicle.\u003c/p\u003e\n"],["\u003cp\u003eThe vehicle's state, supported trip types, current trip IDs, last known location, maximum capacity, attributes, and type information are all accessible through this object.\u003c/p\u003e\n"],["\u003cp\u003eThe object can be initialized with details such as vehicle name, state, supported trip types, current trips, last location, maximum capacity, attributes, and vehicle type.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003einit\u003c/code\u003e method is unavailable and will return nil; the designated initializer is \u003ccode\u003e-initWithvehicleName:vehicleState:supportedTripTypes:currentTrips:lastLocation:maximumCapacity:attributes:vehicleType:\u003c/code\u003e instead.\u003c/p\u003e\n"]]],["The `GMTSVehicle` object stores vehicle data, including profile and tracking information. Key properties include `vehicleName`, `vehicleState`, `supportedTripTypes`, and `currentTrips`. It also tracks `lastLocation`, `maximumCapacity`, `attributes`, and `vehicleType`. The primary initialization method, `initWithvehicleName:vehicleState:supportedTripTypes:currentTrips:lastLocation:maximumCapacity:attributes:vehicleType:`, sets these properties. An alternate init is unavailable. These properties can be used to manage and track a vehicle.\n"],null,["# GoogleRidesharingConsumer Framework Reference\n\nGMTSVehicle\n===========\n\n @interface GMTSVehicle : ../Classes/GMTCImmutableData.html\n\nObject that contains functional data related to a vehicle. This data can be profile data, such as\nthe max capacity, or tracking data, such as current trips and location.\n- `\n ``\n ``\n `\n\n ### [vehicleName](#/c:objc(cs)GMTSVehicle(py)vehicleName)\n\n `\n ` \n The name of the vehicle. \n\n #### Declaration\n\n Swift \n\n var vehicleName: String? { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly, nullable) NSString *vehicleName;\n\n- `\n ``\n ``\n `\n\n ### [vehicleState](#/c:objc(cs)GMTSVehicle(py)vehicleState)\n\n `\n ` \n The vehicle state, see [GMTSVehicleState](../Enums/GMTSVehicleState.html) for all the options. \n\n #### Declaration\n\n Swift \n\n var vehicleState: ../Enums/GMTSVehicleState.html { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Enums/GMTSVehicleState.html vehicleState;\n\n- `\n ``\n ``\n `\n\n ### [supportedTripTypes](#/c:objc(cs)GMTSVehicle(py)supportedTripTypes)\n\n `\n ` \n Supported trip types, see [GMTSVehicleSupportedTripTypes](../Enums/GMTSVehicleSupportedTripTypes.html) for all the options. \n\n #### Declaration\n\n Swift \n\n var supportedTripTypes: ../Enums/GMTSVehicleSupportedTripTypes.html { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Enums/GMTSVehicleSupportedTripTypes.html supportedTripTypes;\n\n- `\n ``\n ``\n `\n\n ### [currentTrips](#/c:objc(cs)GMTSVehicle(py)currentTrips)\n\n `\n ` \n An array contains all the current trip ID. \n\n #### Declaration\n\n Swift \n\n var currentTrips: [String]? { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly, nullable) NSArray\u003cNSString *\u003e *currentTrips;\n\n- `\n ``\n ``\n `\n\n ### [lastLocation](#/c:objc(cs)GMTSVehicle(py)lastLocation)\n\n `\n ` \n The last location of the vehicle. \n\n #### Declaration\n\n Swift \n\n @NSCopying var lastLocation: ../Classes/GMTSVehicleLocation.html? { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly, nullable) ../Classes/GMTSVehicleLocation.html *lastLocation;\n\n- `\n ``\n ``\n `\n\n ### [maximumCapacity](#/c:objc(cs)GMTSVehicle(py)maximumCapacity)\n\n `\n ` \n The maximum capacity. \n\n #### Declaration\n\n Swift \n\n var maximumCapacity: Int32 { get }\n\n Objective-C \n\n @property (nonatomic, readonly) int32_t maximumCapacity;\n\n- `\n ``\n ``\n `\n\n ### [attributes](#/c:objc(cs)GMTSVehicle(py)attributes)\n\n `\n ` \n An array contains all the vehicle attributes. \n\n #### Declaration\n\n Swift \n\n var attributes: [../Classes/GMTSVehicleAttributeKeyValuePair.html]? { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly, nullable) NSArray\u003c../Classes/GMTSVehicleAttributeKeyValuePair.html *\u003e *attributes;\n\n- `\n ``\n ``\n `\n\n ### [vehicleType](#/c:objc(cs)GMTSVehicle(py)vehicleType)\n\n `\n ` \n The vehicle type information. \n\n #### Declaration\n\n Swift \n\n @NSCopying var vehicleType: ../Classes/GMTSVehicleType.html { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) ../Classes/GMTSVehicleType.html *_Nonnull vehicleType;\n\n- `\n ``\n ``\n `\n\n ### [-initWithvehicleName:vehicleState:supportedTripTypes:currentTrips:lastLocation:maximumCapacity:attributes:vehicleType:](#/c:objc(cs)GMTSVehicle(im)initWithvehicleName:vehicleState:supportedTripTypes:currentTrips:lastLocation:maximumCapacity:attributes:vehicleType:)\n\n `\n ` \n Initialization of the object. \n\n #### Declaration\n\n Swift \n\n init(vehicleName: String?, vehicleState: ../Enums/GMTSVehicleState.html, supportedTripTypes: ../Enums/GMTSVehicleSupportedTripTypes.html, currentTrips: [String]?, last lastLocation: ../Classes/GMTSVehicleLocation.html?, maximumCapacity: Int32, attributes: [../Classes/GMTSVehicleAttributeKeyValuePair.html]?, vehicleType: ../Classes/GMTSVehicleType.html)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithvehicleName:(nullable NSString *)vehicleName\n vehicleState:(../Enums/GMTSVehicleState.html)vehicleState\n supportedTripTypes:(../Enums/GMTSVehicleSupportedTripTypes.html)supportedTripTypes\n currentTrips:(nullable NSArray\u003cNSString *\u003e *)currentTrips\n lastLocation:(nullable ../Classes/GMTSVehicleLocation.html *)lastLocation\n maximumCapacity:(int32_t)maximumCapacity\n attributes:(nullable NSArray\u003c../Classes/GMTSVehicleAttributeKeyValuePair.html *\u003e *)\n ../Classes/GMTSVehicle.html#/c:objc(cs)GMTSVehicle(py)attributes\n ../Classes/GMTSVehicle.html#/c:objc(cs)GMTSVehicle(py)vehicleType:(nonnull ../Classes/GMTSVehicleType.html *)../Classes/GMTSVehicle.html#/c:objc(cs)GMTSVehicle(py)vehicleType;\n\n #### Parameters\n\n |----------------------------|------------------------------------------------------------------------------------------------|\n | ` `*vehicleName*` ` | The name of the vehicle. |\n | ` `*vehicleState*` ` | The vehicle state, see [GMTSVehicleState](../Enums/GMTSVehicleState.html) for all the options. |\n | ` `*supportedTripTypes*` ` | All the supported trip types. |\n | ` `*currentTrips*` ` | An array contains all the current trip ID. |\n | ` `*lastLocation*` ` | The last location of the vehicle. |\n | ` `*maximumCapacity*` ` | The maximum capacity. |\n | ` `*attributes*` ` | A dictionary contains all the vehicle attributes. |\n | ` `*vehicleType*` ` | The vehicle type information. |\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)GMTSVehicle(im)init)\n\n `\n ` \n Unavailable \n Will return nil.\n Use `-initWithvehicleName:vehicleState:supportedTripTypes:currentTrips:lastLocation:\n maximumCapacity:attributes:vehicleType:` instead. \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)init;"]]