Struct google_api_proto::maps::fleetengine::delivery::v1::Task
source · pub struct Task {Show 15 fields
pub name: String,
pub type: i32,
pub state: i32,
pub task_outcome: i32,
pub task_outcome_time: Option<Timestamp>,
pub task_outcome_location: Option<LocationInfo>,
pub task_outcome_location_source: i32,
pub tracking_id: String,
pub delivery_vehicle_id: String,
pub planned_location: Option<LocationInfo>,
pub task_duration: Option<Duration>,
pub target_time_window: Option<TimeWindow>,
pub journey_sharing_info: Option<JourneySharingInfo>,
pub task_tracking_view_config: Option<TaskTrackingViewConfig>,
pub attributes: Vec<TaskAttribute>,
}
Expand description
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.
Fields§
§name: String
Must be in the format providers/{provider}/tasks/{task}
.
type: i32
Required. Immutable. Defines the type of the Task. For example, a break or shipment.
state: i32
Required. The current execution state of the Task.
task_outcome: i32
The outcome of the Task.
task_outcome_time: Option<Timestamp>
The timestamp that indicates when the Task
’s outcome was set by the
provider.
task_outcome_location: Option<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: i32
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] (http://www.unicode.org/reports/tr15/).
- 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] (http://www.unicode.org/reports/tr15/).
- May not contain any of the following ASCII characters: ‘/’, ‘:’, ‘?’, ‘,’, or ‘#’.
planned_location: Option<LocationInfo>
Immutable. The location where the Task will be completed.
Optional for UNAVAILABLE
Tasks, but required for all other Tasks.
task_duration: Option<Duration>
Required. Immutable. The time needed to execute a Task at this location.
target_time_window: Option<TimeWindow>
The time window during which the task should be completed.
journey_sharing_info: Option<JourneySharingInfo>
Output only. Journey sharing-specific fields. Not populated when state is
CLOSED
.
task_tracking_view_config: Option<TaskTrackingViewConfig>
The configuration for task tracking that specifies which data elements are visible to the end users under what circumstances.
attributes: Vec<TaskAttribute>
A list of custom Task attributes. Each attribute must have a unique key.
Implementations§
source§impl Task
impl Task
sourcepub fn type(&self) -> Type
pub fn type(&self) -> Type
Returns the enum value of type
, or the default if the field is set to an invalid enum value.
sourcepub fn state(&self) -> State
pub fn state(&self) -> State
Returns the enum value of state
, or the default if the field is set to an invalid enum value.
sourcepub fn task_outcome(&self) -> TaskOutcome
pub fn task_outcome(&self) -> TaskOutcome
Returns the enum value of task_outcome
, or the default if the field is set to an invalid enum value.
sourcepub fn set_task_outcome(&mut self, value: TaskOutcome)
pub fn set_task_outcome(&mut self, value: TaskOutcome)
Sets task_outcome
to the provided enum value.
sourcepub fn task_outcome_location_source(&self) -> TaskOutcomeLocationSource
pub fn task_outcome_location_source(&self) -> TaskOutcomeLocationSource
Returns the enum value of task_outcome_location_source
, or the default if the field is set to an invalid enum value.
sourcepub fn set_task_outcome_location_source(
&mut self,
value: TaskOutcomeLocationSource,
)
pub fn set_task_outcome_location_source( &mut self, value: TaskOutcomeLocationSource, )
Sets task_outcome_location_source
to the provided enum value.
Trait Implementations§
source§impl Message for Task
impl Message for Task
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Task
impl PartialEq for Task
impl StructuralPartialEq for Task
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request