Google Maps FleetEngine Delivery V1 Client - Class DeliveryVehicle (0.1.2)

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

The DeliveryVehicle message. A delivery vehicle transports shipments from a depot to a delivery location, and from a pickup location to the depot. In some cases, delivery vehicles also transport shipments directly from the pickup location to the delivery location.

Note: gRPC and REST APIs use different field naming conventions. For example, the DeliveryVehicle.current_route_segment field in the gRPC API and the DeliveryVehicle.currentRouteSegment field in the REST API refer to the same field.

Generated from protobuf message maps.fleetengine.delivery.v1.DeliveryVehicle

Namespace

Google \ Maps \ FleetEngine \ Delivery \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

The unique name of this Delivery Vehicle. The format is providers/{provider}/deliveryVehicles/{vehicle}.

↳ last_location Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation

The last reported location of the Delivery Vehicle.

↳ navigation_status int

The Delivery Vehicle's navigation status.

↳ current_route_segment string

The encoded polyline specifying the route that the navigation recommends taking to the next waypoint. Your driver app updates this when a stop is reached or passed, and when the navigation reroutes. These LatLngs are returned in Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST) for all active Tasks assigned to the Vehicle. There are a few cases where this field might not be used to populate Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST): * The endpoint of the current_route_segment does not match DeliveryVehicle.remaining_vehicle_journey_segments[0].stop (gRPC) or DeliveryVehicle.remainingVehicleJourneySegments[0].stop (REST). * The driver app has not updated its location recently, so the last updated value for this field might be stale. * The driver app has recently updated its location, but the current_route_segment is stale, and points to a previous vehicle stop. In these cases, Fleet Engine populates this field with a route from the most recently passed VehicleStop to the upcoming VehicleStop to ensure that the consumer of this field has the best available information on the current path of the Delivery Vehicle.

↳ current_route_segment_end_point Google\Type\LatLng

The location where the current_route_segment ends. This is not currently populated by the driver app, but you can supply it on UpdateDeliveryVehicle calls. It is either the LatLng from the upcoming vehicle stop, or the last LatLng of the current_route_segment. Fleet Engine will then do its best to interpolate to an actual VehicleStop. This field is ignored in UpdateDeliveryVehicle calls if the current_route_segment field is empty.

↳ remaining_distance_meters Google\Protobuf\Int32Value

The remaining driving distance for the current_route_segment. The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_distance_meters (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDistanceMeters (REST) for all active Tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

↳ remaining_duration Google\Protobuf\Duration

The remaining driving time for the current_route_segment. The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_duration (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDuration (REST) for all active tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

↳ remaining_vehicle_journey_segments array<Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>

The journey segments assigned to this Delivery Vehicle, starting from the Vehicle's most recently reported location. This field won't be populated in the response of ListDeliveryVehicles.

↳ attributes array<Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleAttribute>

A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have at most 100 attributes, and each attribute must have a unique key.

↳ type int

The type of this delivery vehicle. If unset, this will default to AUTO.

getName

The unique name of this Delivery Vehicle.

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

Returns
Type Description
string

setName

The unique name of this Delivery Vehicle.

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

Parameter
Name Description
var string
Returns
Type Description
$this

getLastLocation

The last reported location of the Delivery Vehicle.

Returns
Type Description
Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation|null

hasLastLocation

clearLastLocation

setLastLocation

The last reported location of the Delivery Vehicle.

Parameter
Name Description
var Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleLocation
Returns
Type Description
$this

getNavigationStatus

The Delivery Vehicle's navigation status.

Returns
Type Description
int

setNavigationStatus

The Delivery Vehicle's navigation status.

Parameter
Name Description
var int
Returns
Type Description
$this

getCurrentRouteSegment

The encoded polyline specifying the route that the navigation recommends taking to the next waypoint. Your driver app updates this when a stop is reached or passed, and when the navigation reroutes. These LatLngs are returned in Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST) for all active Tasks assigned to the Vehicle.

There are a few cases where this field might not be used to populate Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST):

  • The endpoint of the current_route_segment does not match DeliveryVehicle.remaining_vehicle_journey_segments[0].stop (gRPC) or DeliveryVehicle.remainingVehicleJourneySegments[0].stop (REST).
  • The driver app has not updated its location recently, so the last updated value for this field might be stale.
  • The driver app has recently updated its location, but the current_route_segment is stale, and points to a previous vehicle stop. In these cases, Fleet Engine populates this field with a route from the most recently passed VehicleStop to the upcoming VehicleStop to ensure that the consumer of this field has the best available information on the current path of the Delivery Vehicle.
Returns
Type Description
string

setCurrentRouteSegment

The encoded polyline specifying the route that the navigation recommends taking to the next waypoint. Your driver app updates this when a stop is reached or passed, and when the navigation reroutes. These LatLngs are returned in Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST) for all active Tasks assigned to the Vehicle.

There are a few cases where this field might not be used to populate Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST):

  • The endpoint of the current_route_segment does not match DeliveryVehicle.remaining_vehicle_journey_segments[0].stop (gRPC) or DeliveryVehicle.remainingVehicleJourneySegments[0].stop (REST).
  • The driver app has not updated its location recently, so the last updated value for this field might be stale.
  • The driver app has recently updated its location, but the current_route_segment is stale, and points to a previous vehicle stop. In these cases, Fleet Engine populates this field with a route from the most recently passed VehicleStop to the upcoming VehicleStop to ensure that the consumer of this field has the best available information on the current path of the Delivery Vehicle.
Parameter
Name Description
var string
Returns
Type Description
$this

getCurrentRouteSegmentEndPoint

The location where the current_route_segment ends. This is not currently populated by the driver app, but you can supply it on UpdateDeliveryVehicle calls. It is either the LatLng from the upcoming vehicle stop, or the last LatLng of the current_route_segment. Fleet Engine will then do its best to interpolate to an actual VehicleStop.

This field is ignored in UpdateDeliveryVehicle calls if the current_route_segment field is empty.

Returns
Type Description
Google\Type\LatLng|null

hasCurrentRouteSegmentEndPoint

clearCurrentRouteSegmentEndPoint

setCurrentRouteSegmentEndPoint

The location where the current_route_segment ends. This is not currently populated by the driver app, but you can supply it on UpdateDeliveryVehicle calls. It is either the LatLng from the upcoming vehicle stop, or the last LatLng of the current_route_segment. Fleet Engine will then do its best to interpolate to an actual VehicleStop.

This field is ignored in UpdateDeliveryVehicle calls if the current_route_segment field is empty.

Parameter
Name Description
var Google\Type\LatLng
Returns
Type Description
$this

getRemainingDistanceMeters

The remaining driving distance for the current_route_segment.

The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_distance_meters (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDistanceMeters (REST) for all active Tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest 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. The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_distance_meters (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDistanceMeters (REST) for all active Tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

Returns
Type Description
int|null

setRemainingDistanceMeters

The remaining driving distance for the current_route_segment.

The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_distance_meters (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDistanceMeters (REST) for all active Tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest 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. The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_distance_meters (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDistanceMeters (REST) for all active Tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

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

getRemainingDuration

The remaining driving time for the current_route_segment.

The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_duration (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDuration (REST) for all active tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

Returns
Type Description
Google\Protobuf\Duration|null

hasRemainingDuration

clearRemainingDuration

setRemainingDuration

The remaining driving time for the current_route_segment.

The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_duration (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDuration (REST) for all active tasks assigned to the Delivery Vehicle. Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

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

getRemainingVehicleJourneySegments

The journey segments assigned to this Delivery Vehicle, starting from the Vehicle's most recently reported location. This field won't be populated in the response of ListDeliveryVehicles.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setRemainingVehicleJourneySegments

The journey segments assigned to this Delivery Vehicle, starting from the Vehicle's most recently reported location. This field won't be populated in the response of ListDeliveryVehicles.

Parameter
Name Description
var array<Google\Maps\FleetEngine\Delivery\V1\VehicleJourneySegment>
Returns
Type Description
$this

getAttributes

A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have at most 100 attributes, and each attribute must have a unique key.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setAttributes

A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have at most 100 attributes, and each attribute must have a unique key.

Parameter
Name Description
var array<Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicleAttribute>
Returns
Type Description
$this

getType

The type of this delivery vehicle. If unset, this will default to AUTO.

Returns
Type Description
int

setType

The type of this delivery vehicle. If unset, this will default to AUTO.

Parameter
Name Description
var int
Returns
Type Description
$this