Struct google_api_proto::google::cloud::tasks::v2beta3::CreateTaskRequest
source · pub struct CreateTaskRequest {
pub parent: String,
pub task: Option<Task>,
pub response_view: i32,
}
Expand description
Request message for [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
Fields§
§parent: String
Required. The queue name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID
The queue must already exist.
task: Option<Task>
Required. The task to add.
Task names have the following format:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID
.
The user can optionally specify a task
[name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified
then the system will generate a random unique task id, which will be set in
the task returned in the [response][google.cloud.tasks.v2beta3.Task.name].
If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not set or is in the past then Cloud Tasks will set it to the current time.
Task De-duplication:
Explicitly specifying a task ID enables task de-duplication. If a task’s ID is identical to that of an existing task or a task that was deleted or executed recently then the call will fail with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. If the task’s queue was created using Cloud Tasks, then another task with the same name can’t be created for ~1 hour after the original task was deleted or executed. If the task’s queue was created using queue.yaml or queue.xml, then another task with the same name can’t be created for ~9 days after the original task was deleted or executed.
Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.
response_view: i32
The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be returned.
By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains.
Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL]
requires cloudtasks.tasks.fullView
Google
IAM permission on the
[Task][google.cloud.tasks.v2beta3.Task] resource.
Implementations§
source§impl CreateTaskRequest
impl CreateTaskRequest
sourcepub fn response_view(&self) -> View
pub fn response_view(&self) -> View
Returns the enum value of response_view
, or the default if the field is set to an invalid enum value.
sourcepub fn set_response_view(&mut self, value: View)
pub fn set_response_view(&mut self, value: View)
Sets response_view
to the provided enum value.
Trait Implementations§
source§impl Clone for CreateTaskRequest
impl Clone for CreateTaskRequest
source§fn clone(&self) -> CreateTaskRequest
fn clone(&self) -> CreateTaskRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CreateTaskRequest
impl Debug for CreateTaskRequest
source§impl Default for CreateTaskRequest
impl Default for CreateTaskRequest
source§impl Message for CreateTaskRequest
impl Message for CreateTaskRequest
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 CreateTaskRequest
impl PartialEq for CreateTaskRequest
source§fn eq(&self, other: &CreateTaskRequest) -> bool
fn eq(&self, other: &CreateTaskRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CreateTaskRequest
Auto Trait Implementations§
impl !Freeze for CreateTaskRequest
impl RefUnwindSafe for CreateTaskRequest
impl Send for CreateTaskRequest
impl Sync for CreateTaskRequest
impl Unpin for CreateTaskRequest
impl UnwindSafe for CreateTaskRequest
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