Resource: 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 DeliveryVehicle.journeySharingInfo
field in the REST API refer to the same field.
JSON representation |
---|
{ "name": string, "type": enum ( |
Fields | |
---|---|
name |
Must be in the format |
type |
Required. Immutable. Defines the type of the Task. For example, a break or shipment. |
state |
Required. The current execution state of the Task. |
taskOutcome |
The outcome of the Task. |
taskOutcomeTime |
The timestamp that indicates when the Task's outcome was set by the provider. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
taskOutcomeLocation |
The location where the Task's outcome was set. This value is updated as part of |
taskOutcomeLocationSource |
Indicates where the value of the |
trackingId |
Immutable. This field facilitates the storing of an ID so you can avoid using a complicated mapping. You cannot set
|
deliveryVehicleId |
Output only. The ID of the vehicle that is executing this Task. Delivery Vehicle IDs are subject to the following restrictions:
|
plannedLocation |
Immutable. The location where the Task will be completed. Optional for |
taskDuration |
Required. Immutable. The time needed to execute a Task at this location. A duration in seconds with up to nine fractional digits, ending with ' |
journeySharingInfo |
Output only. Journey sharing-specific fields. Not populated when state is |
Type
The type of Task.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default, the Task type is unknown. |
PICKUP |
A pickup Task is the action taken for picking up a shipment from a customer. Depot or feeder vehicle pickups should use the SCHEDULED_STOP type. |
DELIVERY |
A delivery Task is the action taken for delivering a shipment to an end customer. Depot or feeder vehicle dropoffs should use the SCHEDULED_STOP type. |
SCHEDULED_STOP |
A scheduled stop Task is used for planning purposes. For example, it could represent picking up or dropping off shipments from feeder vehicles or depots. It shouldn't be used for any shipments that are picked up or dropped off from an end customer. |
UNAVAILABLE |
A Task that means the Vehicle is not available for service. For example, this can happen when the driver takes a break, or when the vehicle is being refueled. |
State
The state of a Task. This indicates the Tasks's progress.
Enums | |
---|---|
STATE_UNSPECIFIED |
Default. Used for an unspecified or unrecognized Task state. |
OPEN |
Either the Task has not yet been assigned to a delivery vehicle, or the delivery vehicle has not yet passed the Task's assigned vehicle stop. |
CLOSED |
When the vehicle passes the vehicle stop for this Task. |
TaskOutcome
The outcome of attempting to execute a Task. When TaskState
is closed, TaskOutcome
indicates whether it was completed successfully.
Enums | |
---|---|
TASK_OUTCOME_UNSPECIFIED |
The Task outcome before its value is set. |
SUCCEEDED |
The Task completed successfully. |
FAILED |
Either the Task couldn't be completed, or it was cancelled. |
TaskOutcomeLocationSource
The identity of the source that populated the taskOutcomeLocation
.
Enums | |
---|---|
TASK_OUTCOME_LOCATION_SOURCE_UNSPECIFIED |
The Task outcome before it is set. |
PROVIDER |
The provider-specified the taskOutcomeLocation . |
LAST_VEHICLE_LOCATION |
The provider didn't specify the taskOutcomeLocation , so Fleet Engine used the last known vehicle location. |
JourneySharingInfo
Journey sharing specific fields.
JSON representation |
---|
{ "remainingVehicleJourneySegments": [ { object ( |
Fields | |
---|---|
remainingVehicleJourneySegments[] |
Tracking information for the stops that the assigned vehicle will make before it completes this Task. Note that this list can contain stops from other tasks. The first segment, |
lastLocation |
Indicates the vehicle's last reported location of the assigned vehicle. |
lastLocationSnappable |
Indicates whether the vehicle's lastLocation can be snapped to the |
Methods |
|
---|---|
|
Creates and returns a batch of new Task objects. |
|
Creates and returns a new Task object. |
|
Gets information about a Task . |
|
Gets all Task s that meet the specified filtering criteria. |
|
Updates Task data. |
|
Gets all Task s with a particular tracking_id . |