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

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
IReadOnlyList<String>
Remarks

The default CloudTasks scopes are:

GrpcClient

public virtual CloudTasks.CloudTasksClient GrpcClient { get; }

The underlying gRPC CloudTasks client

Property Value
TypeDescription
CloudTasks.CloudTasksClient

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(CancellationToken))

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
Task<CloudTasksClient>

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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Queue queue = new Queue();
// Make the request
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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
CreateQueueRequest request = new CreateQueueRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Queue = new Queue(),
};
// Make the request
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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Queue queue = new Queue();
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Queue queue = new Queue();
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Queue queue = new Queue();
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
CreateQueueRequest request = new CreateQueueRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Queue = new Queue(),
};
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
CreateQueueRequest request = new CreateQueueRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Queue = new Queue(),
};
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Queue queue = new Queue();
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Queue queue = new Queue();
// Make the request
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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
CreateTaskRequest request = new CreateTaskRequest
{
    ParentAsQueueName = 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 ~1hour after the original task was deleted or executed. If the task's queue was created using queue.yaml or queue.xml, then another task with the same name can't be created for ~9days after the original task was deleted or executed.

Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
QueueName parent = 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 ~1hour after the original task was deleted or executed. If the task's queue was created using queue.yaml or queue.xml, then another task with the same name can't be created for ~9days after the original task was deleted or executed.

Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
CreateTaskRequest request = new CreateTaskRequest
{
    ParentAsQueueName = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
CreateTaskRequest request = new CreateTaskRequest
{
    ParentAsQueueName = 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 ~1hour after the original task was deleted or executed. If the task's queue was created using queue.yaml or queue.xml, then another task with the same name can't be created for ~9days after the original task was deleted or executed.

Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
QueueName parent = 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 ~1hour after the original task was deleted or executed. If the task's queue was created using queue.yaml or queue.xml, then another task with the same name can't be created for ~9days after the original task was deleted or executed.

Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
QueueName parent = 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 ~1hour after the original task was deleted or executed. If the task's queue was created using queue.yaml or queue.xml, then another task with the same name can't be created for ~9days after the original task was deleted or executed.

Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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 ~1hour after the original task was deleted or executed. If the task's queue was created using queue.yaml or queue.xml, then another task with the same name can't be created for ~9days after the original task was deleted or executed.

Because there is an extra lookup cost to identify duplicate task names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
DeleteQueueRequest request = new DeleteQueueRequest
{
    QueueName = 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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
QueueName name = 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
CloudTasksClient cloudTasksClient = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
DeleteQueueRequest request = new DeleteQueueRequest
{
    QueueName = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
DeleteQueueRequest request = new DeleteQueueRequest
{
    QueueName = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
QueueName name = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
QueueName name = 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
CloudTasksClient cloudTasksClient = await 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
CloudTasksClient cloudTasksClient = await 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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
DeleteTaskRequest request = new DeleteTaskRequest
{
    TaskName = 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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
TaskName name = 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
CloudTasksClient cloudTasksClient = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
DeleteTaskRequest request = new DeleteTaskRequest
{
    TaskName = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
DeleteTaskRequest request = new DeleteTaskRequest
{
    TaskName = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
TaskName name = 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
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
TaskName name = 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
CloudTasksClient cloudTasksClient = await 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
CloudTasksClient cloudTasksClient = await 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
CloudTasksClient cloudTasksClient = 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
CloudTasksClient cloudTasksClient = 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
CloudTasksClient cloudTasksClient = 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
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
GetQueueRequest request = new GetQueueRequest
{
    QueueName = QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ReadMask = new FieldMask(),
};
// Make the request
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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
QueueName name = QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
GetQueueRequest request = new GetQueueRequest
{
    QueueName = QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ReadMask = new FieldMask(),
};
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
GetQueueRequest request = new GetQueueRequest
{
    QueueName = QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]"),
    ReadMask = new FieldMask(),
};
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
QueueName name = QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
QueueName name = QueueName.FromProjectLocationQueue("[PROJECT]", "[LOCATION]", "[QUEUE]");
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
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
Task<Queue>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/queues/[QUEUE]";
// Make the request
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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
GetTaskRequest request = new GetTaskRequest
{
    TaskName = 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
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
TaskName name = 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
CloudTasksClient cloudTasksClient = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
GetTaskRequest request = new GetTaskRequest
{
    TaskName = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
GetTaskRequest request = new GetTaskRequest
{
    TaskName = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
TaskName name = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await CloudTasksClient.CreateAsync();
// Initialize request argument(s)
TaskName name = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
CloudTasksClient cloudTasksClient = await 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, Nullable<Int32>, 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.

pageSizeNullable<Int32>

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
PagedEnumerable<ListQueuesResponse, Queue>

A pageable sequence of Queue resources.

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

// Iterate over all response items, lazily performing RPCs as required
foreach (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 (ListQueuesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (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<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 (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
PagedEnumerable<ListQueuesResponse, Queue>

A pageable sequence of Queue resources.

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

// Iterate over all response items, lazily performing RPCs as required
foreach (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 (ListQueuesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (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<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 (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, Nullable<Int32>, 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.

pageSizeNullable<Int32>

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
PagedEnumerable<ListQueuesResponse, Queue>

A pageable sequence of Queue resources.

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

// Iterate over all response items, lazily performing RPCs as required
foreach (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 (ListQueuesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (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<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 (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, Nullable<Int32>, 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 firs