Class v2.CloudTasksClient (5.5.1)

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

Package

@google-cloud/tasks

Constructors

(constructor)(opts, gaxInstance)

  constructor 
 ( 
 opts 
 ?: 
  
 ClientOptions 
 , 
  
 gaxInstance 
 ?: 
  
 typeof 
  
 gax 
  
 | 
  
 typeof 
  
 gax 
 . 
 fallback 
 ); 
 

Construct an instance of CloudTasksClient.

Parameters
Name
Description
opts
ClientOptions
gaxInstance
typeof gax | typeof fallback

: loaded instance of google-gax . Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new CloudTasksClient({fallback: 'rest'}, gax); ```

Properties

apiEndpoint

  get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

apiEndpoint

  static 
  
 get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service - same as servicePath, exists for compatibility reasons.

auth

  auth 
 : 
  
 gax 
 . 
 GoogleAuth 
 ; 
 

cloudTasksStub

  cloudTasksStub 
 ?: 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 

descriptors

  descriptors 
 : 
  
 Descriptors 
 ; 
 

innerApiCalls

  innerApiCalls 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }; 
 

locationsClient

  locationsClient 
 : 
  
 LocationsClient 
 ; 
 

pathTemplates

  pathTemplates 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 gax 
 . 
 PathTemplate 
 ; 
  
 }; 
 

port

  static 
  
 get 
  
 port 
 () 
 : 
  
 number 
 ; 
 

The port for this API service.

scopes

  static 
  
 get 
  
 scopes 
 () 
 : 
  
 string 
 []; 
 

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

  static 
  
 get 
  
 servicePath 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

universeDomain

  get 
  
 universeDomain 
 () 
 : 
  
 string 
 ; 
 

warn

  warn 
 : 
  
 ( 
 code 
 : 
  
 string 
 , 
  
 message 
 : 
  
 string 
 , 
  
 warnType 
 ?: 
  
 string 
 ) 
  
 = 
>  
 void 
 ; 
 

Methods

close()

  close 
 () 
 : 
  
 Promise<void> 
 ; 
 

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type
Description
Promise <void>

{Promise} A promise that resolves when the client is closed.

createQueue(request, options)

  createQueue 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateQueueRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateQueueRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

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]( https://cloud.google.com/tasks/docs/queue-yaml ) before using this method.

Parameters
Name
Description
request
ICreateQueueRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  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. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The queue to create. 
 *  Queue's name google.cloud.tasks.v2.Queue.name  cannot be the same as an 
 *  existing queue. 
 */ 
  
 // const queue = {} 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateQueue 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 queue 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 createQueue 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateQueue 
 (); 
 

createQueue(request, options, callback)

  createQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateQueueRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.ICreateQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

createQueue(request, callback)

  createQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateQueueRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.ICreateQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

createTask(request, options)

  createTask 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateTaskRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateTaskRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

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
Name
Description
request
ICreateTaskRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The queue name. For example: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` 
 *  The queue must already exist. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The task to add. 
 *  Task names have the following format: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. 
 *  The user can optionally specify a task 
 *  name google.cloud.tasks.v2.Task.name. If a name is not specified then 
 *  the system will generate a random unique task id, which will be set in the 
 *  task returned in the response google.cloud.tasks.v2.Task.name. 
 *  If schedule_time google.cloud.tasks.v2.Task.schedule_time  is not set or 
 *  is in the past then Cloud Tasks will set it to the current time. 
 *  Task De-duplication: 
 *  Explicitly specifying a task ID enables task de-duplication.  If 
 *  a task's ID is identical to that of an existing task or a task 
 *  that was deleted or executed recently then the call will fail 
 *  with ALREADY_EXISTS google.rpc.Code.ALREADY_EXISTS. 
 *  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.v2.CloudTasks.CreateTask 
 *  calls have significantly increased latency. Using hashed strings for the 
 *  task id or for the prefix of the task id is recommended. Choosing task ids 
 *  that are sequential or have sequential prefixes, for example using a 
 *  timestamp, causes an increase in latency and error rates in all 
 *  task commands. The infrastructure relies on an approximately 
 *  uniform distribution of task ids to store and serve tasks 
 *  efficiently. 
 */ 
  
 // const task = {} 
  
 /** 
 *  The response_view specifies which subset of the 
 *  Task google.cloud.tasks.v2.Task  will be returned. 
 *  By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; 
 *  not all information is retrieved by default because some data, such as 
 *  payloads, might be desirable to return only when needed because 
 *  of its large size or because of the sensitivity of data that it 
 *  contains. 
 *  Authorization for FULL google.cloud.tasks.v2.Task.View.FULL  requires 
 *  `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) 
 *  permission on the Task google.cloud.tasks.v2.Task  resource. 
 */ 
  
 // const responseView = {} 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateTask 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 task 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 createTask 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateTask 
 (); 
 

createTask(request, options, callback)

  createTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateTaskRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.ITask , protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

createTask(request, callback)

  createTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateTaskRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ICreateTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.tasks.v2.ITask , protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

deleteQueue(request, options)

  deleteQueue 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteQueueRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteQueueRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

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]( https://cloud.google.com/tasks/docs/queue-yaml ) before using this method.

Parameters
Name
Description
request
IDeleteQueueRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The queue name. For example: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteQueue 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 deleteQueue 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteQueue 
 (); 
 

deleteQueue(request, options, callback)

  deleteQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteQueueRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.tasks.v2.IDeleteQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

deleteQueue(request, callback)

  deleteQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteQueueRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.tasks.v2.IDeleteQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

deleteTask(request, options)

  deleteTask 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteTaskRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteTaskRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

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
Name
Description
request
IDeleteTaskRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The task name. For example: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteTask 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 deleteTask 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteTask 
 (); 
 

deleteTask(request, options, callback)

  deleteTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteTaskRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.tasks.v2.IDeleteTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

deleteTask(request, callback)

  deleteTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteTaskRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IDeleteTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.tasks.v2.IDeleteTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getIamPolicy(request, options)

  getIamPolicy 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Gets the access control policy for a . Returns an empty policy if the resource exists and does not have a policy set.

Authorization requires the following [Google IAM]( https://cloud.google.com/iam ) permission on the specified resource parent:

* cloudtasks.queues.getIamPolicy

Parameters
Name
Description
request
IGetIamPolicyRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Promise <[ protos.google.iam.v1.IPolicy , protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  REQUIRED: The resource for which the policy is being requested. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  OPTIONAL: A `GetPolicyOptions` object for specifying options to 
 *  `GetIamPolicy`. 
 */ 
  
 // const options = {} 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callGetIamPolicy 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 getIamPolicy 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetIamPolicy 
 (); 
 

getIamPolicy(request, options, callback)

  getIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getIamPolicy(request, callback)

  getIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getLocation(request, options, callback)

  getLocation 
 ( 
 request 
 : 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IGetLocationRequest 
 , 
  
 options 
 ?: 
  
 gax 
 . 
 CallOptions 
  
 | 
  
 Callback<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
 , 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IGetLocationRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> , 
  
 callback 
 ?: 
  
 Callback<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
 , 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IGetLocationRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 Promise<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
> ; 
 

Gets information about a location.

Parameters
Name
Description
request
LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options
CallOptions | Callback < google.cloud.location.ILocation , google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback
Callback < google.cloud.location.ILocation , google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
Promise < google.cloud.location.ILocation >

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
  const 
  
 [ 
 response 
 ] 
  
 = 
  
 await 
  
 client 
 . 
 getLocation 
 ( 
 request 
 ); 
 

getProjectId()

  getProjectId 
 () 
 : 
  
 Promise<string> 
 ; 
 
Returns
Type
Description
Promise <string>

getProjectId(callback)

  getProjectId 
 ( 
 callback 
 : 
  
 Callback<string 
 , 
  
 undefined 
 , 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameter
Name
Description
callback
Callback <string, undefined, undefined>
Returns
Type
Description
void

getQueue(request, options)

  getQueue 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetQueueRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetQueueRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Gets a queue.

Parameters
Name
Description
request
IGetQueueRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The resource name of the queue. For example: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callGetQueue 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 getQueue 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetQueue 
 (); 
 

getQueue(request, options, callback)

  getQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetQueueRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IGetQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getQueue(request, callback)

  getQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetQueueRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IGetQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getTask(request, options)

  getTask 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetTaskRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetTaskRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Gets a task.

Parameters
Name
Description
request
IGetTaskRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The task name. For example: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  The response_view specifies which subset of the 
 *  Task google.cloud.tasks.v2.Task  will be returned. 
 *  By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; 
 *  not all information is retrieved by default because some data, such as 
 *  payloads, might be desirable to return only when needed because 
 *  of its large size or because of the sensitivity of data that it 
 *  contains. 
 *  Authorization for FULL google.cloud.tasks.v2.Task.View.FULL  requires 
 *  `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) 
 *  permission on the Task google.cloud.tasks.v2.Task  resource. 
 */ 
  
 // const responseView = {} 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callGetTask 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 getTask 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetTask 
 (); 
 

getTask(request, options, callback)

  getTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetTaskRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
request
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.ITask , protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getTask(request, callback)

  getTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetTaskRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IGetTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
request
callback
Callback < protos.google.cloud.tasks.v2.ITask , protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

initialize()

  initialize 
 () 
 : 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
Type
Description
Promise <{ [name: string]: Function ; }>

{Promise} A promise that resolves to an authenticated service stub.

listLocationsAsync(request, options)

  listLocationsAsync 
 ( 
 request 
 : 
  
 LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 IListLocationsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<LocationProtos 
 . 
 google 
 . 
 cloud 
 . 
 location 
 . 
 ILocation 
> ; 
 

Lists information about the supported locations for this service. Returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
AsyncIterable < google.cloud.location.ILocation >

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  const 
  
 iterable 
  
 = 
  
 client 
 . 
 listLocationsAsync 
 ( 
 request 
 ); 
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 // process response 
 } 
 

listQueues(request, options)

  listQueues 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 [], 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesResponse 
  
 ]>; 
 

Lists queues.

Queues are returned in lexicographical order.

Parameters
Name
Description
request
IListQueuesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listQueuesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listQueues(request, options, callback)

  listQueues 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

listQueues(request, callback)

  listQueues 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listQueuesAsync(request, options)

  listQueuesAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
> ; 
 

Equivalent to listQueues , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
IListQueuesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The location name. 
 *  For example: `projects/PROJECT_ID/locations/LOCATION_ID` 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2.Queue 
 *  field can be used as a filter and several operators as supported. 
 *  For example: `<=,><,>=, >, !=, =, :`. The filter syntax is the same as 
 *  described in 
 *  Stackdriver's Advanced Logs 
 *  Filters (https://cloud.google.com/logging/docs/view/advanced_filters). 
 *  Sample filter "state: PAUSED". 
 *  Note that using filters might cause fewer queues than the 
 *  requested page_size to be returned. 
 */ 
  
 // const filter = 'abc123' 
  
 /** 
 *  Requested page size. 
 *  The maximum page size is 9800. If unspecified, the page size will 
 *  be the maximum. Fewer queues than requested might be returned, 
 *  even if more queues exist; use the 
 *  next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token  in the 
 *  response to determine if more queues exist. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  A token identifying the page of results to return. 
 *  To request the first page results, page_token must be empty. To 
 *  request the next page of results, page_token must be the value of 
 *  next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token  returned 
 *  from the previous call to ListQueues google.cloud.tasks.v2.CloudTasks.ListQueues 
 *  method. It is an error to switch the value of the 
 *  filter google.cloud.tasks.v2.ListQueuesRequest.filter  while iterating through pages. 
 */ 
  
 // const pageToken = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callListQueues 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 await 
  
 tasksClient 
 . 
 listQueuesAsync 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListQueues 
 (); 
 

listQueuesStream(request, options)

  listQueuesStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListQueuesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to method.name.toCamelCase() , but returns a NodeJS Stream object.

Parameters
Name
Description
request
IListQueuesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listQueuesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listTasks(request, options)

  listTasks 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 [], 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksResponse 
  
 ]>; 
 

Lists the tasks in a queue.

By default, only the view is retrieved due to performance considerations; controls the subset of information which is returned.

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

Parameters
Name
Description
request
IListTasksRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listTasksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listTasks(request, options, callback)

  listTasks 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

listTasks(request, callback)

  listTasks 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listTasksAsync(request, options)

  listTasksAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
> ; 
 

Equivalent to listTasks , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
IListTasksRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The queue name. For example: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  The response_view specifies which subset of the 
 *  Task google.cloud.tasks.v2.Task  will be returned. 
 *  By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; 
 *  not all information is retrieved by default because some data, such as 
 *  payloads, might be desirable to return only when needed because 
 *  of its large size or because of the sensitivity of data that it 
 *  contains. 
 *  Authorization for FULL google.cloud.tasks.v2.Task.View.FULL  requires 
 *  `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) 
 *  permission on the Task google.cloud.tasks.v2.Task  resource. 
 */ 
  
 // const responseView = {} 
  
 /** 
 *  Maximum page size. 
 *  Fewer tasks than requested might be returned, even if more tasks exist; use 
 *  next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token 
 *  in the response to determine if more tasks exist. 
 *  The maximum page size is 1000. If unspecified, the page size will be the 
 *  maximum. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  A token identifying the page of results to return. 
 *  To request the first page results, page_token must be empty. To 
 *  request the next page of results, page_token must be the value of 
 *  next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token 
 *  returned from the previous call to 
 *  ListTasks google.cloud.tasks.v2.CloudTasks.ListTasks  method. 
 *  The page token is valid for only 2 hours. 
 */ 
  
 // const pageToken = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callListTasks 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 tasksClient 
 . 
 listTasksAsync 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListTasks 
 (); 
 

listTasksStream(request, options)

  listTasksStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IListTasksRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to method.name.toCamelCase() , but returns a NodeJS Stream object.

Parameters
Name
Description
request
IListTasksRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listTasksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location)

  locationPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified location resource name string.

Parameters
Name
Description
project
string
location
string
Returns
Type
Description
string

{string} Resource name string.

matchLocationFromLocationName(locationName)

  matchLocationFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Location resource.

Parameter
Name
Description
locationName
string

A fully-qualified path representing Location resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromQueueName(queueName)

  matchLocationFromQueueName 
 ( 
 queueName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Queue resource.

Parameter
Name
Description
queueName
string

A fully-qualified path representing Queue resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromTaskName(taskName)

  matchLocationFromTaskName 
 ( 
 taskName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Task resource.

Parameter
Name
Description
taskName
string

A fully-qualified path representing Task resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchProjectFromLocationName(locationName)

  matchProjectFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Location resource.

Parameter
Name
Description
locationName
string

A fully-qualified path representing Location resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

  matchProjectFromProjectName 
 ( 
 projectName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Project resource.

Parameter
Name
Description
projectName
string

A fully-qualified path representing Project resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromQueueName(queueName)

  matchProjectFromQueueName 
 ( 
 queueName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Queue resource.

Parameter
Name
Description
queueName
string

A fully-qualified path representing Queue resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromTaskName(taskName)

  matchProjectFromTaskName 
 ( 
 taskName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Task resource.

Parameter
Name
Description
taskName
string

A fully-qualified path representing Task resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchQueueFromQueueName(queueName)

  matchQueueFromQueueName 
 ( 
 queueName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the queue from Queue resource.

Parameter
Name
Description
queueName
string

A fully-qualified path representing Queue resource.

Returns
Type
Description
string | number

{string} A string representing the queue.

matchQueueFromTaskName(taskName)

  matchQueueFromTaskName 
 ( 
 taskName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the queue from Task resource.

Parameter
Name
Description
taskName
string

A fully-qualified path representing Task resource.

Returns
Type
Description
string | number

{string} A string representing the queue.

matchTaskFromTaskName(taskName)

  matchTaskFromTaskName 
 ( 
 taskName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the task from Task resource.

Parameter
Name
Description
taskName
string

A fully-qualified path representing Task resource.

Returns
Type
Description
string | number

{string} A string representing the task.

pauseQueue(request, options)

  pauseQueue 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPauseQueueRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPauseQueueRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Pauses the queue.

If a queue is paused then the system will stop dispatching tasks until the queue is resumed via . Tasks can still be added when the queue is paused. A queue is paused if its is .

Parameters
Name
Description
request
IPauseQueueRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The queue name. For example: 
 *  `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callPauseQueue 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 pauseQueue 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callPauseQueue 
 (); 
 

pauseQueue(request, options, callback)

  pauseQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPauseQueueRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPauseQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IPauseQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

pauseQueue(request, callback)

  pauseQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPauseQueueRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPauseQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IPauseQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

projectPath(project)

  projectPath 
 ( 
 project 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified project resource name string.

Parameter
Name
Description
project
string
Returns
Type
Description
string

{string} Resource name string.

purgeQueue(request, options)

  purgeQueue 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPurgeQueueRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPurgeQueueRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

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
Name
Description
request
IPurgeQueueRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The queue name. For example: 
 *  `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callPurgeQueue 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 purgeQueue 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callPurgeQueue 
 (); 
 

purgeQueue(request, options, callback)

  purgeQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPurgeQueueRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPurgeQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IPurgeQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

purgeQueue(request, callback)

  purgeQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPurgeQueueRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IPurgeQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IPurgeQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

queuePath(project, location, queue)

  queuePath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 queue 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified queue resource name string.

Parameters
Name
Description
project
string
location
string
queue
string
Returns
Type
Description
string

{string} Resource name string.

resumeQueue(request, options)

  resumeQueue 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IResumeQueueRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IResumeQueueRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Resume a queue.

This method resumes a queue after it has been or . The state of a queue is stored in the queue's ; after calling this method it will be set to .

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]( https://cloud.google.com/tasks/docs/manage-cloud-task-scaling ).

Parameters
Name
Description
request
IResumeQueueRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The queue name. For example: 
 *  `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callResumeQueue 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 resumeQueue 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callResumeQueue 
 (); 
 

resumeQueue(request, options, callback)

  resumeQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IResumeQueueRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IResumeQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IResumeQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

resumeQueue(request, callback)

  resumeQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IResumeQueueRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IResumeQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IResumeQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

runTask(request, options)

  runTask 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IRunTaskRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IRunTaskRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

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 or is .

This command is meant to be used for manual debugging. For example, 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 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 will be reset to the time that was called plus the retry delay specified in the queue's RetryConfig .

returns when it is called on a task that has already succeeded or permanently failed.

Parameters
Name
Description
request
IRunTaskRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The task name. For example: 
 *  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  The response_view specifies which subset of the 
 *  Task google.cloud.tasks.v2.Task  will be returned. 
 *  By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; 
 *  not all information is retrieved by default because some data, such as 
 *  payloads, might be desirable to return only when needed because 
 *  of its large size or because of the sensitivity of data that it 
 *  contains. 
 *  Authorization for FULL google.cloud.tasks.v2.Task.View.FULL  requires 
 *  `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) 
 *  permission on the Task google.cloud.tasks.v2.Task  resource. 
 */ 
  
 // const responseView = {} 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callRunTask 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 runTask 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callRunTask 
 (); 
 

runTask(request, options, callback)

  runTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IRunTaskRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IRunTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
request
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.ITask , protos.google.cloud.tasks.v2.IRunTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

runTask(request, callback)

  runTask 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IRunTaskRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 ITask 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IRunTaskRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
request
callback
Callback < protos.google.cloud.tasks.v2.ITask , protos.google.cloud.tasks.v2.IRunTaskRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

setIamPolicy(request, options)

  setIamPolicy 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Sets the access control policy for a . 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]( https://cloud.google.com/iam ) permission on the specified resource parent:

* cloudtasks.queues.setIamPolicy

Parameters
Name
Description
request
ISetIamPolicyRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Promise <[ protos.google.iam.v1.IPolicy , protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  REQUIRED: The resource for which the policy is being specified. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  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. 
 */ 
  
 // const policy = {} 
  
 /** 
 *  OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only 
 *  the fields in the mask will be modified. If no mask is provided, the 
 *  following default mask is used: 
 *  `paths: "bindings, etag"` 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callSetIamPolicy 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 policy 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 setIamPolicy 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callSetIamPolicy 
 (); 
 

setIamPolicy(request, options, callback)

  setIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

setIamPolicy(request, callback)

  setIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

taskPath(project, location, queue, task)

  taskPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 queue 
 : 
  
 string 
 , 
  
 task 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified task resource name string.

Parameters
Name
Description
project
string
location
string
queue
string
task
string
Returns
Type
Description
string

{string} Resource name string.

testIamPermissions(request, options)

  testIamPermissions 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns permissions that a caller has on a . If the resource does not exist, this will return an empty set of permissions, not a 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
Name
Description
request
ITestIamPermissionsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing TestIamPermissionsResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  REQUIRED: The resource for which the policy detail is being requested. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  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 (https://cloud.google.com/iam/docs/overview#permissions). 
 */ 
  
 // const permissions = ['abc','def'] 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callTestIamPermissions 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 permissions 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 testIamPermissions 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callTestIamPermissions 
 (); 
 

testIamPermissions(request, options, callback)

  testIamPermissions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

testIamPermissions(request, callback)

  testIamPermissions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

updateQueue(request, options)

  updateQueue 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IUpdateQueueRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IUpdateQueueRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

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]( https://cloud.google.com/tasks/docs/queue-yaml ) before using this method.

Parameters
Name
Description
request
IUpdateQueueRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The queue to create or update. 
 *  The queue's name google.cloud.tasks.v2.Queue.name  must be specified. 
 *  Output only fields cannot be modified using UpdateQueue. 
 *  Any value specified for an output only field will be ignored. 
 *  The queue's name google.cloud.tasks.v2.Queue.name  cannot be changed. 
 */ 
  
 // const queue = {} 
  
 /** 
 *  A mask used to specify which fields of the queue are being updated. 
 *  If empty, then all fields will be updated. 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Tasks library 
  
 const 
  
 { 
 CloudTasksClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/tasks 
' 
 ). 
 v2 
 ; 
  
 // Instantiates a client 
  
 const 
  
 tasksClient 
  
 = 
  
 new 
  
  CloudTasksClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateQueue 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 queue 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 tasksClient 
 . 
 updateQueue 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateQueue 
 (); 
 

updateQueue(request, options, callback)

  updateQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IUpdateQueueRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IUpdateQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IUpdateQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

updateQueue(request, callback)

  updateQueue 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IUpdateQueueRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IQueue 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 tasks 
 . 
 v2 
 . 
 IUpdateQueueRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.tasks.v2.IQueue , protos.google.cloud.tasks.v2.IUpdateQueueRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void
Create a Mobile Website
View Site in Mobile | Classic
Share by: