Google Maps FleetEngine V1 Client - Class Vehicle (0.1.5)

Reference documentation and code samples for the Google Maps FleetEngine V1 Client class Vehicle.

Vehicle metadata.

Generated from protobuf message maps.fleetengine.v1.Vehicle

Namespace

Google \ Maps \ FleetEngine \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

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

↳ vehicle_state int

The vehicle state.

↳ supported_trip_types array

Trip types supported by this vehicle.

↳ current_trips array

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

↳ last_location VehicleLocation

Last reported location of the vehicle.

↳ maximum_capacity int

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 array<VehicleAttribute>

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

↳ vehicle_type Vehicle\VehicleType

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

↳ license_plate LicensePlate

License plate information for the vehicle.

↳ route array<TerminalLocation>

Deprecated: Use Vehicle.waypoints instead.

↳ current_route_segment 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.

↳ current_route_segment_traffic TrafficPolylineData

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

↳ current_route_segment_version Google\Protobuf\Timestamp

Output only. Time when current_route_segment was set. It can be stored by the client and passed in future GetVehicle requests to prevent returning routes that haven't changed.

↳ current_route_segment_end_point TripWaypoint

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

↳ remaining_distance_meters Google\Protobuf\Int32Value

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

↳ eta_to_first_waypoint Google\Protobuf\Timestamp

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, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

↳ remaining_time_seconds Google\Protobuf\Int32Value

Input only. The remaining driving time for the current_route_segment. The value is unspecified if the waypoints field is empty or the Vehicle.current_route_segment field is empty. This value should match eta_to_first_waypoint - current_time if all parties are using the same clock. When updating a vehicle, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

↳ waypoints array<TripWaypoint>

The remaining waypoints assigned to this Vehicle.

↳ waypoints_version Google\Protobuf\Timestamp

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.

↳ back_to_back_enabled bool

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

↳ navigation_status int

The vehicle's navigation status.

↳ device_settings DeviceSettings

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

getName

Output only. The unique name for this vehicle.

The format is providers/{provider}/vehicles/{vehicle}.

Returns
Type Description
string

setName

Output only. The unique name for this vehicle.

The format is providers/{provider}/vehicles/{vehicle}.

Parameter
Name Description
var string
Returns
Type Description
$this

getVehicleState

The vehicle state.

Returns
Type Description
int

setVehicleState

The vehicle state.

Parameter
Name Description
var int
Returns
Type Description
$this

getSupportedTripTypes

Trip types supported by this vehicle.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setSupportedTripTypes

Trip types supported by this vehicle.

Parameter
Name Description
var int[]
Returns
Type Description
$this

getCurrentTrips

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

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setCurrentTrips

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

Parameter
Name Description
var string[]
Returns
Type Description
$this

getLastLocation

Last reported location of the vehicle.

Returns
Type Description
VehicleLocation|null

hasLastLocation

clearLastLocation

setLastLocation

Last reported location of the vehicle.

Parameter
Name Description
var VehicleLocation
Returns
Type Description
$this

getMaximumCapacity

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.

Returns
Type Description
int

setMaximumCapacity

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.

Parameter
Name Description
var int
Returns
Type Description
$this

getAttributes

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

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setAttributes

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

Parameter
Name Description
var array<VehicleAttribute>
Returns
Type Description
$this

getVehicleType

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

Returns
Type Description
Vehicle\VehicleType|null

hasVehicleType

clearVehicleType

setVehicleType

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

Parameter
Name Description
var Vehicle\VehicleType
Returns
Type Description
$this

getLicensePlate

License plate information for the vehicle.

Returns
Type Description
LicensePlate|null

hasLicensePlate

clearLicensePlate

setLicensePlate

License plate information for the vehicle.

Parameter
Name Description
var LicensePlate
Returns
Type Description
$this

getRoute

Deprecated: Use Vehicle.waypoints instead.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setRoute

Deprecated: Use Vehicle.waypoints instead.

Parameter
Name Description
var array<TerminalLocation>
Returns
Type Description
$this

getCurrentRouteSegment

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.

Returns
Type Description
string

setCurrentRouteSegment

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.

Parameter
Name Description
var string
Returns
Type Description
$this

getCurrentRouteSegmentTraffic

Input only. Fleet Engine uses this information to improve journey sharing.

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

Returns
Type Description
TrafficPolylineData|null

hasCurrentRouteSegmentTraffic

clearCurrentRouteSegmentTraffic

setCurrentRouteSegmentTraffic

Input only. Fleet Engine uses this information to improve journey sharing.

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

Parameter
Name Description
var TrafficPolylineData
Returns
Type Description
$this

getCurrentRouteSegmentVersion

Output only. Time when current_route_segment was set. It can be stored by the client and passed in future GetVehicle requests to prevent returning routes that haven't changed.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasCurrentRouteSegmentVersion

clearCurrentRouteSegmentVersion

setCurrentRouteSegmentVersion

Output only. Time when current_route_segment was set. It can be stored by the client and passed in future GetVehicle requests to prevent returning routes that haven't changed.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getCurrentRouteSegmentEndPoint

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

Returns
Type Description
TripWaypoint|null

hasCurrentRouteSegmentEndPoint

clearCurrentRouteSegmentEndPoint

setCurrentRouteSegmentEndPoint

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

Parameter
Name Description
var TripWaypoint
Returns
Type Description
$this

getRemainingDistanceMeters

The remaining driving distance for the current_route_segment.

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

Returns
Type Description
Google\Protobuf\Int32Value|null

hasRemainingDistanceMeters

clearRemainingDistanceMeters

getRemainingDistanceMetersUnwrapped

Returns the unboxed value from getRemainingDistanceMeters()

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

Returns
Type Description
int|null

setRemainingDistanceMeters

The remaining driving distance for the current_route_segment.

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

Parameter
Name Description
var Google\Protobuf\Int32Value
Returns
Type Description
$this

setRemainingDistanceMetersUnwrapped

Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

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

Parameter
Name Description
var int|null
Returns
Type Description
$this

getEtaToFirstWaypoint

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, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasEtaToFirstWaypoint

clearEtaToFirstWaypoint

setEtaToFirstWaypoint

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, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getRemainingTimeSeconds

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

When updating a vehicle, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

Returns
Type Description
Google\Protobuf\Int32Value|null

hasRemainingTimeSeconds

clearRemainingTimeSeconds

getRemainingTimeSecondsUnwrapped

Returns the unboxed value from getRemainingTimeSeconds()

Input only. The remaining driving time for the current_route_segment. The value is unspecified if the waypoints field is empty or the Vehicle.current_route_segment field is empty. This value should match eta_to_first_waypoint - current_time if all parties are using the same clock. When updating a vehicle, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

Returns
Type Description
int|null

setRemainingTimeSeconds

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

When updating a vehicle, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

Parameter
Name Description
var Google\Protobuf\Int32Value
Returns
Type Description
$this

setRemainingTimeSecondsUnwrapped

Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

Input only. The remaining driving time for the current_route_segment. The value is unspecified if the waypoints field is empty or the Vehicle.current_route_segment field is empty. This value should match eta_to_first_waypoint - current_time if all parties are using the same clock. When updating a vehicle, remaining_time_seconds takes precedence over eta_to_first_waypoint in the same request.

Parameter
Name Description
var int|null
Returns
Type Description
$this

getWaypoints

The remaining waypoints assigned to this Vehicle.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWaypoints

The remaining waypoints assigned to this Vehicle.

Parameter
Name Description
var array<TripWaypoint>
Returns
Type Description
$this

getWaypointsVersion

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.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasWaypointsVersion

clearWaypointsVersion

setWaypointsVersion

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.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getBackToBackEnabled

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

Returns
Type Description
bool

setBackToBackEnabled

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

Parameter
Name Description
var bool
Returns
Type Description
$this

getNavigationStatus

The vehicle's navigation status.

Returns
Type Description
int

setNavigationStatus

The vehicle's navigation status.

Parameter
Name Description
var int
Returns
Type Description
$this

getDeviceSettings

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

Returns
Type Description
DeviceSettings|null

hasDeviceSettings

clearDeviceSettings

setDeviceSettings

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

Parameter
Name Description
var DeviceSettings
Returns
Type Description
$this