Struct googapis::google::cloud::tasks::v2beta3::CreateTaskRequest[][src]

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 ~1hour 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 ~9days 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

Returns the enum value of response_view, or the default if the field is set to an invalid enum value.

Sets response_view to the provided enum value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Returns the encoded length of the message without a length delimiter.

Clears the message, resetting all fields to their default.

Encodes the message to a buffer. Read more

Encodes the message to a newly allocated buffer.

Encodes the message with a length-delimiter to a buffer. Read more

Encodes the message with a length-delimiter to a newly allocated buffer.

Decodes an instance of the message from a buffer. Read more

Decodes a length-delimited instance of the message from the buffer.

Decodes an instance of the message from a buffer, and merges it into self. Read more

Decodes a length-delimited instance of the message from buffer, and merges it into self. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Wrap the input message T in a tonic::Request

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more