Google Cloud Tasks v2beta3 API - Class CloudTasksClient (3.0.0-beta06)

public abstract class CloudTasksClient

Reference documentation and code samples for the Google Cloud Tasks v2beta3 API class CloudTasksClient.

CloudTasks client wrapper, for convenient use.

Inheritance

object > CloudTasksClient

Derived Types

Namespace

Google.Cloud.Tasks.V2Beta3

Assembly

Google.Cloud.Tasks.V2Beta3.dll

Remarks

Cloud Tasks allows developers to manage the execution of background work in their applications.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the CloudTasks service, which is a host of "cloudtasks.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudTasks scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default CloudTasks scopes are:

GrpcClient

public virtual CloudTasks.CloudTasksClient GrpcClient { get; }

The underlying gRPC CloudTasks client

Property Value
TypeDescription
CloudTasksCloudTasksClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static CloudTasksClient Create()

Synchronously creates a CloudTasksClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudTasksClientBuilder.

Returns
TypeDescription
CloudTasksClient

The created CloudTasksClient.

CreateAsync(CancellationToken)

public static Task<CloudTasksClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a CloudTasksClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudTasksClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskCloudTasksClient

The task representing the created CloudTasksClient.

CreateQueue(LocationName, Queue, CallSettings)

public virtual Queue CreateQueue(LocationName parent, Queue queue, CallSettings callSettings = null)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
parentLocationName

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].

queueQueue

Required. The queue to create.

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gctv::Queue queue = new gctv::Queue();
// Make the request
gctv::Queue response = cloudTasksClient.CreateQueue(parent, queue);

CreateQueue(CreateQueueRequest, CallSettings)

public virtual Queue CreateQueue(CreateQueueRequest request, CallSettings callSettings = null)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestCreateQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::CreateQueueRequest request = new gctv::CreateQueueRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Queue = new gctv::Queue(),
};
// Make the request
gctv::Queue response = cloudTasksClient.CreateQueue(request);

CreateQueue(string, Queue, CallSettings)

public virtual Queue CreateQueue(string parent, Queue queue, CallSettings callSettings = null)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
parentstring

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].

queueQueue

Required. The queue to create.

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gctv::Queue queue = new gctv::Queue();
// Make the request
gctv::Queue response = cloudTasksClient.CreateQueue(parent, queue);

CreateQueueAsync(LocationName, Queue, CallSettings)

public virtual Task<Queue> CreateQueueAsync(LocationName parent, Queue queue, CallSettings callSettings = null)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
parentLocationName

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].

queueQueue

Required. The queue to create.

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gctv::Queue queue = new gctv::Queue();
// Make the request
gctv::Queue response = await cloudTasksClient.CreateQueueAsync(parent, queue);

CreateQueueAsync(LocationName, Queue, CancellationToken)

public virtual Task<Queue> CreateQueueAsync(LocationName parent, Queue queue, CancellationToken cancellationToken)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
parentLocationName

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].

queueQueue

Required. The queue to create.

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gctv::Queue queue = new gctv::Queue();
// Make the request
gctv::Queue response = await cloudTasksClient.CreateQueueAsync(parent, queue);

CreateQueueAsync(CreateQueueRequest, CallSettings)

public virtual Task<Queue> CreateQueueAsync(CreateQueueRequest request, CallSettings callSettings = null)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestCreateQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::CreateQueueRequest request = new gctv::CreateQueueRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Queue = new gctv::Queue(),
};
// Make the request
gctv::Queue response = await cloudTasksClient.CreateQueueAsync(request);

CreateQueueAsync(CreateQueueRequest, CancellationToken)

public virtual Task<Queue> CreateQueueAsync(CreateQueueRequest request, CancellationToken cancellationToken)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestCreateQueueRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::CreateQueueRequest request = new gctv::CreateQueueRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Queue = new gctv::Queue(),
};
// Make the request
gctv::Queue response = await cloudTasksClient.CreateQueueAsync(request);

CreateQueueAsync(string, Queue, CallSettings)

public virtual Task<Queue> CreateQueueAsync(string parent, Queue queue, CallSettings callSettings = null)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
parentstring

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].

queueQueue

Required. The queue to create.

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gctv::Queue queue = new gctv::Queue();
// Make the request
gctv::Queue response = await cloudTasksClient.CreateQueueAsync(parent, queue);

CreateQueueAsync(string, Queue, CancellationToken)

public virtual Task<Queue> CreateQueueAsync(string parent, Queue queue, CancellationToken cancellationToken)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
parentstring

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].

queueQueue

Required. The queue to create.

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gctv::Queue queue = new gctv::Queue();
// Make the request
gctv::Queue response = await cloudTasksClient.CreateQueueAsync(parent, queue);

CreateTask(CreateTaskRequest, CallSettings)

public virtual Task CreateTask(CreateTaskRequest request, CallSettings callSettings = null)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
requestCreateTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::CreateTaskRequest request = new gctv::CreateTaskRequest
{
    ParentAsQueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    Task = new gctv::Task(),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = cloudTasksClient.CreateTask(request);

CreateTask(QueueName, Task, CallSettings)

public virtual Task CreateTask(QueueName parent, Task task, CallSettings callSettings = null)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
parentQueueName

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

The queue must already exist.

taskTask

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::QueueName parent = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
gctv::Task task = new gctv::Task();
// Make the request
gctv::Task response = cloudTasksClient.CreateTask(parent, task);

CreateTask(string, Task, CallSettings)

public virtual Task CreateTask(string parent, Task task, CallSettings callSettings = null)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
parentstring

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

The queue must already exist.

taskTask

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
gctv::Task task = new gctv::Task();
// Make the request
gctv::Task response = cloudTasksClient.CreateTask(parent, task);

CreateTaskAsync(CreateTaskRequest, CallSettings)

public virtual Task<Task> CreateTaskAsync(CreateTaskRequest request, CallSettings callSettings = null)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
requestCreateTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::CreateTaskRequest request = new gctv::CreateTaskRequest
{
    ParentAsQueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    Task = new gctv::Task(),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = await cloudTasksClient.CreateTaskAsync(request);

CreateTaskAsync(CreateTaskRequest, CancellationToken)

public virtual Task<Task> CreateTaskAsync(CreateTaskRequest request, CancellationToken cancellationToken)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
requestCreateTaskRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::CreateTaskRequest request = new gctv::CreateTaskRequest
{
    ParentAsQueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    Task = new gctv::Task(),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = await cloudTasksClient.CreateTaskAsync(request);

CreateTaskAsync(QueueName, Task, CallSettings)

public virtual Task<Task> CreateTaskAsync(QueueName parent, Task task, CallSettings callSettings = null)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
parentQueueName

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

The queue must already exist.

taskTask

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName parent = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
gctv::Task task = new gctv::Task();
// Make the request
gctv::Task response = await cloudTasksClient.CreateTaskAsync(parent, task);

CreateTaskAsync(QueueName, Task, CancellationToken)

public virtual Task<Task> CreateTaskAsync(QueueName parent, Task task, CancellationToken cancellationToken)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
parentQueueName

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

The queue must already exist.

taskTask

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName parent = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
gctv::Task task = new gctv::Task();
// Make the request
gctv::Task response = await cloudTasksClient.CreateTaskAsync(parent, task);

CreateTaskAsync(string, Task, CallSettings)

public virtual Task<Task> CreateTaskAsync(string parent, Task task, CallSettings callSettings = null)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
parentstring

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

The queue must already exist.

taskTask

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
gctv::Task task = new gctv::Task();
// Make the request
gctv::Task response = await cloudTasksClient.CreateTaskAsync(parent, task);

CreateTaskAsync(string, Task, CancellationToken)

public virtual Task<Task> CreateTaskAsync(string parent, Task task, CancellationToken cancellationToken)

Creates a task and adds it to a queue.

Tasks cannot be updated after creation; there is no UpdateTask command.

  • The maximum task size is 100KB.
Parameters
NameDescription
parentstring

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

The queue must already exist.

taskTask

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
gctv::Task task = new gctv::Task();
// Make the request
gctv::Task response = await cloudTasksClient.CreateTaskAsync(parent, task);

DeleteQueue(DeleteQueueRequest, CallSettings)

public virtual void DeleteQueue(DeleteQueueRequest request, CallSettings callSettings = null)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestDeleteQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::DeleteQueueRequest request = new gctv::DeleteQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
cloudTasksClient.DeleteQueue(request);

DeleteQueue(QueueName, CallSettings)

public virtual void DeleteQueue(QueueName name, CallSettings callSettings = null)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
cloudTasksClient.DeleteQueue(name);

DeleteQueue(string, CallSettings)

public virtual void DeleteQueue(string name, CallSettings callSettings = null)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
cloudTasksClient.DeleteQueue(name);

DeleteQueueAsync(DeleteQueueRequest, CallSettings)

public virtual Task DeleteQueueAsync(DeleteQueueRequest request, CallSettings callSettings = null)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestDeleteQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::DeleteQueueRequest request = new gctv::DeleteQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
await cloudTasksClient.DeleteQueueAsync(request);

DeleteQueueAsync(DeleteQueueRequest, CancellationToken)

public virtual Task DeleteQueueAsync(DeleteQueueRequest request, CancellationToken cancellationToken)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestDeleteQueueRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::DeleteQueueRequest request = new gctv::DeleteQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
await cloudTasksClient.DeleteQueueAsync(request);

DeleteQueueAsync(QueueName, CallSettings)

public virtual Task DeleteQueueAsync(QueueName name, CallSettings callSettings = null)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
await cloudTasksClient.DeleteQueueAsync(name);

DeleteQueueAsync(QueueName, CancellationToken)

public virtual Task DeleteQueueAsync(QueueName name, CancellationToken cancellationToken)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
nameQueueName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
await cloudTasksClient.DeleteQueueAsync(name);

DeleteQueueAsync(string, CallSettings)

public virtual Task DeleteQueueAsync(string name, CallSettings callSettings = null)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
await cloudTasksClient.DeleteQueueAsync(name);

DeleteQueueAsync(string, CancellationToken)

public virtual Task DeleteQueueAsync(string name, CancellationToken cancellationToken)

Deletes a queue.

This command will delete the queue even if it has tasks in it.

Note: If you delete a queue, a queue with the same name can't be created for 7 days.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
await cloudTasksClient.DeleteQueueAsync(name);

DeleteTask(DeleteTaskRequest, CallSettings)

public virtual void DeleteTask(DeleteTaskRequest request, CallSettings callSettings = null)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
requestDeleteTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::DeleteTaskRequest request = new gctv::DeleteTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
};
// Make the request
cloudTasksClient.DeleteTask(request);

DeleteTask(TaskName, CallSettings)

public virtual void DeleteTask(TaskName name, CallSettings callSettings = null)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
nameTaskName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
cloudTasksClient.DeleteTask(name);

DeleteTask(string, CallSettings)

public virtual void DeleteTask(string name, CallSettings callSettings = null)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
cloudTasksClient.DeleteTask(name);

DeleteTaskAsync(DeleteTaskRequest, CallSettings)

public virtual Task DeleteTaskAsync(DeleteTaskRequest request, CallSettings callSettings = null)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
requestDeleteTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::DeleteTaskRequest request = new gctv::DeleteTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
};
// Make the request
await cloudTasksClient.DeleteTaskAsync(request);

DeleteTaskAsync(DeleteTaskRequest, CancellationToken)

public virtual Task DeleteTaskAsync(DeleteTaskRequest request, CancellationToken cancellationToken)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
requestDeleteTaskRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::DeleteTaskRequest request = new gctv::DeleteTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
};
// Make the request
await cloudTasksClient.DeleteTaskAsync(request);

DeleteTaskAsync(TaskName, CallSettings)

public virtual Task DeleteTaskAsync(TaskName name, CallSettings callSettings = null)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
nameTaskName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
await cloudTasksClient.DeleteTaskAsync(name);

DeleteTaskAsync(TaskName, CancellationToken)

public virtual Task DeleteTaskAsync(TaskName name, CancellationToken cancellationToken)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
nameTaskName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
await cloudTasksClient.DeleteTaskAsync(name);

DeleteTaskAsync(string, CallSettings)

public virtual Task DeleteTaskAsync(string name, CallSettings callSettings = null)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
await cloudTasksClient.DeleteTaskAsync(name);

DeleteTaskAsync(string, CancellationToken)

public virtual Task DeleteTaskAsync(string name, CancellationToken cancellationToken)

Deletes a task.

A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
await cloudTasksClient.DeleteTaskAsync(name);

GetIamPolicy(IResourceName, CallSettings)

public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = cloudTasksClient.GetIamPolicy(resource);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = cloudTasksClient.GetIamPolicy(request);

GetIamPolicy(string, CallSettings)

public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = cloudTasksClient.GetIamPolicy(resource);

GetIamPolicyAsync(IResourceName, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await cloudTasksClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(IResourceName, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await cloudTasksClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await cloudTasksClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await cloudTasksClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(string, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await cloudTasksClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(string, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)

Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.getIamPolicy
Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await cloudTasksClient.GetIamPolicyAsync(resource);

GetQueue(GetQueueRequest, CallSettings)

public virtual Queue GetQueue(GetQueueRequest request, CallSettings callSettings = null)

Gets a queue.

Parameters
NameDescription
requestGetQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::GetQueueRequest request = new gctv::GetQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ReadMask = new FieldMask(),
};
// Make the request
gctv::Queue response = cloudTasksClient.GetQueue(request);

GetQueue(QueueName, CallSettings)

public virtual Queue GetQueue(QueueName name, CallSettings callSettings = null)

Gets a queue.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = cloudTasksClient.GetQueue(name);

GetQueue(string, CallSettings)

public virtual Queue GetQueue(string name, CallSettings callSettings = null)

Gets a queue.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = cloudTasksClient.GetQueue(name);

GetQueueAsync(GetQueueRequest, CallSettings)

public virtual Task<Queue> GetQueueAsync(GetQueueRequest request, CallSettings callSettings = null)

Gets a queue.

Parameters
NameDescription
requestGetQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::GetQueueRequest request = new gctv::GetQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ReadMask = new FieldMask(),
};
// Make the request
gctv::Queue response = await cloudTasksClient.GetQueueAsync(request);

GetQueueAsync(GetQueueRequest, CancellationToken)

public virtual Task<Queue> GetQueueAsync(GetQueueRequest request, CancellationToken cancellationToken)

Gets a queue.

Parameters
NameDescription
requestGetQueueRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::GetQueueRequest request = new gctv::GetQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ReadMask = new FieldMask(),
};
// Make the request
gctv::Queue response = await cloudTasksClient.GetQueueAsync(request);

GetQueueAsync(QueueName, CallSettings)

public virtual Task<Queue> GetQueueAsync(QueueName name, CallSettings callSettings = null)

Gets a queue.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.GetQueueAsync(name);

GetQueueAsync(QueueName, CancellationToken)

public virtual Task<Queue> GetQueueAsync(QueueName name, CancellationToken cancellationToken)

Gets a queue.

Parameters
NameDescription
nameQueueName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.GetQueueAsync(name);

GetQueueAsync(string, CallSettings)

public virtual Task<Queue> GetQueueAsync(string name, CallSettings callSettings = null)

Gets a queue.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.GetQueueAsync(name);

GetQueueAsync(string, CancellationToken)

public virtual Task<Queue> GetQueueAsync(string name, CancellationToken cancellationToken)

Gets a queue.

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.GetQueueAsync(name);

GetTask(GetTaskRequest, CallSettings)

public virtual Task GetTask(GetTaskRequest request, CallSettings callSettings = null)

Gets a task.

Parameters
NameDescription
requestGetTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::GetTaskRequest request = new gctv::GetTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = cloudTasksClient.GetTask(request);

GetTask(TaskName, CallSettings)

public virtual Task GetTask(TaskName name, CallSettings callSettings = null)

Gets a task.

Parameters
NameDescription
nameTaskName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
gctv::Task response = cloudTasksClient.GetTask(name);

GetTask(string, CallSettings)

public virtual Task GetTask(string name, CallSettings callSettings = null)

Gets a task.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
gctv::Task response = cloudTasksClient.GetTask(name);

GetTaskAsync(GetTaskRequest, CallSettings)

public virtual Task<Task> GetTaskAsync(GetTaskRequest request, CallSettings callSettings = null)

Gets a task.

Parameters
NameDescription
requestGetTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::GetTaskRequest request = new gctv::GetTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = await cloudTasksClient.GetTaskAsync(request);

GetTaskAsync(GetTaskRequest, CancellationToken)

public virtual Task<Task> GetTaskAsync(GetTaskRequest request, CancellationToken cancellationToken)

Gets a task.

Parameters
NameDescription
requestGetTaskRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::GetTaskRequest request = new gctv::GetTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = await cloudTasksClient.GetTaskAsync(request);

GetTaskAsync(TaskName, CallSettings)

public virtual Task<Task> GetTaskAsync(TaskName name, CallSettings callSettings = null)

Gets a task.

Parameters
NameDescription
nameTaskName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
gctv::Task response = await cloudTasksClient.GetTaskAsync(name);

GetTaskAsync(TaskName, CancellationToken)

public virtual Task<Task> GetTaskAsync(TaskName name, CancellationToken cancellationToken)

Gets a task.

Parameters
NameDescription
nameTaskName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
gctv::Task response = await cloudTasksClient.GetTaskAsync(name);

GetTaskAsync(string, CallSettings)

public virtual Task<Task> GetTaskAsync(string name, CallSettings callSettings = null)

Gets a task.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
gctv::Task response = await cloudTasksClient.GetTaskAsync(name);

GetTaskAsync(string, CancellationToken)

public virtual Task<Task> GetTaskAsync(string name, CancellationToken cancellationToken)

Gets a task.

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
gctv::Task response = await cloudTasksClient.GetTaskAsync(name);

ListQueues(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListQueuesResponse, Queue> ListQueues(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists queues.

Queues are returned in lexicographical order.

Parameters
NameDescription
parentLocationName

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListQueuesResponseQueue

A pageable sequence of Queue resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<gctv::ListQueuesResponse, gctv::Queue> response = cloudTasksClient.ListQueues(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (gctv::Queue item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gctv::ListQueuesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Queue item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Queue> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Queue item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListQueues(ListQueuesRequest, CallSettings)

public virtual PagedEnumerable<ListQueuesResponse, Queue> ListQueues(ListQueuesRequest request, CallSettings callSettings = null)

Lists queues.

Queues are returned in lexicographical order.

Parameters
NameDescription
requestListQueuesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListQueuesResponseQueue

A pageable sequence of Queue resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::ListQueuesRequest request = new gctv::ListQueuesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    ReadMask = new FieldMask(),
};
// Make the request
PagedEnumerable<gctv::ListQueuesResponse, gctv::Queue> response = cloudTasksClient.ListQueues(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (gctv::Queue item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gctv::ListQueuesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Queue item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Queue> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Queue item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListQueues(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListQueuesResponse, Queue> ListQueues(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists queues.

Queues are returned in lexicographical order.

Parameters
NameDescription
parentstring

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListQueuesResponseQueue

A pageable sequence of Queue resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<gctv::ListQueuesResponse, gctv::Queue> response = cloudTasksClient.ListQueues(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (gctv::Queue item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gctv::ListQueuesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Queue item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Queue> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Queue item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListQueuesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListQueuesResponse, Queue> ListQueuesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists queues.

Queues are returned in lexicographical order.

Parameters
NameDescription
parentLocationName

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListQueuesResponseQueue

A pageable asynchronous sequence of Queue resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<gctv::ListQueuesResponse, gctv::Queue> response = cloudTasksClient.ListQueuesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gctv::Queue item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((gctv::ListQueuesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Queue item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Queue> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Queue item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListQueuesAsync(ListQueuesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListQueuesResponse, Queue> ListQueuesAsync(ListQueuesRequest request, CallSettings callSettings = null)

Lists queues.

Queues are returned in lexicographical order.

Parameters
NameDescription
requestListQueuesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListQueuesResponseQueue

A pageable asynchronous sequence of Queue resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::ListQueuesRequest request = new gctv::ListQueuesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    ReadMask = new FieldMask(),
};
// Make the request
PagedAsyncEnumerable<gctv::ListQueuesResponse, gctv::Queue> response = cloudTasksClient.ListQueuesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gctv::Queue item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((gctv::ListQueuesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Queue item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Queue> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Queue item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListQueuesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListQueuesResponse, Queue> ListQueuesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists queues.

Queues are returned in lexicographical order.

Parameters
NameDescription
parentstring

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListQueuesResponseQueue

A pageable asynchronous sequence of Queue resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<gctv::ListQueuesResponse, gctv::Queue> response = cloudTasksClient.ListQueuesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gctv::Queue item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((gctv::ListQueuesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Queue item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Queue> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Queue item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTasks(ListTasksRequest, CallSettings)

public virtual PagedEnumerable<ListTasksResponse, Task> ListTasks(ListTasksRequest request, CallSettings callSettings = null)

Lists the tasks in a queue.

By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the subset of information which is returned.

The tasks may be returned in any order. The ordering may change at any time.

Parameters
NameDescription
requestListTasksRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTasksResponseTask

A pageable sequence of Task resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::ListTasksRequest request = new gctv::ListTasksRequest
{
    ParentAsQueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
PagedEnumerable<gctv::ListTasksResponse, gctv::Task> response = cloudTasksClient.ListTasks(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (gctv::Task item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gctv::ListTasksResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Task item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Task> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Task item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTasks(QueueName, string, int?, CallSettings)

public virtual PagedEnumerable<ListTasksResponse, Task> ListTasks(QueueName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the tasks in a queue.

By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the subset of information which is returned.

The tasks may be returned in any order. The ordering may change at any time.

Parameters
NameDescription
parentQueueName

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTasksResponseTask

A pageable sequence of Task resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::QueueName parent = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
PagedEnumerable<gctv::ListTasksResponse, gctv::Task> response = cloudTasksClient.ListTasks(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (gctv::Task item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gctv::ListTasksResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Task item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Task> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Task item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTasks(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListTasksResponse, Task> ListTasks(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the tasks in a queue.

By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the subset of information which is returned.

The tasks may be returned in any order. The ordering may change at any time.

Parameters
NameDescription
parentstring

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTasksResponseTask

A pageable sequence of Task resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
PagedEnumerable<gctv::ListTasksResponse, gctv::Task> response = cloudTasksClient.ListTasks(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (gctv::Task item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gctv::ListTasksResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Task item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Task> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Task item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTasksAsync(ListTasksRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListTasksResponse, Task> ListTasksAsync(ListTasksRequest request, CallSettings callSettings = null)

Lists the tasks in a queue.

By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the subset of information which is returned.

The tasks may be returned in any order. The ordering may change at any time.

Parameters
NameDescription
requestListTasksRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListTasksResponseTask

A pageable asynchronous sequence of Task resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::ListTasksRequest request = new gctv::ListTasksRequest
{
    ParentAsQueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
PagedAsyncEnumerable<gctv::ListTasksResponse, gctv::Task> response = cloudTasksClient.ListTasksAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gctv::Task item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((gctv::ListTasksResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Task item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Task> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Task item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTasksAsync(QueueName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListTasksResponse, Task> ListTasksAsync(QueueName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the tasks in a queue.

By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the subset of information which is returned.

The tasks may be returned in any order. The ordering may change at any time.

Parameters
NameDescription
parentQueueName

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListTasksResponseTask

A pageable asynchronous sequence of Task resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName parent = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
PagedAsyncEnumerable<gctv::ListTasksResponse, gctv::Task> response = cloudTasksClient.ListTasksAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gctv::Task item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((gctv::ListTasksResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Task item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Task> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Task item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTasksAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListTasksResponse, Task> ListTasksAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the tasks in a queue.

By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the subset of information which is returned.

The tasks may be returned in any order. The ordering may change at any time.

Parameters
NameDescription
parentstring

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

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListTasksResponseTask

A pageable asynchronous sequence of Task resources.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
PagedAsyncEnumerable<gctv::ListTasksResponse, gctv::Task> response = cloudTasksClient.ListTasksAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gctv::Task item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((gctv::ListTasksResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gctv::Task item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gctv::Task> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gctv::Task item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PauseQueue(PauseQueueRequest, CallSettings)

public virtual Queue PauseQueue(PauseQueueRequest request, CallSettings callSettings = null)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
requestPauseQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::PauseQueueRequest request = new gctv::PauseQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = cloudTasksClient.PauseQueue(request);

PauseQueue(QueueName, CallSettings)

public virtual Queue PauseQueue(QueueName name, CallSettings callSettings = null)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = cloudTasksClient.PauseQueue(name);

PauseQueue(string, CallSettings)

public virtual Queue PauseQueue(string name, CallSettings callSettings = null)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = cloudTasksClient.PauseQueue(name);

PauseQueueAsync(PauseQueueRequest, CallSettings)

public virtual Task<Queue> PauseQueueAsync(PauseQueueRequest request, CallSettings callSettings = null)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
requestPauseQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::PauseQueueRequest request = new gctv::PauseQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = await cloudTasksClient.PauseQueueAsync(request);

PauseQueueAsync(PauseQueueRequest, CancellationToken)

public virtual Task<Queue> PauseQueueAsync(PauseQueueRequest request, CancellationToken cancellationToken)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
requestPauseQueueRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::PauseQueueRequest request = new gctv::PauseQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = await cloudTasksClient.PauseQueueAsync(request);

PauseQueueAsync(QueueName, CallSettings)

public virtual Task<Queue> PauseQueueAsync(QueueName name, CallSettings callSettings = null)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.PauseQueueAsync(name);

PauseQueueAsync(QueueName, CancellationToken)

public virtual Task<Queue> PauseQueueAsync(QueueName name, CancellationToken cancellationToken)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
nameQueueName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.PauseQueueAsync(name);

PauseQueueAsync(string, CallSettings)

public virtual Task<Queue> PauseQueueAsync(string name, CallSettings callSettings = null)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.PauseQueueAsync(name);

PauseQueueAsync(string, CancellationToken)

public virtual Task<Queue> PauseQueueAsync(string name, CancellationToken cancellationToken)

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.PauseQueueAsync(name);

PurgeQueue(PurgeQueueRequest, CallSettings)

public virtual Queue PurgeQueue(PurgeQueueRequest request, CallSettings callSettings = null)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
requestPurgeQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::PurgeQueueRequest request = new gctv::PurgeQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = cloudTasksClient.PurgeQueue(request);

PurgeQueue(QueueName, CallSettings)

public virtual Queue PurgeQueue(QueueName name, CallSettings callSettings = null)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = cloudTasksClient.PurgeQueue(name);

PurgeQueue(string, CallSettings)

public virtual Queue PurgeQueue(string name, CallSettings callSettings = null)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = cloudTasksClient.PurgeQueue(name);

PurgeQueueAsync(PurgeQueueRequest, CallSettings)

public virtual Task<Queue> PurgeQueueAsync(PurgeQueueRequest request, CallSettings callSettings = null)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
requestPurgeQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::PurgeQueueRequest request = new gctv::PurgeQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = await cloudTasksClient.PurgeQueueAsync(request);

PurgeQueueAsync(PurgeQueueRequest, CancellationToken)

public virtual Task<Queue> PurgeQueueAsync(PurgeQueueRequest request, CancellationToken cancellationToken)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
requestPurgeQueueRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::PurgeQueueRequest request = new gctv::PurgeQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = await cloudTasksClient.PurgeQueueAsync(request);

PurgeQueueAsync(QueueName, CallSettings)

public virtual Task<Queue> PurgeQueueAsync(QueueName name, CallSettings callSettings = null)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.PurgeQueueAsync(name);

PurgeQueueAsync(QueueName, CancellationToken)

public virtual Task<Queue> PurgeQueueAsync(QueueName name, CancellationToken cancellationToken)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
nameQueueName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.PurgeQueueAsync(name);

PurgeQueueAsync(string, CallSettings)

public virtual Task<Queue> PurgeQueueAsync(string name, CallSettings callSettings = null)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.PurgeQueueAsync(name);

PurgeQueueAsync(string, CancellationToken)

public virtual Task<Queue> PurgeQueueAsync(string name, CancellationToken cancellationToken)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.PurgeQueueAsync(name);

ResumeQueue(QueueName, CallSettings)

public virtual Queue ResumeQueue(QueueName name, CallSettings callSettings = null)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = cloudTasksClient.ResumeQueue(name);

ResumeQueue(ResumeQueueRequest, CallSettings)

public virtual Queue ResumeQueue(ResumeQueueRequest request, CallSettings callSettings = null)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
requestResumeQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::ResumeQueueRequest request = new gctv::ResumeQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = cloudTasksClient.ResumeQueue(request);

ResumeQueue(string, CallSettings)

public virtual Queue ResumeQueue(string name, CallSettings callSettings = null)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = cloudTasksClient.ResumeQueue(name);

ResumeQueueAsync(QueueName, CallSettings)

public virtual Task<Queue> ResumeQueueAsync(QueueName name, CallSettings callSettings = null)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
nameQueueName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.ResumeQueueAsync(name);

ResumeQueueAsync(QueueName, CancellationToken)

public virtual Task<Queue> ResumeQueueAsync(QueueName name, CancellationToken cancellationToken)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
nameQueueName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::QueueName name = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
gctv::Queue response = await cloudTasksClient.ResumeQueueAsync(name);

ResumeQueueAsync(ResumeQueueRequest, CallSettings)

public virtual Task<Queue> ResumeQueueAsync(ResumeQueueRequest request, CallSettings callSettings = null)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
requestResumeQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::ResumeQueueRequest request = new gctv::ResumeQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = await cloudTasksClient.ResumeQueueAsync(request);

ResumeQueueAsync(ResumeQueueRequest, CancellationToken)

public virtual Task<Queue> ResumeQueueAsync(ResumeQueueRequest request, CancellationToken cancellationToken)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
requestResumeQueueRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::ResumeQueueRequest request = new gctv::ResumeQueueRequest
{
    QueueName = gctv::QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
};
// Make the request
gctv::Queue response = await cloudTasksClient.ResumeQueueAsync(request);

ResumeQueueAsync(string, CallSettings)

public virtual Task<Queue> ResumeQueueAsync(string name, CallSettings callSettings = null)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.ResumeQueueAsync(name);

ResumeQueueAsync(string, CancellationToken)

public virtual Task<Queue> ResumeQueueAsync(string name, CancellationToken cancellationToken)

Resume a queue.

This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].

WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
gctv::Queue response = await cloudTasksClient.ResumeQueueAsync(name);

RunTask(RunTaskRequest, CallSettings)

public virtual Task RunTask(RunTaskRequest request, CallSettings callSettings = null)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
requestRunTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::RunTaskRequest request = new gctv::RunTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = cloudTasksClient.RunTask(request);

RunTask(TaskName, CallSettings)

public virtual Task RunTask(TaskName name, CallSettings callSettings = null)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
nameTaskName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
gctv::Task response = cloudTasksClient.RunTask(name);

RunTask(string, CallSettings)

public virtual Task RunTask(string name, CallSettings callSettings = null)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
gctv::Task response = cloudTasksClient.RunTask(name);

RunTaskAsync(RunTaskRequest, CallSettings)

public virtual Task<Task> RunTaskAsync(RunTaskRequest request, CallSettings callSettings = null)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
requestRunTaskRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::RunTaskRequest request = new gctv::RunTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = await cloudTasksClient.RunTaskAsync(request);

RunTaskAsync(RunTaskRequest, CancellationToken)

public virtual Task<Task> RunTaskAsync(RunTaskRequest request, CancellationToken cancellationToken)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
requestRunTaskRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::RunTaskRequest request = new gctv::RunTaskRequest
{
    TaskName = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
    ResponseView = gctv::Task.Types.View.Unspecified,
};
// Make the request
gctv::Task response = await cloudTasksClient.RunTaskAsync(request);

RunTaskAsync(TaskName, CallSettings)

public virtual Task<Task> RunTaskAsync(TaskName name, CallSettings callSettings = null)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
nameTaskName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
gctv::Task response = await cloudTasksClient.RunTaskAsync(name);

RunTaskAsync(TaskName, CancellationToken)

public virtual Task<Task> RunTaskAsync(TaskName name, CancellationToken cancellationToken)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
nameTaskName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::TaskName name = gctv::TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
// Make the request
gctv::Task response = await cloudTasksClient.RunTaskAsync(name);

RunTaskAsync(string, CallSettings)

public virtual Task<Task> RunTaskAsync(string name, CallSettings callSettings = null)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
gctv::Task response = await cloudTasksClient.RunTaskAsync(name);

RunTaskAsync(string, CancellationToken)

public virtual Task<Task> RunTaskAsync(string name, CancellationToken cancellationToken)

Forces a task to run now.

When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].

This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.

The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.

If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].

[RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]/tasks/[TASK]";
// Make the request
gctv::Task response = await cloudTasksClient.RunTaskAsync(name);

SetIamPolicy(IResourceName, Policy, CallSettings)

public virtual Policy SetIamPolicy(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = cloudTasksClient.SetIamPolicy(resource, policy);

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = cloudTasksClient.SetIamPolicy(request);

SetIamPolicy(string, Policy, CallSettings)

public virtual Policy SetIamPolicy(string resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = cloudTasksClient.SetIamPolicy(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await cloudTasksClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CancellationToken cancellationToken)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await cloudTasksClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await cloudTasksClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await cloudTasksClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(string, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await cloudTasksClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(string, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CancellationToken cancellationToken)

Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudtasks.queues.setIamPolicy
Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await cloudTasksClient.SetIamPolicyAsync(resource, policy);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

TestIamPermissions(IResourceName, IEnumerable<string>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = cloudTasksClient.TestIamPermissions(resource, permissions);

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = cloudTasksClient.TestIamPermissions(request);

TestIamPermissions(string, IEnumerable<string>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = cloudTasksClient.TestIamPermissions(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudTasksClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudTasksClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await cloudTasksClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await cloudTasksClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(string, IEnumerable<string>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudTasksClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(string, IEnumerable<string>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudTasksClient.TestIamPermissionsAsync(resource, permissions);

UpdateQueue(Queue, FieldMask, CallSettings)

public virtual Queue UpdateQueue(Queue queue, FieldMask updateMask, CallSettings callSettings = null)

Updates a queue.

This method creates the queue if it does not exist and updates the queue if it does exist.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
queueQueue

Required. The queue to create or update.

The queue's [name][google.cloud.tasks.v2beta3.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.v2beta3.Queue.name] cannot be changed.

updateMaskFieldMask

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

If empty, then all fields will be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::Queue queue = new gctv::Queue();
FieldMask updateMask = new FieldMask();
// Make the request
gctv::Queue response = cloudTasksClient.UpdateQueue(queue, updateMask);

UpdateQueue(UpdateQueueRequest, CallSettings)

public virtual Queue UpdateQueue(UpdateQueueRequest request, CallSettings callSettings = null)

Updates a queue.

This method creates the queue if it does not exist and updates the queue if it does exist.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestUpdateQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Queue

The RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = gctv::CloudTasksClient.Create();
// Initialize request argument(s)
gctv::UpdateQueueRequest request = new gctv::UpdateQueueRequest
{
    Queue = new gctv::Queue(),
    UpdateMask = new FieldMask(),
};
// Make the request
gctv::Queue response = cloudTasksClient.UpdateQueue(request);

UpdateQueueAsync(Queue, FieldMask, CallSettings)

public virtual Task<Queue> UpdateQueueAsync(Queue queue, FieldMask updateMask, CallSettings callSettings = null)

Updates a queue.

This method creates the queue if it does not exist and updates the queue if it does exist.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
queueQueue

Required. The queue to create or update.

The queue's [name][google.cloud.tasks.v2beta3.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.v2beta3.Queue.name] cannot be changed.

updateMaskFieldMask

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

If empty, then all fields will be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::Queue queue = new gctv::Queue();
FieldMask updateMask = new FieldMask();
// Make the request
gctv::Queue response = await cloudTasksClient.UpdateQueueAsync(queue, updateMask);

UpdateQueueAsync(Queue, FieldMask, CancellationToken)

public virtual Task<Queue> UpdateQueueAsync(Queue queue, FieldMask updateMask, CancellationToken cancellationToken)

Updates a queue.

This method creates the queue if it does not exist and updates the queue if it does exist.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
queueQueue

Required. The queue to create or update.

The queue's [name][google.cloud.tasks.v2beta3.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.v2beta3.Queue.name] cannot be changed.

updateMaskFieldMask

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

If empty, then all fields will be updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::Queue queue = new gctv::Queue();
FieldMask updateMask = new FieldMask();
// Make the request
gctv::Queue response = await cloudTasksClient.UpdateQueueAsync(queue, updateMask);

UpdateQueueAsync(UpdateQueueRequest, CallSettings)

public virtual Task<Queue> UpdateQueueAsync(UpdateQueueRequest request, CallSettings callSettings = null)

Updates a queue.

This method creates the queue if it does not exist and updates the queue if it does exist.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestUpdateQueueRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::UpdateQueueRequest request = new gctv::UpdateQueueRequest
{
    Queue = new gctv::Queue(),
    UpdateMask = new FieldMask(),
};
// Make the request
gctv::Queue response = await cloudTasksClient.UpdateQueueAsync(request);

UpdateQueueAsync(UpdateQueueRequest, CancellationToken)

public virtual Task<Queue> UpdateQueueAsync(UpdateQueueRequest request, CancellationToken cancellationToken)

Updates a queue.

This method creates the queue if it does not exist and updates the queue if it does exist.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml or queue.xml file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.

Parameters
NameDescription
requestUpdateQueueRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskQueue

A Task containing the RPC response.

Example
// Create client
gctv::CloudTasksClient cloudTasksClient = await gctv::CloudTasksClient.CreateAsync();
// Initialize request argument(s)
gctv::UpdateQueueRequest request = new gctv::UpdateQueueRequest
{
    Queue = new gctv::Queue(),
    UpdateMask = new FieldMask(),
};
// Make the request
gctv::Queue response = await cloudTasksClient.UpdateQueueAsync(request);