REST Resource: providers.vehicles

Resource: Vehicle

Vehicle metadata.

JSON representation
{
  "name": string,
  "vehicleState": enum (VehicleState),
  "supportedTripTypes": [
    enum (TripType)
  ],
  "currentTrips": [
    string
  ],
  "lastLocation": {
    object (VehicleLocation)
  },
  "maximumCapacity": integer,
  "attributes": [
    {
      object (VehicleAttribute)
    }
  ],
  "vehicleType": {
    object (VehicleType)
  },
  "licensePlate": {
    object (LicensePlate)
  },
  "route": [
    {
      object (TerminalLocation)
    }
  ],
  "currentRouteSegment": string,
  "currentRouteSegmentTraffic": {
    object (TrafficPolylineData)
  },
  "currentRouteSegmentVersion": string,
  "currentRouteSegmentEndPoint": {
    object (TripWaypoint)
  },
  "remainingDistanceMeters": integer,
  "etaToFirstWaypoint": string,
  "remainingTimeSeconds": integer,
  "waypoints": [
    {
      object (TripWaypoint)
    }
  ],
  "waypointsVersion": string,
  "backToBackEnabled": boolean,
  "navigationStatus": enum (NavigationStatus),
  "deviceSettings": {
    object (DeviceSettings)
  }
}
Fields
name

string

Output only. The unique name for this vehicle. The format is providers/{provider}/vehicles/{vehicle}.

vehicleState

enum (VehicleState)

The vehicle state.

supportedTripTypes[]

enum (TripType)

Trip types supported by this vehicle.

currentTrips[]

string

Output only. List of tripId's for trips currently assigned to this vehicle.

lastLocation

object (VehicleLocation)

Last reported location of the vehicle.

maximumCapacity

integer

The total numbers of riders this vehicle can carry. The driver is not considered in this value. This value must be greater than or equal to one.

attributes[]

object (VehicleAttribute)

List of vehicle attributes. A vehicle can have at most 100 attributes, and each attribute must have a unique key.

vehicleType

object (VehicleType)

Required. The type of this vehicle. Can be used to filter vehicles in vehicles.search results. Also influences ETA and route calculations.

licensePlate

object (LicensePlate)

License plate information for the vehicle.

route[]
(deprecated)

object (TerminalLocation)

Deprecated: Use Vehicle.waypoints instead.

currentRouteSegment

string

The polyline specifying the route the driver app intends to take to the next waypoint. This list is also returned in Trip.current_route_segment for all active trips assigned to the vehicle.

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

currentRouteSegmentTraffic

object (TrafficPolylineData)

Input only. Fleet Engine uses this information to improve journey sharing. Note: This field is intended only for use by the Driver SDK.

currentRouteSegmentVersion

string (Timestamp format)

Output only. Time when currentRouteSegment was set. It can be stored by the client and passed in future vehicles.get requests to prevent returning routes that haven't 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".

currentRouteSegmentEndPoint

object (TripWaypoint)

The waypoint where currentRouteSegment ends. This can be supplied by drivers on vehicles.update calls either as a full trip waypoint, a waypoint LatLng, or as the last LatLng of the currentRouteSegment. Fleet Engine will then do its best to interpolate to an actual waypoint if it is not fully specified. This field is ignored in vehicles.update calls unless currentRouteSegment is also specified.

remainingDistanceMeters

integer

The remaining driving distance for the currentRouteSegment. This value is also returned in Trip.remaining_distance_meters for all active trips assigned to the vehicle. The value is unspecified if the currentRouteSegment field is empty.

etaToFirstWaypoint

string (Timestamp format)

The ETA to the first entry in the waypoints field. The value is unspecified if the waypoints field is empty or the Vehicle.current_route_segment field is empty.

When updating a vehicle, remainingTimeSeconds takes precedence over etaToFirstWaypoint in the same request.

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".

remainingTimeSeconds

integer

