diff --git a/packages/google-cloud-tasks/linkinator.config.json b/packages/google-cloud-tasks/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-tasks/linkinator.config.json +++ b/packages/google-cloud-tasks/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_queue.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_queue.js index 32f1d7cf316..8df1c02dde4 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_queue.js @@ -24,14 +24,14 @@ function main(parent, queue) { * 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]. + * 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. + * Queue's name google.cloud.tasks.v2.Queue.name cannot be the same as an existing queue. */ - // const queue = '' + // const queue = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2; @@ -39,7 +39,7 @@ function main(parent, queue) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function createQueue() { + async function callCreateQueue() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, queue) { console.log(response); } - createQueue(); + callCreateQueue(); // [END cloudtasks_v2_generated_CloudTasks_CreateQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_task.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_task.js index 5ed19898438..f2f833f5187 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.create_task.js @@ -29,24 +29,24 @@ function main(parent, task) { * Required. The task to add. * Task names have the following format: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a + * 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 + * 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]. + * 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 + * 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 @@ -55,20 +55,20 @@ function main(parent, task) { * uniform distribution of task ids to store and serve tasks * efficiently. */ - // const task = '' + // const task = {} /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be + * 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 + * 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. + * 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 = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2; @@ -76,7 +76,7 @@ function main(parent, task) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function createTask() { + async function callCreateTask() { // Construct request const request = { parent, @@ -88,7 +88,7 @@ function main(parent, task) { console.log(response); } - createTask(); + callCreateTask(); // [END cloudtasks_v2_generated_CloudTasks_CreateTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_queue.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_queue.js index 739c4d323e5..2243c290368 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function deleteQueue() { + async function callDeleteQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteQueue(); + callDeleteQueue(); // [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_task.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_task.js index af30b4cb89f..ed004ac01ca 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.delete_task.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function deleteTask() { + async function callDeleteTask() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteTask(); + callDeleteTask(); // [END cloudtasks_v2_generated_CloudTasks_DeleteTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_iam_policy.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_iam_policy.js index 3a0dc1da33c..3e54603fee4 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_iam_policy.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_iam_policy.js @@ -28,7 +28,7 @@ function main(resource) { * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. This field is only used by Cloud IAM. */ - // const options = '' + // const options = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2; @@ -36,7 +36,7 @@ function main(resource) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getIamPolicy() { + async function callGetIamPolicy() { // Construct request const request = { resource, @@ -47,7 +47,7 @@ function main(resource) { console.log(response); } - getIamPolicy(); + callGetIamPolicy(); // [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_queue.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_queue.js index 19bd1860a2b..2e2f7eff56e 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getQueue() { + async function callGetQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getQueue(); + callGetQueue(); // [END cloudtasks_v2_generated_CloudTasks_GetQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_task.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_task.js index 5605847cbd2..26834cc4379 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.get_task.js @@ -25,18 +25,18 @@ function main(name) { */ // const name = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be + * 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 + * 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. + * 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 = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2; @@ -44,7 +44,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getTask() { + async function callGetTask() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name) { console.log(response); } - getTask(); + callGetTask(); // [END cloudtasks_v2_generated_CloudTasks_GetTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_queues.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_queues.js index 64025a840a9..1cfa5ad8a2f 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_queues.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_queues.js @@ -25,12 +25,12 @@ function main(parent) { */ // const parent = 'abc123' /** - * `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2.Queue] + * `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). + * 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. @@ -41,7 +41,7 @@ function main(parent) { * 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 + * next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token in the * response to determine if more queues exist. */ // const pageSize = 1234 @@ -49,10 +49,10 @@ function main(parent) { * 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] + * 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. + * filter google.cloud.tasks.v2.ListQueuesRequest.filter while iterating through pages. */ // const pageToken = 'abc123' @@ -62,7 +62,7 @@ function main(parent) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function listQueues() { + async function callListQueues() { // Construct request const request = { parent, @@ -75,7 +75,7 @@ function main(parent) { } } - listQueues(); + callListQueues(); // [END cloudtasks_v2_generated_CloudTasks_ListQueues_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_tasks.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_tasks.js index 66f9762f4af..72fbfb1692e 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_tasks.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.list_tasks.js @@ -25,22 +25,22 @@ function main(parent) { */ // const parent = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be + * 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 + * 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. + * 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 = '' + // 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 + * 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. @@ -50,8 +50,8 @@ function main(parent) { * 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] + * 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. */ @@ -63,7 +63,7 @@ function main(parent) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function listTasks() { + async function callListTasks() { // Construct request const request = { parent, @@ -76,7 +76,7 @@ function main(parent) { } } - listTasks(); + callListTasks(); // [END cloudtasks_v2_generated_CloudTasks_ListTasks_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.pause_queue.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.pause_queue.js index 21d00387ec8..2405a927c07 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.pause_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.pause_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function pauseQueue() { + async function callPauseQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - pauseQueue(); + callPauseQueue(); // [END cloudtasks_v2_generated_CloudTasks_PauseQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.purge_queue.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.purge_queue.js index 805d93c74ca..94fa7e72675 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.purge_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.purge_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function purgeQueue() { + async function callPurgeQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - purgeQueue(); + callPurgeQueue(); // [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.resume_queue.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.resume_queue.js index 278b3416a60..9cf9d9ef70d 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.resume_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.resume_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function resumeQueue() { + async function callResumeQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - resumeQueue(); + callResumeQueue(); // [END cloudtasks_v2_generated_CloudTasks_ResumeQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.run_task.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.run_task.js index 80536e04af4..f60dad0e53d 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.run_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.run_task.js @@ -25,18 +25,18 @@ function main(name) { */ // const name = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be + * 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 + * 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. + * 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 = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2; @@ -44,7 +44,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function runTask() { + async function callRunTask() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name) { console.log(response); } - runTask(); + callRunTask(); // [END cloudtasks_v2_generated_CloudTasks_RunTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.set_iam_policy.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.set_iam_policy.js index b5e6954d4c4..eb282dfd170 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.set_iam_policy.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.set_iam_policy.js @@ -30,7 +30,7 @@ function main(resource, policy) { * valid policy but certain Cloud Platform services (such as Projects) * might reject them. */ - // const policy = '' + // const policy = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2; @@ -38,7 +38,7 @@ function main(resource, policy) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function setIamPolicy() { + async function callSetIamPolicy() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, policy) { console.log(response); } - setIamPolicy(); + callSetIamPolicy(); // [END cloudtasks_v2_generated_CloudTasks_SetIamPolicy_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.test_iam_permissions.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.test_iam_permissions.js index a02cdea1d92..c6d63b680f5 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.test_iam_permissions.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.test_iam_permissions.js @@ -28,7 +28,7 @@ function main(resource, permissions) { * 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). + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). */ // const permissions = 'abc123' @@ -38,7 +38,7 @@ function main(resource, permissions) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function testIamPermissions() { + async function callTestIamPermissions() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, permissions) { console.log(response); } - testIamPermissions(); + callTestIamPermissions(); // [END cloudtasks_v2_generated_CloudTasks_TestIamPermissions_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.update_queue.js b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.update_queue.js index b5b6ab7b439..7f83d829cca 100644 --- a/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.update_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2/cloud_tasks.update_queue.js @@ -21,17 +21,17 @@ function main(queue) { */ /** * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. + * 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. + * The queue's name google.cloud.tasks.v2.Queue.name cannot be changed. */ - // const queue = '' + // 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 = '' + // const updateMask = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2; @@ -39,7 +39,7 @@ function main(queue) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function updateQueue() { + async function callUpdateQueue() { // Construct request const request = { queue, @@ -50,7 +50,7 @@ function main(queue) { console.log(response); } - updateQueue(); + callUpdateQueue(); // [END cloudtasks_v2_generated_CloudTasks_UpdateQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.acknowledge_task.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.acknowledge_task.js index 44eb7c6e9bb..b2dc85a09ed 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.acknowledge_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.acknowledge_task.js @@ -26,12 +26,12 @@ function main(name, scheduleTime) { // const name = 'abc123' /** * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. This restriction is + * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time returned by + * LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks response or + * RenewLease google.cloud.tasks.v2beta2.CloudTasks.RenewLease response. This restriction is * to ensure that your worker currently holds the lease. */ - // const scheduleTime = '' + // const scheduleTime = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -39,7 +39,7 @@ function main(name, scheduleTime) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function acknowledgeTask() { + async function callAcknowledgeTask() { // Construct request const request = { name, @@ -51,7 +51,7 @@ function main(name, scheduleTime) { console.log(response); } - acknowledgeTask(); + callAcknowledgeTask(); // [END cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.cancel_lease.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.cancel_lease.js index 397d6fee3d5..0a1ad2d69a1 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.cancel_lease.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.cancel_lease.js @@ -26,25 +26,25 @@ function main(name, scheduleTime) { // const name = 'abc123' /** * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. This restriction is + * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time returned by + * LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks response or + * RenewLease google.cloud.tasks.v2beta2.CloudTasks.RenewLease response. This restriction is * to ensure that your worker currently holds the lease. */ - // const scheduleTime = '' + // const scheduleTime = {} /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta2.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.v2beta2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta2.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -52,7 +52,7 @@ function main(name, scheduleTime) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function cancelLease() { + async function callCancelLease() { // Construct request const request = { name, @@ -64,7 +64,7 @@ function main(name, scheduleTime) { console.log(response); } - cancelLease(); + callCancelLease(); // [END cloudtasks_v2beta2_generated_CloudTasks_CancelLease_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_queue.js index 918d794726e..4398da8187e 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_queue.js @@ -24,14 +24,14 @@ function main(parent, queue) { * 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]. + * ListLocations google.cloud.location.Locations.ListLocations. */ // const parent = 'abc123' /** * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as an existing queue. + * Queue's name google.cloud.tasks.v2beta2.Queue.name cannot be the same as an existing queue. */ - // const queue = '' + // const queue = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -39,7 +39,7 @@ function main(parent, queue) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function createQueue() { + async function callCreateQueue() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, queue) { console.log(response); } - createQueue(); + callCreateQueue(); // [END cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_task.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_task.js index 7c71a3b6bdd..64630ecd8e4 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.create_task.js @@ -29,24 +29,24 @@ function main(parent, task) { * Required. The task to add. * Task names have the following format: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task [name][google.cloud.tasks.v2beta2.Task.name]. If a + * The user can optionally specify a task name google.cloud.tasks.v2beta2.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.v2beta2.Task.name]. - * If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not set or is in the + * response google.cloud.tasks.v2beta2.Task.name. + * If schedule_time google.cloud.tasks.v2beta2.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 completed recently then the call will fail - * with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + * 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 completed. 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 completed. * Because there is an extra lookup cost to identify duplicate task - * names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] calls have significantly + * names, these CreateTask google.cloud.tasks.v2beta2.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 @@ -55,20 +55,20 @@ function main(parent, task) { * uniform distribution of task ids to store and serve tasks * efficiently. */ - // const task = '' + // const task = {} /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta2.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.v2beta2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta2.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -76,7 +76,7 @@ function main(parent, task) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function createTask() { + async function callCreateTask() { // Construct request const request = { parent, @@ -88,7 +88,7 @@ function main(parent, task) { console.log(response); } - createTask(); + callCreateTask(); // [END cloudtasks_v2beta2_generated_CloudTasks_CreateTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_queue.js index 70a24d960d1..7723478a9c3 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function deleteQueue() { + async function callDeleteQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteQueue(); + callDeleteQueue(); // [END cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_task.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_task.js index 029116f1d05..c4e7ac2d259 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.delete_task.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function deleteTask() { + async function callDeleteTask() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteTask(); + callDeleteTask(); // [END cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_iam_policy.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_iam_policy.js index 4a9a89d3b0e..8fc9bb43f83 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_iam_policy.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_iam_policy.js @@ -28,7 +28,7 @@ function main(resource) { * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. This field is only used by Cloud IAM. */ - // const options = '' + // const options = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -36,7 +36,7 @@ function main(resource) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getIamPolicy() { + async function callGetIamPolicy() { // Construct request const request = { resource, @@ -47,7 +47,7 @@ function main(resource) { console.log(response); } - getIamPolicy(); + callGetIamPolicy(); // [END cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_queue.js index c3b4a958dcf..6cecde88136 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_queue.js @@ -27,10 +27,10 @@ function main(name) { /** * Optional. Read mask is used for a more granular control over what the API returns. * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * Queue.stats. Queue.stats will be returned only if it was explicitly * specified in the mask. */ - // const readMask = '' + // const readMask = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -38,7 +38,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getQueue() { + async function callGetQueue() { // Construct request const request = { name, @@ -49,7 +49,7 @@ function main(name) { console.log(response); } - getQueue(); + callGetQueue(); // [END cloudtasks_v2beta2_generated_CloudTasks_GetQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_task.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_task.js index 909183344d8..34420f1ea55 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.get_task.js @@ -25,18 +25,18 @@ function main(name) { */ // const name = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta2.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.v2beta2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta2.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -44,7 +44,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getTask() { + async function callGetTask() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name) { console.log(response); } - getTask(); + callGetTask(); // [END cloudtasks_v2beta2_generated_CloudTasks_GetTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.lease_tasks.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.lease_tasks.js index 6768484016d..7bf6d47318f 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.lease_tasks.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.lease_tasks.js @@ -29,51 +29,51 @@ function main(parent, leaseDuration) { * The system will make a best effort to return as close to as * `max_tasks` as possible. * The largest that `max_tasks` can be is 1000. - * The maximum total size of a [lease tasks response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is + * The maximum total size of a lease tasks response google.cloud.tasks.v2beta2.LeaseTasksResponse is * 32 MB. If the sum of all task sizes requested reaches this limit, * fewer tasks than requested are returned. */ // const maxTasks = 1234 /** * Required. The duration of the lease. - * Each task returned in the [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will - * have its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the current + * Each task returned in the response google.cloud.tasks.v2beta2.LeaseTasksResponse will + * have its schedule_time google.cloud.tasks.v2beta2.Task.schedule_time set to the current * time plus the `lease_duration`. The task is leased until its - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the task will not be - * returned to another [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call - * before its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time; thus, the task will not be + * returned to another LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks call + * before its schedule_time google.cloud.tasks.v2beta2.Task.schedule_time. * After the worker has successfully finished the work associated * with the task, the worker must call via - * [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] before the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. Otherwise the task will be - * returned to a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so + * AcknowledgeTask google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask before the + * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time. Otherwise the task will be + * returned to a later LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks call so * that another worker can retry it. * The maximum lease duration is 1 week. * `lease_duration` will be truncated to the nearest second. */ - // const leaseDuration = '' + // const leaseDuration = {} /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta2.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.v2beta2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta2.Task resource. */ - // const responseView = '' + // const responseView = {} /** * `filter` can be used to specify a subset of tasks to lease. * When `filter` is set to `tag=` then the - * [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only tasks whose - * [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to ``. `` must be + * response google.cloud.tasks.v2beta2.LeaseTasksResponse will contain only tasks whose + * tag google.cloud.tasks.v2beta2.PullMessage.tag is equal to ``. `` must be * less than 500 characters. * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have * the same tag as the task with the oldest - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be returned. + * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time will be returned. * Grammar Syntax: * * `filter = "tag=" tag | "tag_function=" function` * * `tag = string` @@ -82,11 +82,11 @@ function main(parent, leaseDuration) { * oldest task (ordered by schedule time). * SDK compatibility: Although the SDK allows tags to be either * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * bytes (https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which * aren't UTF-8 encoded can't be used in the - * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the task's - * [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed as empty in Cloud Tasks. + * filter google.cloud.tasks.v2beta2.LeaseTasksRequest.filter and the task's + * tag google.cloud.tasks.v2beta2.PullMessage.tag will be displayed as empty in Cloud Tasks. */ // const filter = 'abc123' @@ -96,7 +96,7 @@ function main(parent, leaseDuration) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function leaseTasks() { + async function callLeaseTasks() { // Construct request const request = { parent, @@ -108,7 +108,7 @@ function main(parent, leaseDuration) { console.log(response); } - leaseTasks(); + callLeaseTasks(); // [END cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_queues.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_queues.js index a9b8c172490..5aeef152950 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_queues.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_queues.js @@ -25,12 +25,12 @@ function main(parent) { */ // const parent = 'abc123' /** - * `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2beta2.Queue] + * `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2beta2.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). + * Stackdriver's Advanced Logs + * Filters (https://cloud.google.com/logging/docs/view/advanced_filters). * Sample filter "app_engine_http_target: *". * Note that using filters might cause fewer queues than the * requested_page size to be returned. @@ -41,7 +41,7 @@ function main(parent) { * 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.v2beta2.ListQueuesResponse.next_page_token] in the + * next_page_token google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token in the * response to determine if more queues exist. */ // const pageSize = 1234 @@ -49,19 +49,19 @@ function main(parent) { * 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.v2beta2.ListQueuesResponse.next_page_token] returned - * from the previous call to [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] + * next_page_token google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token returned + * from the previous call to ListQueues google.cloud.tasks.v2beta2.CloudTasks.ListQueues * method. It is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while iterating through pages. + * filter google.cloud.tasks.v2beta2.ListQueuesRequest.filter while iterating through pages. */ // const pageToken = 'abc123' /** * Optional. Read mask is used for a more granular control over what the API returns. * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * Queue.stats. Queue.stats will be returned only if it was explicitly * specified in the mask. */ - // const readMask = '' + // const readMask = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -69,7 +69,7 @@ function main(parent) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function listQueues() { + async function callListQueues() { // Construct request const request = { parent, @@ -82,7 +82,7 @@ function main(parent) { } } - listQueues(); + callListQueues(); // [END cloudtasks_v2beta2_generated_CloudTasks_ListQueues_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_tasks.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_tasks.js index a14fe88b0fa..ba09fdc4907 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_tasks.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.list_tasks.js @@ -25,22 +25,22 @@ function main(parent) { */ // const parent = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta2.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.v2beta2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta2.Task resource. */ - // const responseView = '' + // const responseView = {} /** * Maximum page size. * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] in the response to + * next_page_token google.cloud.tasks.v2beta2.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. @@ -50,8 +50,8 @@ function main(parent) { * 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.v2beta2.ListTasksResponse.next_page_token] returned - * from the previous call to [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] + * next_page_token google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token returned + * from the previous call to ListTasks google.cloud.tasks.v2beta2.CloudTasks.ListTasks * method. * The page token is valid for only 2 hours. */ @@ -63,7 +63,7 @@ function main(parent) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function listTasks() { + async function callListTasks() { // Construct request const request = { parent, @@ -76,7 +76,7 @@ function main(parent) { } } - listTasks(); + callListTasks(); // [END cloudtasks_v2beta2_generated_CloudTasks_ListTasks_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.pause_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.pause_queue.js index b5aef149116..f1b1f9d2939 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.pause_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.pause_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function pauseQueue() { + async function callPauseQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - pauseQueue(); + callPauseQueue(); // [END cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.purge_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.purge_queue.js index fc95dc9cfb5..548ae8748c8 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.purge_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.purge_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function purgeQueue() { + async function callPurgeQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - purgeQueue(); + callPurgeQueue(); // [END cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.renew_lease.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.renew_lease.js index cc93f411f02..f5a94a1e651 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.renew_lease.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.renew_lease.js @@ -26,31 +26,31 @@ function main(name, scheduleTime, leaseDuration) { // const name = 'abc123' /** * Required. The task's current schedule time, available in the - * [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - * [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. This restriction is + * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time returned by + * LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks response or + * RenewLease google.cloud.tasks.v2beta2.CloudTasks.RenewLease response. This restriction is * to ensure that your worker currently holds the lease. */ - // const scheduleTime = '' + // const scheduleTime = {} /** * Required. The desired new lease duration, starting from now. * The maximum lease duration is 1 week. * `lease_duration` will be truncated to the nearest second. */ - // const leaseDuration = '' + // const leaseDuration = {} /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta2.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.v2beta2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta2.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -58,7 +58,7 @@ function main(name, scheduleTime, leaseDuration) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function renewLease() { + async function callRenewLease() { // Construct request const request = { name, @@ -71,7 +71,7 @@ function main(name, scheduleTime, leaseDuration) { console.log(response); } - renewLease(); + callRenewLease(); // [END cloudtasks_v2beta2_generated_CloudTasks_RenewLease_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.resume_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.resume_queue.js index 1c42ea9f704..91fe86ad2fc 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.resume_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.resume_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function resumeQueue() { + async function callResumeQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - resumeQueue(); + callResumeQueue(); // [END cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.run_task.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.run_task.js index 0b5fdee00ee..be138861271 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.run_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.run_task.js @@ -25,18 +25,18 @@ function main(name) { */ // const name = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta2.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.v2beta2.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta2.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -44,7 +44,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function runTask() { + async function callRunTask() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name) { console.log(response); } - runTask(); + callRunTask(); // [END cloudtasks_v2beta2_generated_CloudTasks_RunTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.set_iam_policy.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.set_iam_policy.js index 70080fba3ab..4ef9d32af7e 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.set_iam_policy.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.set_iam_policy.js @@ -30,7 +30,7 @@ function main(resource, policy) { * valid policy but certain Cloud Platform services (such as Projects) * might reject them. */ - // const policy = '' + // const policy = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -38,7 +38,7 @@ function main(resource, policy) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function setIamPolicy() { + async function callSetIamPolicy() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, policy) { console.log(response); } - setIamPolicy(); + callSetIamPolicy(); // [END cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js index 4efb3a2e319..a1b1aa29b3e 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js @@ -28,7 +28,7 @@ function main(resource, permissions) { * 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). + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). */ // const permissions = 'abc123' @@ -38,7 +38,7 @@ function main(resource, permissions) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function testIamPermissions() { + async function callTestIamPermissions() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, permissions) { console.log(response); } - testIamPermissions(); + callTestIamPermissions(); // [END cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.update_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.update_queue.js index 864812fb7c8..536746eeb5f 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.update_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta2/cloud_tasks.update_queue.js @@ -21,17 +21,17 @@ function main(queue) { */ /** * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be specified. + * The queue's name google.cloud.tasks.v2beta2.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.v2beta2.Queue.name] cannot be changed. + * The queue's name google.cloud.tasks.v2beta2.Queue.name cannot be changed. */ - // const queue = '' + // 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 = '' + // const updateMask = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; @@ -39,7 +39,7 @@ function main(queue) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function updateQueue() { + async function callUpdateQueue() { // Construct request const request = { queue, @@ -50,7 +50,7 @@ function main(queue) { console.log(response); } - updateQueue(); + callUpdateQueue(); // [END cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_queue.js index 602d1d5d7a5..1cb9e41640b 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_queue.js @@ -24,14 +24,14 @@ function main(parent, queue) { * 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]. + * ListLocations google.cloud.location.Locations.ListLocations. */ // const parent = 'abc123' /** * Required. The queue to create. - * [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as an existing queue. + * Queue's name google.cloud.tasks.v2beta3.Queue.name cannot be the same as an existing queue. */ - // const queue = '' + // const queue = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -39,7 +39,7 @@ function main(parent, queue) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function createQueue() { + async function callCreateQueue() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, queue) { console.log(response); } - createQueue(); + callCreateQueue(); // [END cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_task.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_task.js index e8cdc28d65b..18865f014f7 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.create_task.js @@ -29,24 +29,24 @@ function main(parent, task) { * Required. The task to add. * Task names have the following format: * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task [name][google.cloud.tasks.v2beta3.Task.name]. If a + * 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 + * 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]. + * 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 + * 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 @@ -55,20 +55,20 @@ function main(parent, task) { * uniform distribution of task ids to store and serve tasks * efficiently. */ - // const task = '' + // const task = {} /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all * information is retrieved by default because some data, such as * payloads, might be desirable to return only when needed because * of its large size or because of the sensitivity of data that it * contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta3.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -76,7 +76,7 @@ function main(parent, task) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function createTask() { + async function callCreateTask() { // Construct request const request = { parent, @@ -88,7 +88,7 @@ function main(parent, task) { console.log(response); } - createTask(); + callCreateTask(); // [END cloudtasks_v2beta3_generated_CloudTasks_CreateTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_queue.js index 02fda9f680f..eb3cb79e970 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function deleteQueue() { + async function callDeleteQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteQueue(); + callDeleteQueue(); // [END cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_task.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_task.js index ba2023fa256..05292ffe075 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.delete_task.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function deleteTask() { + async function callDeleteTask() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteTask(); + callDeleteTask(); // [END cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_iam_policy.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_iam_policy.js index 09374de9af0..23cb1e65fc5 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_iam_policy.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_iam_policy.js @@ -28,7 +28,7 @@ function main(resource) { * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. This field is only used by Cloud IAM. */ - // const options = '' + // const options = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -36,7 +36,7 @@ function main(resource) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getIamPolicy() { + async function callGetIamPolicy() { // Construct request const request = { resource, @@ -47,7 +47,7 @@ function main(resource) { console.log(response); } - getIamPolicy(); + callGetIamPolicy(); // [END cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_queue.js index 8a740e6bfb8..09d8f6873b9 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_queue.js @@ -27,10 +27,10 @@ function main(name) { /** * Optional. Read mask is used for a more granular control over what the API returns. * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * Queue.stats. Queue.stats will be returned only if it was explicitly * specified in the mask. */ - // const readMask = '' + // const readMask = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -38,7 +38,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getQueue() { + async function callGetQueue() { // Construct request const request = { name, @@ -49,7 +49,7 @@ function main(name) { console.log(response); } - getQueue(); + callGetQueue(); // [END cloudtasks_v2beta3_generated_CloudTasks_GetQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_task.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_task.js index af374a28029..43006a50241 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.get_task.js @@ -25,18 +25,18 @@ function main(name) { */ // const name = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all * information is retrieved by default because some data, such as * payloads, might be desirable to return only when needed because * of its large size or because of the sensitivity of data that it * contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta3.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -44,7 +44,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function getTask() { + async function callGetTask() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name) { console.log(response); } - getTask(); + callGetTask(); // [END cloudtasks_v2beta3_generated_CloudTasks_GetTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_queues.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_queues.js index eed1a9dc108..ba31a58af71 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_queues.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_queues.js @@ -25,12 +25,12 @@ function main(parent) { */ // const parent = 'abc123' /** - * `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2beta3.Queue] + * `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2beta3.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). + * 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. @@ -41,7 +41,7 @@ function main(parent) { * 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.v2beta3.ListQueuesResponse.next_page_token] in the + * next_page_token google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token in the * response to determine if more queues exist. */ // const pageSize = 1234 @@ -49,19 +49,19 @@ function main(parent) { * 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.v2beta3.ListQueuesResponse.next_page_token] returned - * from the previous call to [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] + * next_page_token google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token returned + * from the previous call to ListQueues google.cloud.tasks.v2beta3.CloudTasks.ListQueues * method. It is an error to switch the value of the - * [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while iterating through pages. + * filter google.cloud.tasks.v2beta3.ListQueuesRequest.filter while iterating through pages. */ // const pageToken = 'abc123' /** * Optional. Read mask is used for a more granular control over what the API returns. * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * Queue.stats. Queue.stats will be returned only if it was explicitly * specified in the mask. */ - // const readMask = '' + // const readMask = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -69,7 +69,7 @@ function main(parent) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function listQueues() { + async function callListQueues() { // Construct request const request = { parent, @@ -82,7 +82,7 @@ function main(parent) { } } - listQueues(); + callListQueues(); // [END cloudtasks_v2beta3_generated_CloudTasks_ListQueues_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_tasks.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_tasks.js index 3629389b5c4..df2845bded4 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_tasks.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.list_tasks.js @@ -25,22 +25,22 @@ function main(parent) { */ // const parent = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all * information is retrieved by default because some data, such as * payloads, might be desirable to return only when needed because * of its large size or because of the sensitivity of data that it * contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta3.Task resource. */ - // const responseView = '' + // const responseView = {} /** * Maximum page size. * Fewer tasks than requested might be returned, even if more tasks exist; use - * [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] in the response to + * next_page_token google.cloud.tasks.v2beta3.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. @@ -50,8 +50,8 @@ function main(parent) { * 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.v2beta3.ListTasksResponse.next_page_token] returned - * from the previous call to [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] + * next_page_token google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token returned + * from the previous call to ListTasks google.cloud.tasks.v2beta3.CloudTasks.ListTasks * method. * The page token is valid for only 2 hours. */ @@ -63,7 +63,7 @@ function main(parent) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function listTasks() { + async function callListTasks() { // Construct request const request = { parent, @@ -76,7 +76,7 @@ function main(parent) { } } - listTasks(); + callListTasks(); // [END cloudtasks_v2beta3_generated_CloudTasks_ListTasks_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.pause_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.pause_queue.js index 99c12a0314a..c20b7babb42 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.pause_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.pause_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function pauseQueue() { + async function callPauseQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - pauseQueue(); + callPauseQueue(); // [END cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.purge_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.purge_queue.js index b1029cdf918..4fafab8fd49 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.purge_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.purge_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function purgeQueue() { + async function callPurgeQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - purgeQueue(); + callPurgeQueue(); // [END cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.resume_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.resume_queue.js index e942aa19c86..3c8e3816e21 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.resume_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.resume_queue.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function resumeQueue() { + async function callResumeQueue() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - resumeQueue(); + callResumeQueue(); // [END cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.run_task.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.run_task.js index a1e2afd89b2..3657ca37f91 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.run_task.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.run_task.js @@ -25,18 +25,18 @@ function main(name) { */ // const name = 'abc123' /** - * The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be + * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be * returned. - * By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all + * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all * information is retrieved by default because some data, such as * payloads, might be desirable to return only when needed because * of its large size or because of the sensitivity of data that it * contains. - * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. + * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires + * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) + * permission on the Task google.cloud.tasks.v2beta3.Task resource. */ - // const responseView = '' + // const responseView = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -44,7 +44,7 @@ function main(name) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function runTask() { + async function callRunTask() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name) { console.log(response); } - runTask(); + callRunTask(); // [END cloudtasks_v2beta3_generated_CloudTasks_RunTask_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.set_iam_policy.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.set_iam_policy.js index d7a1c1283c2..025fa8183d3 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.set_iam_policy.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.set_iam_policy.js @@ -30,7 +30,7 @@ function main(resource, policy) { * valid policy but certain Cloud Platform services (such as Projects) * might reject them. */ - // const policy = '' + // const policy = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -38,7 +38,7 @@ function main(resource, policy) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function setIamPolicy() { + async function callSetIamPolicy() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, policy) { console.log(response); } - setIamPolicy(); + callSetIamPolicy(); // [END cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js index 750db2295a1..80856201121 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js @@ -28,7 +28,7 @@ function main(resource, permissions) { * 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). + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). */ // const permissions = 'abc123' @@ -38,7 +38,7 @@ function main(resource, permissions) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function testIamPermissions() { + async function callTestIamPermissions() { // Construct request const request = { resource, @@ -50,7 +50,7 @@ function main(resource, permissions) { console.log(response); } - testIamPermissions(); + callTestIamPermissions(); // [END cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_async] } diff --git a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.update_queue.js b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.update_queue.js index ad5c2c3f090..a569c8c1270 100644 --- a/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.update_queue.js +++ b/packages/google-cloud-tasks/samples/generated/v2beta3/cloud_tasks.update_queue.js @@ -21,17 +21,17 @@ function main(queue) { */ /** * Required. The queue to create or update. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be specified. + * The queue's name google.cloud.tasks.v2beta3.Queue.name must be specified. * Output only fields cannot be modified using UpdateQueue. * Any value specified for an output only field will be ignored. - * The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be changed. + * The queue's name google.cloud.tasks.v2beta3.Queue.name cannot be changed. */ - // const queue = '' + // 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 = '' + // const updateMask = {} // Imports the Tasks library const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; @@ -39,7 +39,7 @@ function main(queue) { // Instantiates a client const tasksClient = new CloudTasksClient(); - async function updateQueue() { + async function callUpdateQueue() { // Construct request const request = { queue, @@ -50,7 +50,7 @@ function main(queue) { console.log(response); } - updateQueue(); + callUpdateQueue(); // [END cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_async] } diff --git a/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts index 5cf3c78d073..4cd012674d7 100644 --- a/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts @@ -343,6 +343,24 @@ export class CloudTasksClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets a queue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/cloud_tasks.get_queue.js + * region_tag:cloudtasks_v2_generated_CloudTasks_GetQueue_async + */ getQueue( request?: protos.google.cloud.tasks.v2.IGetQueueRequest, options?: CallOptions @@ -370,24 +388,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * Gets a queue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getQueue(request); - */ getQueue( request?: protos.google.cloud.tasks.v2.IGetQueueRequest, optionsOrCallback?: @@ -427,33 +427,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.getQueue(request, options, callback); } - 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 - ] - >; - 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; - 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; /** * Creates a queue. * @@ -488,9 +461,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createQueue(request); + * @example include:samples/generated/v2/cloud_tasks.create_queue.js + * region_tag:cloudtasks_v2_generated_CloudTasks_CreateQueue_async */ + 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 + ] + >; + 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; + 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; createQueue( request?: protos.google.cloud.tasks.v2.ICreateQueueRequest, optionsOrCallback?: @@ -530,33 +530,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.createQueue(request, options, callback); } - 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 - ] - >; - 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; - 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; /** * Updates a queue. * @@ -595,9 +568,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.updateQueue(request); + * @example include:samples/generated/v2/cloud_tasks.update_queue.js + * region_tag:cloudtasks_v2_generated_CloudTasks_UpdateQueue_async */ + 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 + ] + >; + 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; + 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; updateQueue( request?: protos.google.cloud.tasks.v2.IUpdateQueueRequest, optionsOrCallback?: @@ -637,33 +637,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.updateQueue(request, options, callback); } - deleteQueue( - request?: protos.google.cloud.tasks.v2.IDeleteQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteQueueRequest | undefined, - {} | undefined - ] - >; - 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; - 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; /** * Deletes a queue. * @@ -691,9 +664,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.deleteQueue(request); + * @example include:samples/generated/v2/cloud_tasks.delete_queue.js + * region_tag:cloudtasks_v2_generated_CloudTasks_DeleteQueue_async */ + deleteQueue( + request?: protos.google.cloud.tasks.v2.IDeleteQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2.IDeleteQueueRequest | undefined, + {} | undefined + ] + >; + 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; + 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; deleteQueue( request?: protos.google.cloud.tasks.v2.IDeleteQueueRequest, optionsOrCallback?: @@ -733,6 +733,29 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.deleteQueue(request, options, callback); } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/cloud_tasks.purge_queue.js + * region_tag:cloudtasks_v2_generated_CloudTasks_PurgeQueue_async + */ purgeQueue( request?: protos.google.cloud.tasks.v2.IPurgeQueueRequest, options?: CallOptions @@ -760,29 +783,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.purgeQueue(request); - */ purgeQueue( request?: protos.google.cloud.tasks.v2.IPurgeQueueRequest, optionsOrCallback?: @@ -822,33 +822,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.purgeQueue(request, options, callback); } - 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 - ] - >; - 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; - 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; /** * Pauses the queue. * @@ -870,9 +843,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.pauseQueue(request); + * @example include:samples/generated/v2/cloud_tasks.pause_queue.js + * region_tag:cloudtasks_v2_generated_CloudTasks_PauseQueue_async */ + 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 + ] + >; + 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; + 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; pauseQueue( request?: protos.google.cloud.tasks.v2.IPauseQueueRequest, optionsOrCallback?: @@ -912,33 +912,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.pauseQueue(request, options, callback); } - 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 - ] - >; - 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; - 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; /** * Resume a queue. * @@ -966,9 +939,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.resumeQueue(request); + * @example include:samples/generated/v2/cloud_tasks.resume_queue.js + * region_tag:cloudtasks_v2_generated_CloudTasks_ResumeQueue_async */ + 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 + ] + >; + 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; + 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; resumeQueue( request?: protos.google.cloud.tasks.v2.IResumeQueueRequest, optionsOrCallback?: @@ -1008,33 +1008,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.resumeQueue(request, options, callback); } - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined - ] - >; - 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; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Gets the access control policy for a {@link google.cloud.tasks.v2.Queue|Queue}. * Returns an empty policy if the resource exists and does not have a policy @@ -1061,9 +1034,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.getIamPolicy(request); + * @example include:samples/generated/v2/cloud_tasks.get_iam_policy.js + * region_tag:cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + 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; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: @@ -1103,33 +1103,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined - ] - >; - 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; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Sets the access control policy for a {@link google.cloud.tasks.v2.Queue|Queue}. Replaces any existing * policy. @@ -1160,9 +1133,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.setIamPolicy(request); + * @example include:samples/generated/v2/cloud_tasks.set_iam_policy.js + * region_tag:cloudtasks_v2_generated_CloudTasks_SetIamPolicy_async */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + 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; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: @@ -1202,33 +1202,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined - ] - >; - 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; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Returns permissions that a caller has on a {@link google.cloud.tasks.v2.Queue|Queue}. * If the resource does not exist, this will return an empty set of @@ -1255,9 +1228,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.testIamPermissions(request); + * @example include:samples/generated/v2/cloud_tasks.test_iam_permissions.js + * region_tag:cloudtasks_v2_generated_CloudTasks_TestIamPermissions_async */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + 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; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: @@ -1297,33 +1297,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } - 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 - ] - >; - 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; - 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; /** * Gets a task. * @@ -1352,75 +1325,75 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.getTask(request); + * @example include:samples/generated/v2/cloud_tasks.get_task.js + * region_tag:cloudtasks_v2_generated_CloudTasks_GetTask_async */ getTask( request?: protos.google.cloud.tasks.v2.IGetTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | undefined, - {} | undefined - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - name: request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); - } - createTask( - request?: protos.google.cloud.tasks.v2.ICreateTaskRequest, options?: CallOptions ): Promise< [ protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | undefined, + protos.google.cloud.tasks.v2.IGetTaskRequest | undefined, {} | undefined ] >; - createTask( - request: protos.google.cloud.tasks.v2.ICreateTaskRequest, + getTask( + request: protos.google.cloud.tasks.v2.IGetTaskRequest, options: CallOptions, callback: Callback< protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, + protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, {} | null | undefined > ): void; - createTask( - request: protos.google.cloud.tasks.v2.ICreateTaskRequest, + getTask( + request: protos.google.cloud.tasks.v2.IGetTaskRequest, callback: Callback< protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, + protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, {} | null | undefined > ): void; + getTask( + request?: protos.google.cloud.tasks.v2.IGetTaskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.tasks.v2.ITask, + protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.tasks.v2.ITask, + protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.tasks.v2.ITask, + protos.google.cloud.tasks.v2.IGetTaskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTask(request, options, callback); + } /** * Creates a task and adds it to a queue. * @@ -1489,9 +1462,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createTask(request); + * @example include:samples/generated/v2/cloud_tasks.create_task.js + * region_tag:cloudtasks_v2_generated_CloudTasks_CreateTask_async */ + 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 + ] + >; + 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; + 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; createTask( request?: protos.google.cloud.tasks.v2.ICreateTaskRequest, optionsOrCallback?: @@ -1531,6 +1531,28 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.createTask(request, options, callback); } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/cloud_tasks.delete_task.js + * region_tag:cloudtasks_v2_generated_CloudTasks_DeleteTask_async + */ deleteTask( request?: protos.google.cloud.tasks.v2.IDeleteTaskRequest, options?: CallOptions @@ -1558,28 +1580,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteTask(request); - */ deleteTask( request?: protos.google.cloud.tasks.v2.IDeleteTaskRequest, optionsOrCallback?: @@ -1619,33 +1619,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.deleteTask(request, options, callback); } - 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 - ] - >; - 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; - 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; /** * Forces a task to run now. * @@ -1697,9 +1670,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.runTask(request); + * @example include:samples/generated/v2/cloud_tasks.run_task.js + * region_tag:cloudtasks_v2_generated_CloudTasks_RunTask_async */ + 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 + ] + >; + 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; + 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; runTask( request?: protos.google.cloud.tasks.v2.IRunTaskRequest, optionsOrCallback?: @@ -1740,33 +1740,6 @@ export class CloudTasksClient { return this.innerApiCalls.runTask(request, options, callback); } - 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 - ] - >; - 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; - 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; /** * Lists queues. * @@ -1819,6 +1792,33 @@ export class CloudTasksClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + 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 + ] + >; + 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; + 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; listQueues( request?: protos.google.cloud.tasks.v2.IListQueuesRequest, optionsOrCallback?: @@ -1977,11 +1977,8 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listQueuesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/cloud_tasks.list_queues.js + * region_tag:cloudtasks_v2_generated_CloudTasks_ListQueues_async */ listQueuesAsync( request?: protos.google.cloud.tasks.v2.IListQueuesRequest, @@ -1995,7 +1992,6 @@ export class CloudTasksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listQueues']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2005,33 +2001,6 @@ export class CloudTasksClient { callSettings ) as AsyncIterable; } - 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 - ] - >; - 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; - 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; /** * Lists the tasks in a queue. * @@ -2093,6 +2062,33 @@ export class CloudTasksClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + 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 + ] + >; + 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; + 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; listTasks( request?: protos.google.cloud.tasks.v2.IListTasksRequest, optionsOrCallback?: @@ -2257,11 +2253,8 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listTasksAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/cloud_tasks.list_tasks.js + * region_tag:cloudtasks_v2_generated_CloudTasks_ListTasks_async */ listTasksAsync( request?: protos.google.cloud.tasks.v2.IListTasksRequest, @@ -2275,7 +2268,6 @@ export class CloudTasksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts index 76aa15c45f5..9ffe57648d3 100644 --- a/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts @@ -347,6 +347,29 @@ export class CloudTasksClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets a queue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Read mask is used for a more granular control over what the API returns. + * If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta2.Queue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta2/cloud_tasks.get_queue.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_GetQueue_async + */ getQueue( request?: protos.google.cloud.tasks.v2beta2.IGetQueueRequest, options?: CallOptions @@ -374,29 +397,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * Gets a queue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getQueue(request); - */ getQueue( request?: protos.google.cloud.tasks.v2beta2.IGetQueueRequest, optionsOrCallback?: @@ -436,33 +436,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.getQueue(request, options, callback); } - createQueue( - request?: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | undefined, - {} | undefined - ] - >; - createQueue( - request: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Creates a queue. * @@ -497,9 +470,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createQueue(request); + * @example include:samples/generated/v2beta2/cloud_tasks.create_queue.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_async */ + createQueue( + request?: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | undefined, + {} | undefined + ] + >; + createQueue( + request: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + createQueue( + request: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; createQueue( request?: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, optionsOrCallback?: @@ -541,33 +541,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.createQueue(request, options, callback); } - updateQueue( - request?: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | undefined, - {} | undefined - ] - >; - updateQueue( - request: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Updates a queue. * @@ -606,9 +579,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.updateQueue(request); + * @example include:samples/generated/v2beta2/cloud_tasks.update_queue.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_async */ + updateQueue( + request?: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | undefined, + {} | undefined + ] + >; + updateQueue( + request: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + updateQueue( + request: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; updateQueue( request?: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, optionsOrCallback?: @@ -650,33 +650,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.updateQueue(request, options, callback); } - deleteQueue( - request?: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | undefined, - {} | undefined - ] - >; - deleteQueue( - request: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Deletes a queue. * @@ -704,9 +677,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.deleteQueue(request); + * @example include:samples/generated/v2beta2/cloud_tasks.delete_queue.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_async */ + deleteQueue( + request?: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | undefined, + {} | undefined + ] + >; + deleteQueue( + request: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteQueue( + request: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | null | undefined, + {} | null | undefined + > + ): void; deleteQueue( request?: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, optionsOrCallback?: @@ -748,6 +748,29 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.deleteQueue(request, options, callback); } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta2.Queue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta2/cloud_tasks.purge_queue.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_async + */ purgeQueue( request?: protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest, options?: CallOptions @@ -775,29 +798,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.purgeQueue(request); - */ purgeQueue( request?: protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest, optionsOrCallback?: @@ -839,33 +839,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.purgeQueue(request, options, callback); } - pauseQueue( - request?: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | undefined, - {} | undefined - ] - >; - pauseQueue( - request: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Pauses the queue. * @@ -887,9 +860,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.pauseQueue(request); + * @example include:samples/generated/v2beta2/cloud_tasks.pause_queue.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_async */ + pauseQueue( + request?: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | undefined, + {} | undefined + ] + >; + pauseQueue( + request: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + pauseQueue( + request: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | null | undefined, + {} | null | undefined + > + ): void; pauseQueue( request?: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, optionsOrCallback?: @@ -931,33 +931,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.pauseQueue(request, options, callback); } - resumeQueue( - request?: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | undefined, - {} | undefined - ] - >; - resumeQueue( - request: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Resume a queue. * @@ -985,9 +958,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.resumeQueue(request); + * @example include:samples/generated/v2beta2/cloud_tasks.resume_queue.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_async */ + resumeQueue( + request?: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | undefined, + {} | undefined + ] + >; + resumeQueue( + request: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + resumeQueue( + request: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.IQueue, + protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | null | undefined, + {} | null | undefined + > + ): void; resumeQueue( request?: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, optionsOrCallback?: @@ -1029,33 +1029,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.resumeQueue(request, options, callback); } - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined - ] - >; - 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; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Gets the access control policy for a {@link google.cloud.tasks.v2beta2.Queue|Queue}. * Returns an empty policy if the resource exists and does not have a policy @@ -1082,9 +1055,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.getIamPolicy(request); + * @example include:samples/generated/v2beta2/cloud_tasks.get_iam_policy.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_async */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + 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; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: @@ -1124,33 +1124,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined - ] - >; - 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; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Sets the access control policy for a {@link google.cloud.tasks.v2beta2.Queue|Queue}. Replaces any existing * policy. @@ -1181,9 +1154,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.setIamPolicy(request); + * @example include:samples/generated/v2beta2/cloud_tasks.set_iam_policy.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_async */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + 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; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: @@ -1223,33 +1223,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined - ] - >; - 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; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Returns permissions that a caller has on a {@link google.cloud.tasks.v2beta2.Queue|Queue}. * If the resource does not exist, this will return an empty set of @@ -1276,9 +1249,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.testIamPermissions(request); + * @example include:samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_async */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + 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; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: @@ -1318,33 +1318,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } - getTask( - request?: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | undefined, - {} | undefined - ] - >; - getTask( - request: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Gets a task. * @@ -1373,9 +1346,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.getTask(request); + * @example include:samples/generated/v2beta2/cloud_tasks.get_task.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_GetTask_async */ + getTask( + request?: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IGetTaskRequest | undefined, + {} | undefined + ] + >; + getTask( + request: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, + {} | null | undefined + > + ): void; + getTask( + request: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, + {} | null | undefined + > + ): void; getTask( request?: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, optionsOrCallback?: @@ -1415,33 +1415,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.getTask(request, options, callback); } - createTask( - request?: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | undefined, - {} | undefined - ] - >; - createTask( - request: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - createTask( - request: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Creates a task and adds it to a queue. * @@ -1512,9 +1485,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createTask(request); + * @example include:samples/generated/v2beta2/cloud_tasks.create_task.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_CreateTask_async */ + createTask( + request?: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | undefined, + {} | undefined + ] + >; + createTask( + request: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | null | undefined, + {} | null | undefined + > + ): void; + createTask( + request: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | null | undefined, + {} | null | undefined + > + ): void; createTask( request?: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, optionsOrCallback?: @@ -1556,6 +1556,28 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.createTask(request, options, callback); } + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has completed successfully or permanently + * failed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta2/cloud_tasks.delete_task.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_async + */ deleteTask( request?: protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest, options?: CallOptions @@ -1583,28 +1605,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has completed successfully or permanently - * failed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteTask(request); - */ deleteTask( request?: protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest, optionsOrCallback?: @@ -1646,33 +1646,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.deleteTask(request, options, callback); } - leaseTasks( - request?: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | undefined, - {} | undefined - ] - >; - leaseTasks( - request: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | null | undefined, - {} | null | undefined - > - ): void; - leaseTasks( - request: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Leases tasks from a pull queue for * {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration|lease_duration}. @@ -1783,9 +1756,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.leaseTasks(request); + * @example include:samples/generated/v2beta2/cloud_tasks.lease_tasks.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_async */ + leaseTasks( + request?: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, + protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | undefined, + {} | undefined + ] + >; + leaseTasks( + request: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, + protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | null | undefined, + {} | null | undefined + > + ): void; + leaseTasks( + request: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, + protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | null | undefined, + {} | null | undefined + > + ): void; leaseTasks( request?: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, optionsOrCallback?: @@ -1827,37 +1827,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.leaseTasks(request, options, callback); } - acknowledgeTask( - request?: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest | undefined, - {} | undefined - ] - >; - acknowledgeTask( - request: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest - | null - | undefined, - {} | null | undefined - > - ): void; - acknowledgeTask( - request: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Acknowledges a pull task. * @@ -1891,9 +1860,40 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.acknowledgeTask(request); + * @example include:samples/generated/v2beta2/cloud_tasks.acknowledge_task.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_async */ + acknowledgeTask( + request?: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest | undefined, + {} | undefined + ] + >; + acknowledgeTask( + request: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + acknowledgeTask( + request: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest + | null + | undefined, + {} | null | undefined + > + ): void; acknowledgeTask( request?: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, optionsOrCallback?: @@ -1926,44 +1926,17 @@ export class CloudTasksClient { options = {}; } else { options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - name: request.name || '', - }); - this.initialize(); - return this.innerApiCalls.acknowledgeTask(request, options, callback); - } - renewLease( - request?: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | undefined, - {} | undefined - ] - >; - renewLease( - request: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; - renewLease( - request: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.acknowledgeTask(request, options, callback); + } /** * Renew the current lease of a pull task. * @@ -2008,9 +1981,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.renewLease(request); + * @example include:samples/generated/v2beta2/cloud_tasks.renew_lease.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_RenewLease_async */ + renewLease( + request?: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | undefined, + {} | undefined + ] + >; + renewLease( + request: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | null | undefined, + {} | null | undefined + > + ): void; + renewLease( + request: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | null | undefined, + {} | null | undefined + > + ): void; renewLease( request?: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, optionsOrCallback?: @@ -2052,33 +2052,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.renewLease(request, options, callback); } - cancelLease( - request?: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | undefined, - {} | undefined - ] - >; - cancelLease( - request: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; - cancelLease( - request: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Cancel a pull task's lease. * @@ -2118,9 +2091,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.cancelLease(request); + * @example include:samples/generated/v2beta2/cloud_tasks.cancel_lease.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_CancelLease_async */ + cancelLease( + request?: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | undefined, + {} | undefined + ] + >; + cancelLease( + request: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | null | undefined, + {} | null | undefined + > + ): void; + cancelLease( + request: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | null | undefined, + {} | null | undefined + > + ): void; cancelLease( request?: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, optionsOrCallback?: @@ -2162,33 +2162,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.cancelLease(request, options, callback); } - runTask( - request?: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | undefined, - {} | undefined - ] - >; - runTask( - request: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Forces a task to run now. * @@ -2243,9 +2216,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.runTask(request); + * @example include:samples/generated/v2beta2/cloud_tasks.run_task.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_RunTask_async */ + runTask( + request?: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IRunTaskRequest | undefined, + {} | undefined + ] + >; + runTask( + request: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, + {} | null | undefined + > + ): void; + runTask( + request: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta2.ITask, + protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, + {} | null | undefined + > + ): void; runTask( request?: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, optionsOrCallback?: @@ -2286,33 +2286,6 @@ export class CloudTasksClient { return this.innerApiCalls.runTask(request, options, callback); } - listQueues( - request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue[], - protos.google.cloud.tasks.v2beta2.IListQueuesRequest | null, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse - ] - >; - listQueues( - request: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.IQueue - > - ): void; - listQueues( - request: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.IQueue - > - ): void; /** * Lists queues. * @@ -2370,6 +2343,33 @@ export class CloudTasksClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listQueues( + request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.IQueue[], + protos.google.cloud.tasks.v2beta2.IListQueuesRequest | null, + protos.google.cloud.tasks.v2beta2.IListQueuesResponse + ] + >; + listQueues( + request: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta2.IListQueuesRequest, + protos.google.cloud.tasks.v2beta2.IListQueuesResponse | null | undefined, + protos.google.cloud.tasks.v2beta2.IQueue + > + ): void; + listQueues( + request: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta2.IListQueuesRequest, + protos.google.cloud.tasks.v2beta2.IListQueuesResponse | null | undefined, + protos.google.cloud.tasks.v2beta2.IQueue + > + ): void; listQueues( request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, optionsOrCallback?: @@ -2540,11 +2540,8 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listQueuesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta2/cloud_tasks.list_queues.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_ListQueues_async */ listQueuesAsync( request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, @@ -2558,7 +2555,6 @@ export class CloudTasksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listQueues']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2568,33 +2564,6 @@ export class CloudTasksClient { callSettings ) as AsyncIterable; } - listTasks( - request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask[], - protos.google.cloud.tasks.v2beta2.IListTasksRequest | null, - protos.google.cloud.tasks.v2beta2.IListTasksResponse - ] - >; - listTasks( - request: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListTasksRequest, - protos.google.cloud.tasks.v2beta2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.ITask - > - ): void; - listTasks( - request: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListTasksRequest, - protos.google.cloud.tasks.v2beta2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.ITask - > - ): void; /** * Lists the tasks in a queue. * @@ -2656,6 +2625,33 @@ export class CloudTasksClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listTasks( + request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta2.ITask[], + protos.google.cloud.tasks.v2beta2.IListTasksRequest | null, + protos.google.cloud.tasks.v2beta2.IListTasksResponse + ] + >; + listTasks( + request: protos.google.cloud.tasks.v2beta2.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta2.IListTasksRequest, + protos.google.cloud.tasks.v2beta2.IListTasksResponse | null | undefined, + protos.google.cloud.tasks.v2beta2.ITask + > + ): void; + listTasks( + request: protos.google.cloud.tasks.v2beta2.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta2.IListTasksRequest, + protos.google.cloud.tasks.v2beta2.IListTasksResponse | null | undefined, + protos.google.cloud.tasks.v2beta2.ITask + > + ): void; listTasks( request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, optionsOrCallback?: @@ -2822,11 +2818,8 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listTasksAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta2/cloud_tasks.list_tasks.js + * region_tag:cloudtasks_v2beta2_generated_CloudTasks_ListTasks_async */ listTasksAsync( request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, @@ -2840,7 +2833,6 @@ export class CloudTasksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts index cb14438b7d1..d2c90c9e176 100644 --- a/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts @@ -343,6 +343,29 @@ export class CloudTasksClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets a queue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Read mask is used for a more granular control over what the API returns. + * If the mask is not present all fields will be returned except + * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + * specified in the mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta3/cloud_tasks.get_queue.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_GetQueue_async + */ getQueue( request?: protos.google.cloud.tasks.v2beta3.IGetQueueRequest, options?: CallOptions @@ -370,29 +393,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * Gets a queue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getQueue(request); - */ getQueue( request?: protos.google.cloud.tasks.v2beta3.IGetQueueRequest, optionsOrCallback?: @@ -432,33 +432,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.getQueue(request, options, callback); } - createQueue( - request?: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | undefined, - {} | undefined - ] - >; - createQueue( - request: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Creates a queue. * @@ -493,9 +466,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createQueue(request); + * @example include:samples/generated/v2beta3/cloud_tasks.create_queue.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_async */ + createQueue( + request?: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | undefined, + {} | undefined + ] + >; + createQueue( + request: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + createQueue( + request: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; createQueue( request?: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, optionsOrCallback?: @@ -537,33 +537,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.createQueue(request, options, callback); } - updateQueue( - request?: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | undefined, - {} | undefined - ] - >; - updateQueue( - request: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Updates a queue. * @@ -602,9 +575,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.updateQueue(request); + * @example include:samples/generated/v2beta3/cloud_tasks.update_queue.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_async */ + updateQueue( + request?: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | undefined, + {} | undefined + ] + >; + updateQueue( + request: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + updateQueue( + request: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | null | undefined, + {} | null | undefined + > + ): void; updateQueue( request?: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, optionsOrCallback?: @@ -646,33 +646,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.updateQueue(request, options, callback); } - deleteQueue( - request?: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | undefined, - {} | undefined - ] - >; - deleteQueue( - request: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Deletes a queue. * @@ -700,9 +673,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.deleteQueue(request); + * @example include:samples/generated/v2beta3/cloud_tasks.delete_queue.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_async */ + deleteQueue( + request?: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | undefined, + {} | undefined + ] + >; + deleteQueue( + request: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteQueue( + request: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | null | undefined, + {} | null | undefined + > + ): void; deleteQueue( request?: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, optionsOrCallback?: @@ -744,6 +744,29 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.deleteQueue(request, options, callback); } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta3/cloud_tasks.purge_queue.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_async + */ purgeQueue( request?: protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest, options?: CallOptions @@ -771,29 +794,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.purgeQueue(request); - */ purgeQueue( request?: protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest, optionsOrCallback?: @@ -835,33 +835,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.purgeQueue(request, options, callback); } - pauseQueue( - request?: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | undefined, - {} | undefined - ] - >; - pauseQueue( - request: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Pauses the queue. * @@ -883,9 +856,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.pauseQueue(request); + * @example include:samples/generated/v2beta3/cloud_tasks.pause_queue.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_async */ + pauseQueue( + request?: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | undefined, + {} | undefined + ] + >; + pauseQueue( + request: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + pauseQueue( + request: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | null | undefined, + {} | null | undefined + > + ): void; pauseQueue( request?: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, optionsOrCallback?: @@ -927,33 +927,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.pauseQueue(request, options, callback); } - resumeQueue( - request?: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | undefined, - {} | undefined - ] - >; - resumeQueue( - request: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Resume a queue. * @@ -981,9 +954,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.resumeQueue(request); + * @example include:samples/generated/v2beta3/cloud_tasks.resume_queue.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_async */ + resumeQueue( + request?: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | undefined, + {} | undefined + ] + >; + resumeQueue( + request: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | null | undefined, + {} | null | undefined + > + ): void; + resumeQueue( + request: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta3.IQueue, + protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | null | undefined, + {} | null | undefined + > + ): void; resumeQueue( request?: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, optionsOrCallback?: @@ -1025,33 +1025,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.resumeQueue(request, options, callback); } - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined - ] - >; - 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; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Gets the access control policy for a {@link google.cloud.tasks.v2beta3.Queue|Queue}. * Returns an empty policy if the resource exists and does not have a policy @@ -1078,9 +1051,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.getIamPolicy(request); + * @example include:samples/generated/v2beta3/cloud_tasks.get_iam_policy.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_async */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + 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; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: @@ -1120,33 +1120,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined - ] - >; - 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; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Sets the access control policy for a {@link google.cloud.tasks.v2beta3.Queue|Queue}. Replaces any existing * policy. @@ -1177,9 +1150,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.setIamPolicy(request); + * @example include:samples/generated/v2beta3/cloud_tasks.set_iam_policy.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_async */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + 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; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: @@ -1219,33 +1219,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined - ] - >; - 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; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Returns permissions that a caller has on a {@link google.cloud.tasks.v2beta3.Queue|Queue}. * If the resource does not exist, this will return an empty set of @@ -1272,9 +1245,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.testIamPermissions(request); + * @example include:samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_async */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + 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; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: @@ -1314,33 +1314,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } - getTask( - request?: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | undefined, - {} | undefined - ] - >; - getTask( - request: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Gets a task. * @@ -1369,75 +1342,75 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.getTask(request); + * @example include:samples/generated/v2beta3/cloud_tasks.get_task.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_GetTask_async */ getTask( request?: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | undefined, - {} | undefined - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - name: request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); - } - createTask( - request?: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, options?: CallOptions ): Promise< [ protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | undefined, + protos.google.cloud.tasks.v2beta3.IGetTaskRequest | undefined, {} | undefined ] >; - createTask( - request: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, + getTask( + request: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, options: CallOptions, callback: Callback< protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | null | undefined, + protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, {} | null | undefined > ): void; - createTask( - request: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, + getTask( + request: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, callback: Callback< protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | null | undefined, + protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, {} | null | undefined > ): void; + getTask( + request?: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.IGetTaskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTask(request, options, callback); + } /** * Creates a task and adds it to a queue. * @@ -1506,9 +1479,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createTask(request); + * @example include:samples/generated/v2beta3/cloud_tasks.create_task.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_CreateTask_async */ + createTask( + request?: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | undefined, + {} | undefined + ] + >; + createTask( + request: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | null | undefined, + {} | null | undefined + > + ): void; + createTask( + request: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | null | undefined, + {} | null | undefined + > + ): void; createTask( request?: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, optionsOrCallback?: @@ -1550,6 +1550,28 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.createTask(request, options, callback); } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta3/cloud_tasks.delete_task.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_async + */ deleteTask( request?: protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest, options?: CallOptions @@ -1577,28 +1599,6 @@ export class CloudTasksClient { {} | null | undefined > ): void; - /** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteTask(request); - */ deleteTask( request?: protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest, optionsOrCallback?: @@ -1640,33 +1640,6 @@ export class CloudTasksClient { this.initialize(); return this.innerApiCalls.deleteTask(request, options, callback); } - runTask( - request?: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | undefined, - {} | undefined - ] - >; - runTask( - request: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Forces a task to run now. * @@ -1718,9 +1691,36 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.runTask(request); + * @example include:samples/generated/v2beta3/cloud_tasks.run_task.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_RunTask_async */ + runTask( + request?: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.IRunTaskRequest | undefined, + {} | undefined + ] + >; + runTask( + request: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, + {} | null | undefined + > + ): void; + runTask( + request: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, + callback: Callback< + protos.google.cloud.tasks.v2beta3.ITask, + protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, + {} | null | undefined + > + ): void; runTask( request?: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, optionsOrCallback?: @@ -1761,33 +1761,6 @@ export class CloudTasksClient { return this.innerApiCalls.runTask(request, options, callback); } - listQueues( - request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue[], - protos.google.cloud.tasks.v2beta3.IListQueuesRequest | null, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse - ] - >; - listQueues( - request: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.IQueue - > - ): void; - listQueues( - request: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.IQueue - > - ): void; /** * Lists queues. * @@ -1845,6 +1818,33 @@ export class CloudTasksClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listQueues( + request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.IQueue[], + protos.google.cloud.tasks.v2beta3.IListQueuesRequest | null, + protos.google.cloud.tasks.v2beta3.IListQueuesResponse + ] + >; + listQueues( + request: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta3.IListQueuesRequest, + protos.google.cloud.tasks.v2beta3.IListQueuesResponse | null | undefined, + protos.google.cloud.tasks.v2beta3.IQueue + > + ): void; + listQueues( + request: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta3.IListQueuesRequest, + protos.google.cloud.tasks.v2beta3.IListQueuesResponse | null | undefined, + protos.google.cloud.tasks.v2beta3.IQueue + > + ): void; listQueues( request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, optionsOrCallback?: @@ -2015,11 +2015,8 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listQueuesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta3/cloud_tasks.list_queues.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_ListQueues_async */ listQueuesAsync( request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, @@ -2033,7 +2030,6 @@ export class CloudTasksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listQueues']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2043,33 +2039,6 @@ export class CloudTasksClient { callSettings ) as AsyncIterable; } - listTasks( - request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask[], - protos.google.cloud.tasks.v2beta3.IListTasksRequest | null, - protos.google.cloud.tasks.v2beta3.IListTasksResponse - ] - >; - listTasks( - request: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListTasksRequest, - protos.google.cloud.tasks.v2beta3.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.ITask - > - ): void; - listTasks( - request: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListTasksRequest, - protos.google.cloud.tasks.v2beta3.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.ITask - > - ): void; /** * Lists the tasks in a queue. * @@ -2131,6 +2100,33 @@ export class CloudTasksClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listTasks( + request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.tasks.v2beta3.ITask[], + protos.google.cloud.tasks.v2beta3.IListTasksRequest | null, + protos.google.cloud.tasks.v2beta3.IListTasksResponse + ] + >; + listTasks( + request: protos.google.cloud.tasks.v2beta3.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta3.IListTasksRequest, + protos.google.cloud.tasks.v2beta3.IListTasksResponse | null | undefined, + protos.google.cloud.tasks.v2beta3.ITask + > + ): void; + listTasks( + request: protos.google.cloud.tasks.v2beta3.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.tasks.v2beta3.IListTasksRequest, + protos.google.cloud.tasks.v2beta3.IListTasksResponse | null | undefined, + protos.google.cloud.tasks.v2beta3.ITask + > + ): void; listTasks( request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, optionsOrCallback?: @@ -2297,11 +2293,8 @@ export class CloudTasksClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listTasksAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta3/cloud_tasks.list_tasks.js + * region_tag:cloudtasks_v2beta3_generated_CloudTasks_ListTasks_async */ listTasksAsync( request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, @@ -2315,7 +2308,6 @@ export class CloudTasksClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize();