Reference documentation and code samples for the Google Maps FleetEngine Delivery V1 Client class Task.
A Task in the Delivery API represents a single action to track. In general, there is a distinction between shipment-related Tasks and break Tasks. A shipment can have multiple Tasks associated with it. For example, there could be one Task for the pickup, and one for the drop-off or transfer. Also, different Tasks for a given shipment can be handled by different vehicles.
For example, one vehicle could handle the pickup, driving the shipment to the
hub, while another vehicle drives the same shipment from the hub to the
drop-off location.
Note: gRPC and REST APIs use different field naming conventions. For example,
the Task.journey_sharing_info
field in the gRPC API and the Task.journeySharingInfo
field in the REST API refer to the same
field.
Generated from protobuf message maps.fleetengine.delivery.v1.Task
Namespace
Google \ Maps \ FleetEngine \ Delivery \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
Must be in the format providers/{provider}/tasks/{task}
.
↳ type
int
Required. Immutable. Defines the type of the Task. For example, a break or shipment.
↳ state
int
Required. The current execution state of the Task.
↳ task_outcome
int
The outcome of the Task.
↳ task_outcome_time
Google\Protobuf\Timestamp
The timestamp that indicates when the Task
's outcome was set by the provider.
↳ task_outcome_location
LocationInfo
The location where the Task
's outcome was set. This value is updated as part of UpdateTask
. If this value isn't explicitly updated by the provider, then Fleet Engine populates it by default with the last known vehicle location (the raw
location).
↳ task_outcome_location_source
int
Indicates where the value of the task_outcome_location
came from.
↳ tracking_id
string
Immutable. This field facilitates the storing of an ID so you can avoid using a complicated mapping. You cannot set tracking_id
for Tasks of type UNAVAILABLE
and SCHEDULED_STOP
. These IDs are subject to the following restrictions: * * Must be a valid Unicode string. * * Limited to a maximum length of 64 characters. * * Normalized according to Unicode Normalization Form C
. * * May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
↳ delivery_vehicle_id
string
Output only. The ID of the vehicle that is executing this Task. Delivery Vehicle IDs are subject to the following restrictions: * * Must be a valid Unicode string. * * Limited to a maximum length of 64 characters. * * Normalized according to Unicode Normalization Form C . * * May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
↳ planned_location
LocationInfo
Immutable. The location where the Task will be completed. Optional for UNAVAILABLE
Tasks, but required for all other Tasks.
↳ task_duration
↳ target_time_window
↳ journey_sharing_info
Task\JourneySharingInfo
Output only. Journey sharing-specific fields. Not populated when state is CLOSED
.
↳ task_tracking_view_config
TaskTrackingViewConfig
The configuration for task tracking that specifies which data elements are visible to the end users under what circumstances.
↳ attributes
getName
Must be in the format providers/{provider}/tasks/{task}
.
string
setName
Must be in the format providers/{provider}/tasks/{task}
.
var
string
$this
getType
Required. Immutable. Defines the type of the Task. For example, a break or shipment.
int
setType
Required. Immutable. Defines the type of the Task. For example, a break or shipment.
var
int
$this
getState
Required. The current execution state of the Task.
int
setState
Required. The current execution state of the Task.
var
int
$this
getTaskOutcome
The outcome of the Task.
int
setTaskOutcome
The outcome of the Task.
var
int
$this
getTaskOutcomeTime
The timestamp that indicates when the Task
's outcome was set by the
provider.
hasTaskOutcomeTime
clearTaskOutcomeTime
setTaskOutcomeTime
The timestamp that indicates when the Task
's outcome was set by the
provider.
$this
getTaskOutcomeLocation
The location where the Task
's outcome was set. This value is updated as
part of UpdateTask
. If this value isn't explicitly updated by the
provider, then Fleet Engine populates it by default with the last known
vehicle location (the raw
location).
hasTaskOutcomeLocation
clearTaskOutcomeLocation
setTaskOutcomeLocation
The location where the Task
's outcome was set. This value is updated as
part of UpdateTask
. If this value isn't explicitly updated by the
provider, then Fleet Engine populates it by default with the last known
vehicle location (the raw
location).
$this
getTaskOutcomeLocationSource
Indicates where the value of the task_outcome_location
came from.
int
setTaskOutcomeLocationSource
Indicates where the value of the task_outcome_location
came from.
var
int
$this
getTrackingId
Immutable. This field facilitates the storing of an ID so you can avoid
using a complicated mapping. You cannot set tracking_id
for Tasks of type UNAVAILABLE
and SCHEDULED_STOP
. These IDs are subject to the
following restrictions:
-
Must be a valid Unicode string.
-
Limited to a maximum length of 64 characters.
- Normalized according to Unicode Normalization Form C .
- May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
string
setTrackingId
Immutable. This field facilitates the storing of an ID so you can avoid
using a complicated mapping. You cannot set tracking_id
for Tasks of type UNAVAILABLE
and SCHEDULED_STOP
. These IDs are subject to the
following restrictions:
-
Must be a valid Unicode string.
-
Limited to a maximum length of 64 characters.
- Normalized according to Unicode Normalization Form C .
- May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
var
string
$this
getDeliveryVehicleId
Output only. The ID of the vehicle that is executing this Task. Delivery Vehicle IDs are subject to the following restrictions:
-
Must be a valid Unicode string.
-
Limited to a maximum length of 64 characters.
- Normalized according to Unicode Normalization Form C .
- May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
string
setDeliveryVehicleId
Output only. The ID of the vehicle that is executing this Task. Delivery Vehicle IDs are subject to the following restrictions:
-
Must be a valid Unicode string.
-
Limited to a maximum length of 64 characters.
- Normalized according to Unicode Normalization Form C .
- May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'.
var
string
$this
getPlannedLocation
Immutable. The location where the Task will be completed.
Optional for UNAVAILABLE
Tasks, but required for all other Tasks.
hasPlannedLocation
clearPlannedLocation
setPlannedLocation
Immutable. The location where the Task will be completed.
Optional for UNAVAILABLE
Tasks, but required for all other Tasks.
$this
getTaskDuration
Required. Immutable. The time needed to execute a Task at this location.
hasTaskDuration
clearTaskDuration
setTaskDuration
Required. Immutable. The time needed to execute a Task at this location.
$this
getTargetTimeWindow
The time window during which the task should be completed.
hasTargetTimeWindow
clearTargetTimeWindow
setTargetTimeWindow
The time window during which the task should be completed.
$this
getJourneySharingInfo
Output only. Journey sharing-specific fields. Not populated when state is CLOSED
.
hasJourneySharingInfo
clearJourneySharingInfo
setJourneySharingInfo
Output only. Journey sharing-specific fields. Not populated when state is CLOSED
.
$this
getTaskTrackingViewConfig
The configuration for task tracking that specifies which data elements are visible to the end users under what circumstances.
hasTaskTrackingViewConfig
clearTaskTrackingViewConfig
setTaskTrackingViewConfig
The configuration for task tracking that specifies which data elements are visible to the end users under what circumstances.
$this
getAttributes
A list of custom Task attributes. Each attribute must have a unique key.
setAttributes
A list of custom Task attributes. Each attribute must have a unique key.
$this