Input only. The remaining driving time for the currentRouteSegment. The value is unspecified if the waypoints field is empty or the Vehicle.current_route_segment field is empty. This value should match etaToFirstWaypoint - current_time if all parties are using the same clock.

When updating a vehicle, remainingTimeSeconds takes precedence over etaToFirstWaypoint in the same request.

waypoints[]

object (TripWaypoint)

The remaining waypoints assigned to this Vehicle.

waypointsVersion

string (Timestamp format)

Output only. Last time the waypoints field was updated. Clients should cache this value and pass it in GetVehicleRequest to ensure the waypoints field is only returned if it is 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".

backToBackEnabled

boolean

Indicates if the driver accepts back-to-back trips. If true, vehicles.search may include the vehicle even if it is currently assigned to a trip. The default value is false.

navigationStatus

enum (NavigationStatus)

The vehicle's navigation status.

deviceSettings

object (DeviceSettings)

Input only. Information about settings in the mobile device being used by the driver.

VehicleState

The state of a Vehicle.

Enums
UNKNOWN_VEHICLE_STATE Default, used for unspecified or unrecognized vehicle states.
OFFLINE The vehicle is not accepting new trips. Note: the vehicle may continue to operate in this state while completing a trip assigned to it.
ONLINE The vehicle is accepting new trips.

VehicleAttribute

Describes a vehicle attribute as a key-value pair. The "key:value" string length cannot exceed 256 characters.

JSON representation
{
  "key": string,
  "value": string,

  // Union field vehicle_attribute_value can be only one of the following:
  "stringValue": string,
  "boolValue": boolean,
  "numberValue": number
  // End of list of possible types for union field vehicle_attribute_value.
}
Fields
key

string

The attribute's key. Keys may not contain the colon character (:).

value

string

The attribute's value.

Union field vehicle_attribute_value. The attribute's value, can be in string, bool, or double type. vehicle_attribute_value can be only one of the following:
stringValue

string

String typed attribute value.

Note: This is identical to the value field which will eventually be deprecated. For create or update methods, either field can be used, but it's strongly recommended to use stringValue. If both stringValue and value are set, they must be identical or an error will be thrown. Both fields are populated in responses.

boolValue

boolean

Boolean typed attribute value.

numberValue

number

Double typed attribute value.

VehicleType

The type of vehicle.

JSON representation
{
  "category": enum (Category)
}
Fields
category

enum (Category)

Vehicle type category

Category

Vehicle type categories

Enums
UNKNOWN Default, used for unspecified or unrecognized vehicle categories.
AUTO An automobile.
TAXI Any vehicle that acts as a taxi (typically licensed or regulated).
TRUCK Generally, a vehicle with a large storage capacity.
TWO_WHEELER A motorcycle, moped, or other two-wheeled vehicle
BICYCLE Human-powered transport.
PEDESTRIAN A human transporter, typically walking or running, traveling along pedestrian pathways.

LicensePlate

The license plate information of the Vehicle. To avoid storing personally-identifiable information, only the minimum information about the license plate is stored as part of the entity.

JSON representation
{
  "countryCode": string,
  "lastCharacter": string
}
Fields
countryCode

string

Required. CLDR Country/Region Code. For example, US for United States, or IN for India.

lastCharacter

string

The last digit of the license plate or "-1" to denote no numeric value is present in the license plate.

  • "ABC 1234" -> "4"
  • "AB 123 CD" -> "3"
  • "ABCDEF" -> "-1"

TrafficPolylineData

Traffic conditions along the expected vehicle route.

JSON representation
{
  "trafficRendering": {
    object (VisualTrafficReportPolylineRendering)
  }
}
Fields
trafficRendering

object (VisualTrafficReportPolylineRendering)

A polyline rendering of how fast traffic is for all regions along one stretch of a customer ride.

VisualTrafficReportPolylineRendering

Describes how clients should color one portion of the polyline along the route.

JSON representation
{
  "roadStretch": [
    {
      object (RoadStretch)
    }
  ]
}
Fields
roadStretch[]

