Service Client: Google::Cloud::Tasks::V2::Cloudtasks::CloudTasksClient

Client stub representing the remote CloudTasks gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to tasks.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Cloud::Tasks::V2::Cloudtasks - Compiled Protocol Buffers messages for google/cloud/tasks/v2/cloudtasks.proto

SYNOPSIS

use Google::Cloud::Tasks::V2::Cloudtasks;

my $msg = Google::Cloud::Tasks::V2::Cloudtasks::ListQueuesRequest->new({
    parent => $parent,
    filter => $filter,
    page_size => $page_size,
    page_token => $page_token,
});

# Read or update a field
my $val = $msg->parent();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Tasks::V2::Cloudtasks::ListQueuesRequest->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/tasks/v2/cloudtasks.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Tasks::V2::Cloudtasks::ListQueuesRequest

Request message for [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`

  • $msg->filter() / $msg->filter($value)

    Type: String

    `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2.Queue] field can be used as a filter and several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as described in [Stackdriver's Advanced Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters).

    Sample filter "state: PAUSED".

    Note that using filters might cause fewer queues than the requested page_size to be returned.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    Requested page size.

    The maximum page size is 9800. If unspecified, the page size will be the maximum. Fewer queues than requested might be returned, even if more queues exist; use the [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] in the response to determine if more queues exist.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    A token identifying the page of results to return.

    To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] returned from the previous call to [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] method. It is an error to switch the value of the [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating through pages.

Google::Cloud::Tasks::V2::Cloudtasks::ListQueuesResponse

Response message for [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues].

Inherits from Protobuf::Message.

Accessors

  • $msg->queues() / $msg->queues($value)

    Type: Message (Google::Cloud::Tasks::V2::Queue::Queue)

    The list of queues.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token to retrieve next page of results.

    To return the next page of results, call [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value as the [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token].

    If the next_page_token is empty, there are no more results.

    The page token is valid for only 2 hours.

Google::Cloud::Tasks::V2::Cloudtasks::GetQueueRequest

Request message for [GetQueue][google.cloud.tasks.v2.CloudTasks.GetQueue].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`

Google::Cloud::Tasks::V2::Cloudtasks::CreateQueueRequest

Request message for [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID`

    The list of allowed locations can be obtained by calling Cloud Tasks' implementation of [ListLocations][google.cloud.location.Locations.ListLocations].

  • $msg->queue() / $msg->queue($value)

    Type: Message (Google::Cloud::Tasks::V2::Queue::Queue)

    Required. The queue to create.

    [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.

Google::Cloud::Tasks::V2::Cloudtasks::UpdateQueueRequest

Request message for [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue].

Inherits from Protobuf::Message.

Accessors

  • $msg->queue() / $msg->queue($value)

    Type: Message (Google::Cloud::Tasks::V2::Queue::Queue)

    Required. The queue to create or update.

    The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified.

    Output only fields cannot be modified using UpdateQueue. Any value specified for an output only field will be ignored. The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed.

  • $msg->update_mask() / $msg->update_mask($value)

    Type: Message (Google::Protobuf::FieldMask::FieldMask)

    A mask used to specify which fields of the queue are being updated.

    If empty, then all fields will be updated.

Google::Cloud::Tasks::V2::Cloudtasks::DeleteQueueRequest

Request message for [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`

Google::Cloud::Tasks::V2::Cloudtasks::PurgeQueueRequest

Request message for [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`

Google::Cloud::Tasks::V2::Cloudtasks::PauseQueueRequest

Request message for [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`

Google::Cloud::Tasks::V2::Cloudtasks::ResumeQueueRequest

Request message for [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`

Google::Cloud::Tasks::V2::Cloudtasks::ListTasksRequest

Request message for listing tasks using [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`

  • $msg->response_view() / $msg->response_view($value)

    Type: Enum (Google::Cloud::Tasks::V2::Task::View)

    The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be returned.

    By default response_view is [BASIC][google.cloud.tasks.v2.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.v2.Task.View.FULL] requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the [Task][google.cloud.tasks.v2.Task] resource.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    Maximum page size.

    Fewer tasks than requested might be returned, even if more tasks exist; use [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] in the response to determine if more tasks exist.

    The maximum page size is 1000. If unspecified, the page size will be the maximum.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    A token identifying the page of results to return.

    To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] returned from the previous call to [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] method.

    The page token is valid for only 2 hours.

Google::Cloud::Tasks::V2::Cloudtasks::ListTasksResponse

Response message for listing tasks using [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks].

Inherits from Protobuf::Message.

Accessors

  • $msg->tasks() / $msg->tasks($value)

    Type: Message (Google::Cloud::Tasks::V2::Task::Task)

    The list of tasks.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token to retrieve next page of results.

    To return the next page of results, call [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as the [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token].

    If the next_page_token is empty, there are no more results.

Google::Cloud::Tasks::V2::Cloudtasks::GetTaskRequest

Request message for getting a task using [GetTask][google.cloud.tasks.v2.CloudTasks.GetTask].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`

  • $msg->response_view() / $msg->response_view($value)

    Type: Enum (Google::Cloud::Tasks::V2::Task::View)

    The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be returned.

    By default response_view is [BASIC][google.cloud.tasks.v2.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.v2.Task.View.FULL] requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the [Task][google.cloud.tasks.v2.Task] resource.

Google::Cloud::Tasks::V2::Cloudtasks::CreateTaskRequest

Request message for [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`

    The queue must already exist.

  • $msg->task() / $msg->task($value)

    Type: Message (Google::Cloud::Tasks::V2::Task::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.v2.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.v2.Task.name].

    If [schedule_time][google.cloud.tasks.v2.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]. The IDs of deleted tasks are not immediately available for reuse. It can take up to 24 hours (or 9 days if the task's queue was created using a queue.yaml or queue.xml) for the task ID to be released and made available again.

    Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2.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.

  • $msg->response_view() / $msg->response_view($value)

    Type: Enum (Google::Cloud::Tasks::V2::Task::View)

    The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be returned.

    By default response_view is [BASIC][google.cloud.tasks.v2.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.v2.Task.View.FULL] requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the [Task][google.cloud.tasks.v2.Task] resource.

Google::Cloud::Tasks::V2::Cloudtasks::BatchCreateTasksRequest

Request message for [BatchCreateTasks].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`

    The queue must already exist.

  • $msg->requests() / $msg->requests($value)

    Type: Message (Google::Cloud::Tasks::V2::Cloudtasks::CreateTaskRequest)

    Required. The list of requests to create tasks. The queue specified in parent field of each CreateTaskRequest will be the same. This validation happens on the client side as well as in the handler. BatchCreateTasksRequest.parent will also be the same value as the individual CreateTaskRequest.parent. The maximum number of requests is 100.

  • $msg->request_id() / $msg->request_id($value)

    Type: String

    Optional. This field will be used to identify the long running operation, avoiding duplication when user retries. If not provided, then a UUID will be generated at server side.

Google::Cloud::Tasks::V2::Cloudtasks::DeleteTaskRequest

Request message for deleting a task using [DeleteTask][google.cloud.tasks.v2.CloudTasks.DeleteTask].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`

Google::Cloud::Tasks::V2::Cloudtasks::BatchDeleteTasksRequest

Request message for deleting a batch of tasks using [BatchDeleteTasks][google.cloud.tasks.v2.CloudTasks.BatchDeleteTasks].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The queue name. For example: Format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`

  • $msg->names() / $msg->names($value)

    Type: String

    Required. The names of the tasks to delete. A maximum of 1000 tasks can be deleted in a batch. For example: Format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`

  • $msg->request_id() / $msg->request_id($value)

    Type: String

    Optional. This field will be used to identify the long running operation, avoiding duplication when user retries. If not provided, then a UUID will be generated at server side.

Google::Cloud::Tasks::V2::Cloudtasks::BatchDeleteTasksMetadata

Metadata for the long-running operation returned by [BatchDeleteTasks][google.cloud.tasks.v2.CloudTasks.BatchDeleteTasks]. This message is used to hold metadata information about the batch delete tasks operation; that is, it is put in [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata].

Inherits from Protobuf::Message.

Accessors

Enum: BatchDeleteTasksMetadata::State

  • STATE_UNSPECIFIED => 0

  • RUNNING => 1

  • SUCCEEDED => 2

  • PARTIALLY_SUCCEEDED => 3

  • FAILED => 4

Google::Cloud::Tasks::V2::Cloudtasks::RunTaskRequest

Request message for forcing a task to run now using [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`

  • $msg->response_view() / $msg->response_view($value)

    Type: Enum (Google::Cloud::Tasks::V2::Task::View)

    The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be returned.

    By default response_view is [BASIC][google.cloud.tasks.v2.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.v2.Task.View.FULL] requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the [Task][google.cloud.tasks.v2.Task] resource.

Google::Cloud::Tasks::V2::Cloudtasks::UpdateCmekConfigRequest

Request message for [UpdateCmekConfig][google.cloud.tasks.v2.CloudTasks.UpdateCmekConfig].

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Tasks::V2::Cloudtasks::GetCmekConfigRequest

Request message for [GetCmekConfig][google.cloud.tasks.v2.CloudTasks.GetCmekConfig].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The config. For example: `projects/PROJECT_ID/locations/LOCATION_ID/CmekConfig`

Google::Cloud::Tasks::V2::Cloudtasks::BatchCreateTasksResponse

Response message for [BatchCreateTasks].

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Tasks::V2::Cloudtasks::BatchCreateTasksMetadata

Metadata message for [BatchCreateTasks].

Inherits from Protobuf::Message.

Accessors

Enum: BatchCreateTasksMetadata::State

  • STATE_UNSPECIFIED => 0

  • RUNNING => 1

  • SUCCEEDED => 2

  • PARTIALLY_SUCCEEDED => 5

  • FAILED => 3

  • CANCELLED => 4

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Tasks::V2::Cloudtasks::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.