object (RoadStretch)

Optional. Road stretches that should be rendered along the polyline. Stretches are guaranteed to not overlap, and do not necessarily span the full route.

In the absence of a road stretch to style, the client should apply the default for the route.

RoadStretch

One road stretch that should be rendered.

JSON representation
{
  "style": enum (Style),
  "offsetMeters": integer,
  "lengthMeters": integer
}
Fields
style

enum (Style)

Required. The style to apply.

offsetMeters

integer

Required. The style should be applied between [offsetMeters, offsetMeters + lengthMeters).

lengthMeters

integer

Required. The length of the path where to apply the style.

Style

The traffic style, indicating traffic speed.

Enums
STYLE_UNSPECIFIED No style selected.
SLOWER_TRAFFIC Traffic is slowing down.
TRAFFIC_JAM There is a traffic jam.

DeviceSettings

Information about various settings on the mobile device.

JSON representation
{
  "locationPowerSaveMode": enum (LocationPowerSaveMode),
  "isPowerSaveMode": boolean,
  "isInteractive": boolean,
  "batteryInfo": {
    object (BatteryInfo)
  }
}
Fields
locationPowerSaveMode

enum (LocationPowerSaveMode)

How location features are set to behave on the device when battery saver is on.

isPowerSaveMode

boolean

Whether the device is currently in power save mode.

isInteractive

boolean

Whether the device is in an interactive state.

batteryInfo

object (BatteryInfo)

Information about the battery state.

LocationPowerSaveMode

How location features are configured to behave on the mobile device when the devices "battery saver" feature is on. (https://developer.android.com/reference/android/os/PowerManager#getLocationPowerSaveMode())

Enums
UNKNOWN_LOCATION_POWER_SAVE_MODE Undefined LocationPowerSaveMode
LOCATION_MODE_NO_CHANGE Either the location providers shouldn't be affected by battery saver, or battery saver is off.
LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF The GPS based location provider should be disabled when battery saver is on and the device is non-interactive.
LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF All location providers should be disabled when battery saver is on and the device is non-interactive.
LOCATION_MODE_FOREGROUND_ONLY All the location providers will be kept available, but location fixes should only be provided to foreground apps.
LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF Location will not be turned off, but LocationManager will throttle all requests to providers when the device is non-interactive.

BatteryInfo

Information about the device's battery.

JSON representation
{
  "batteryStatus": enum (BatteryStatus),
  "powerSource": enum (PowerSource),
  "batteryPercentage": number
}
Fields
batteryStatus

enum (BatteryStatus)

Status of the battery, whether full or charging etc.

powerSource

enum (PowerSource)

Status of battery power source.

batteryPercentage

number

Current battery percentage [0-100].

BatteryStatus

Status of the battery, whether full or charging etc.

Enums
UNKNOWN_BATTERY_STATUS Battery status unknown.
BATTERY_STATUS_CHARGING Battery is being charged.
BATTERY_STATUS_DISCHARGING Battery is discharging.
BATTERY_STATUS_FULL Battery is full.
BATTERY_STATUS_NOT_CHARGING Battery is not charging.
BATTERY_STATUS_POWER_LOW Battery is low on power.

PowerSource

Type of the charger being used to charge the battery.

Enums
UNKNOWN_POWER_SOURCE Power source unknown.
POWER_SOURCE_AC Power source is an AC charger.
POWER_SOURCE_USB Power source is a USB port.
POWER_SOURCE_WIRELESS Power source is wireless.
POWER_SOURCE_UNPLUGGED Battery is unplugged.

Methods

create

Instantiates a new vehicle associated with an on-demand rideshare or deliveries provider.

get

Returns a vehicle from the Fleet Engine.

list

Returns a paginated list of vehicles associated with a provider that match the request options.
Returns a list of vehicles that match the request options.

update

Writes updated vehicle data to the Fleet Engine.

updateAttributes

Partially updates a vehicle's attributes.