diff --git a/packages/google-cloud-scheduler/linkinator.config.json b/packages/google-cloud-scheduler/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-scheduler/linkinator.config.json +++ b/packages/google-cloud-scheduler/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.create_job.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.create_job.js index ed83df06778..aed3b21ad17 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.create_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.create_job.js @@ -26,12 +26,12 @@ function main(parent, job) { // const parent = 'abc123' /** * Required. The job to add. The user can optionally specify a name for the - * job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an + * job in name google.cloud.scheduler.v1.Job.name. name google.cloud.scheduler.v1.Job.name cannot be the same as an * existing job. If a name is not specified then the system will * generate a random unique name that will be returned - * ([name][google.cloud.scheduler.v1.Job.name]) in the response. + * (name google.cloud.scheduler.v1.Job.name) in the response. */ - // const job = '' + // const job = {} // Imports the Scheduler library const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1; @@ -39,7 +39,7 @@ function main(parent, job) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function createJob() { + async function callCreateJob() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, job) { console.log(response); } - createJob(); + callCreateJob(); // [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.delete_job.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.delete_job.js index 78d9e1a2a80..135145cdc1e 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.delete_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.delete_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function deleteJob() { + async function callDeleteJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteJob(); + callDeleteJob(); // [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.get_job.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.get_job.js index 61d0888168d..8209818b3b3 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.get_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.get_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function getJob() { + async function callGetJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getJob(); + callGetJob(); // [END cloudscheduler_v1_generated_CloudScheduler_GetJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.list_jobs.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.list_jobs.js index e99d811780e..8902843967f 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.list_jobs.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.list_jobs.js @@ -36,10 +36,10 @@ function main(parent) { * A token identifying a page of results the server will 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.scheduler.v1.ListJobsResponse.next_page_token] returned from - * the previous call to [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an error to - * switch the value of [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - * [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while iterating through pages. + * next_page_token google.cloud.scheduler.v1.ListJobsResponse.next_page_token returned from + * the previous call to ListJobs google.cloud.scheduler.v1.CloudScheduler.ListJobs. It is an error to + * switch the value of filter google.cloud.scheduler.v1.ListJobsRequest.filter or + * order_by google.cloud.scheduler.v1.ListJobsRequest.order_by while iterating through pages. */ // const pageToken = 'abc123' @@ -49,7 +49,7 @@ function main(parent) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function listJobs() { + async function callListJobs() { // Construct request const request = { parent, @@ -62,7 +62,7 @@ function main(parent) { } } - listJobs(); + callListJobs(); // [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.pause_job.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.pause_job.js index 9069f850e21..8965e8aa5f6 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.pause_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.pause_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function pauseJob() { + async function callPauseJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - pauseJob(); + callPauseJob(); // [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.resume_job.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.resume_job.js index 681e54949e9..32b48fca9ca 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.resume_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.resume_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function resumeJob() { + async function callResumeJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - resumeJob(); + callResumeJob(); // [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.run_job.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.run_job.js index b9a2d6fccc2..52be57a8931 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.run_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.run_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function runJob() { + async function callRunJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - runJob(); + callRunJob(); // [END cloudscheduler_v1_generated_CloudScheduler_RunJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.update_job.js b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.update_job.js index 0504a4a6c84..190fd770c13 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.update_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1/cloud_scheduler.update_job.js @@ -20,15 +20,15 @@ function main(job, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The new job properties. [name][google.cloud.scheduler.v1.Job.name] must be specified. + * Required. The new job properties. name google.cloud.scheduler.v1.Job.name must be specified. * Output only fields cannot be modified using UpdateJob. * Any value specified for an output only field will be ignored. */ - // const job = '' + // const job = {} /** * A mask used to specify which fields of the job are being updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Scheduler library const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1; @@ -36,7 +36,7 @@ function main(job, updateMask) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function updateJob() { + async function callUpdateJob() { // Construct request const request = { job, @@ -48,7 +48,7 @@ function main(job, updateMask) { console.log(response); } - updateJob(); + callUpdateJob(); // [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.create_job.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.create_job.js index cff67fe2347..08e082fe89b 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.create_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.create_job.js @@ -26,12 +26,12 @@ function main(parent, job) { // const parent = 'abc123' /** * Required. The job to add. The user can optionally specify a name for the - * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an + * job in name google.cloud.scheduler.v1beta1.Job.name. name google.cloud.scheduler.v1beta1.Job.name cannot be the same as an * existing job. If a name is not specified then the system will * generate a random unique name that will be returned - * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response. + * (name google.cloud.scheduler.v1beta1.Job.name) in the response. */ - // const job = '' + // const job = {} // Imports the Scheduler library const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1; @@ -39,7 +39,7 @@ function main(parent, job) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function createJob() { + async function callCreateJob() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, job) { console.log(response); } - createJob(); + callCreateJob(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.delete_job.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.delete_job.js index 5e107e5608f..6920d1bfd76 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.delete_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.delete_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function deleteJob() { + async function callDeleteJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteJob(); + callDeleteJob(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.get_job.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.get_job.js index 7dd6fc11e04..0e7c4462e64 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.get_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.get_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function getJob() { + async function callGetJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getJob(); + callGetJob(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.list_jobs.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.list_jobs.js index 21596ee74ab..7cc51b55ce0 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.list_jobs.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.list_jobs.js @@ -36,10 +36,10 @@ function main(parent) { * A token identifying a page of results the server will 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.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from - * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to - * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or - * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages. + * next_page_token google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token returned from + * the previous call to ListJobs google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs. It is an error to + * switch the value of filter google.cloud.scheduler.v1beta1.ListJobsRequest.filter or + * order_by google.cloud.scheduler.v1beta1.ListJobsRequest.order_by while iterating through pages. */ // const pageToken = 'abc123' @@ -49,7 +49,7 @@ function main(parent) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function listJobs() { + async function callListJobs() { // Construct request const request = { parent, @@ -62,7 +62,7 @@ function main(parent) { } } - listJobs(); + callListJobs(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.pause_job.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.pause_job.js index 2a658b5cd49..28906922284 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.pause_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.pause_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function pauseJob() { + async function callPauseJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - pauseJob(); + callPauseJob(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.resume_job.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.resume_job.js index 320f49700ff..2ad40e7d3cd 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.resume_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.resume_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function resumeJob() { + async function callResumeJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - resumeJob(); + callResumeJob(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.run_job.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.run_job.js index cab58716d18..a56cdb3266f 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.run_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.run_job.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function runJob() { + async function callRunJob() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - runJob(); + callRunJob(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_async] } diff --git a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.update_job.js b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.update_job.js index 1f218004b9d..4d331a041f8 100644 --- a/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.update_job.js +++ b/packages/google-cloud-scheduler/samples/generated/v1beta1/cloud_scheduler.update_job.js @@ -20,15 +20,15 @@ function main(job) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified. + * Required. The new job properties. name google.cloud.scheduler.v1beta1.Job.name must be specified. * Output only fields cannot be modified using UpdateJob. * Any value specified for an output only field will be ignored. */ - // const job = '' + // const job = {} /** * A mask used to specify which fields of the job are being updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Scheduler library const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1; @@ -36,7 +36,7 @@ function main(job) { // Instantiates a client const schedulerClient = new CloudSchedulerClient(); - async function updateJob() { + async function callUpdateJob() { // Construct request const request = { job, @@ -47,7 +47,7 @@ function main(job) { console.log(response); } - updateJob(); + callUpdateJob(); // [END cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_async] } diff --git a/packages/google-cloud-scheduler/src/v1/cloud_scheduler_client.ts b/packages/google-cloud-scheduler/src/v1/cloud_scheduler_client.ts index 1032659be58..9a1a9c72d97 100644 --- a/packages/google-cloud-scheduler/src/v1/cloud_scheduler_client.ts +++ b/packages/google-cloud-scheduler/src/v1/cloud_scheduler_client.ts @@ -327,6 +327,24 @@ export class CloudSchedulerClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. + * 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/v1/cloud_scheduler.get_job.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_GetJob_async + */ getJob( request?: protos.google.cloud.scheduler.v1.IGetJobRequest, options?: CallOptions @@ -354,24 +372,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Gets a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. - * 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.getJob(request); - */ getJob( request?: protos.google.cloud.scheduler.v1.IGetJobRequest, optionsOrCallback?: @@ -411,6 +411,30 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.getJob(request, options, callback); } + /** + * Creates a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * @param {google.cloud.scheduler.v1.Job} request.job + * Required. The job to add. The user can optionally specify a name for the + * job in {@link google.cloud.scheduler.v1.Job.name|name}. {@link google.cloud.scheduler.v1.Job.name|name} cannot be the same as an + * existing job. If a name is not specified then the system will + * generate a random unique name that will be returned + * ({@link google.cloud.scheduler.v1.Job.name|name}) in the response. + * @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 [Job]{@link google.cloud.scheduler.v1.Job}. + * 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/v1/cloud_scheduler.create_job.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_CreateJob_async + */ createJob( request?: protos.google.cloud.scheduler.v1.ICreateJobRequest, options?: CallOptions @@ -438,30 +462,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Creates a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * @param {google.cloud.scheduler.v1.Job} request.job - * Required. The job to add. The user can optionally specify a name for the - * job in {@link google.cloud.scheduler.v1.Job.name|name}. {@link google.cloud.scheduler.v1.Job.name|name} cannot be the same as an - * existing job. If a name is not specified then the system will - * generate a random unique name that will be returned - * ({@link google.cloud.scheduler.v1.Job.name|name}) in the response. - * @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 [Job]{@link google.cloud.scheduler.v1.Job}. - * 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.createJob(request); - */ createJob( request?: protos.google.cloud.scheduler.v1.ICreateJobRequest, optionsOrCallback?: @@ -501,33 +501,6 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.createJob(request, options, callback); } - updateJob( - request?: protos.google.cloud.scheduler.v1.IUpdateJobRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.scheduler.v1.IJob, - protos.google.cloud.scheduler.v1.IUpdateJobRequest | undefined, - {} | undefined - ] - >; - updateJob( - request: protos.google.cloud.scheduler.v1.IUpdateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.scheduler.v1.IJob, - protos.google.cloud.scheduler.v1.IUpdateJobRequest | null | undefined, - {} | null | undefined - > - ): void; - updateJob( - request: protos.google.cloud.scheduler.v1.IUpdateJobRequest, - callback: Callback< - protos.google.cloud.scheduler.v1.IJob, - protos.google.cloud.scheduler.v1.IUpdateJobRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Updates a job. * @@ -555,9 +528,36 @@ export class CloudSchedulerClient { * 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.updateJob(request); + * @example include:samples/generated/v1/cloud_scheduler.update_job.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_UpdateJob_async */ + updateJob( + request?: protos.google.cloud.scheduler.v1.IUpdateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.scheduler.v1.IJob, + protos.google.cloud.scheduler.v1.IUpdateJobRequest | undefined, + {} | undefined + ] + >; + updateJob( + request: protos.google.cloud.scheduler.v1.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.scheduler.v1.IJob, + protos.google.cloud.scheduler.v1.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + updateJob( + request: protos.google.cloud.scheduler.v1.IUpdateJobRequest, + callback: Callback< + protos.google.cloud.scheduler.v1.IJob, + protos.google.cloud.scheduler.v1.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; updateJob( request?: protos.google.cloud.scheduler.v1.IUpdateJobRequest, optionsOrCallback?: @@ -597,6 +597,24 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.updateJob(request, options, callback); } + /** + * Deletes a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/v1/cloud_scheduler.delete_job.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_DeleteJob_async + */ deleteJob( request?: protos.google.cloud.scheduler.v1.IDeleteJobRequest, options?: CallOptions @@ -624,24 +642,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Deletes a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.deleteJob(request); - */ deleteJob( request?: protos.google.cloud.scheduler.v1.IDeleteJobRequest, optionsOrCallback?: @@ -681,6 +681,30 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.deleteJob(request, options, callback); } + /** + * Pauses a job. + * + * If a job is paused then the system will stop executing the job + * until it is re-enabled via {@link google.cloud.scheduler.v1.CloudScheduler.ResumeJob|ResumeJob}. The + * state of the job is stored in {@link google.cloud.scheduler.v1.Job.state|state}; if paused it + * will be set to {@link google.cloud.scheduler.v1.Job.State.PAUSED|Job.State.PAUSED}. A job must be in {@link google.cloud.scheduler.v1.Job.State.ENABLED|Job.State.ENABLED} + * to be paused. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. + * 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/v1/cloud_scheduler.pause_job.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_PauseJob_async + */ pauseJob( request?: protos.google.cloud.scheduler.v1.IPauseJobRequest, options?: CallOptions @@ -708,30 +732,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Pauses a job. - * - * If a job is paused then the system will stop executing the job - * until it is re-enabled via {@link google.cloud.scheduler.v1.CloudScheduler.ResumeJob|ResumeJob}. The - * state of the job is stored in {@link google.cloud.scheduler.v1.Job.state|state}; if paused it - * will be set to {@link google.cloud.scheduler.v1.Job.State.PAUSED|Job.State.PAUSED}. A job must be in {@link google.cloud.scheduler.v1.Job.State.ENABLED|Job.State.ENABLED} - * to be paused. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. - * 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.pauseJob(request); - */ pauseJob( request?: protos.google.cloud.scheduler.v1.IPauseJobRequest, optionsOrCallback?: @@ -771,6 +771,29 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.pauseJob(request, options, callback); } + /** + * Resume a job. + * + * This method reenables a job after it has been {@link google.cloud.scheduler.v1.Job.State.PAUSED|Job.State.PAUSED}. The + * state of a job is stored in {@link google.cloud.scheduler.v1.Job.state|Job.state}; after calling this method it + * will be set to {@link google.cloud.scheduler.v1.Job.State.ENABLED|Job.State.ENABLED}. A job must be in + * {@link google.cloud.scheduler.v1.Job.State.PAUSED|Job.State.PAUSED} to be resumed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. + * 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/v1/cloud_scheduler.resume_job.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_ResumeJob_async + */ resumeJob( request?: protos.google.cloud.scheduler.v1.IResumeJobRequest, options?: CallOptions @@ -798,29 +821,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Resume a job. - * - * This method reenables a job after it has been {@link google.cloud.scheduler.v1.Job.State.PAUSED|Job.State.PAUSED}. The - * state of a job is stored in {@link google.cloud.scheduler.v1.Job.state|Job.state}; after calling this method it - * will be set to {@link google.cloud.scheduler.v1.Job.State.ENABLED|Job.State.ENABLED}. A job must be in - * {@link google.cloud.scheduler.v1.Job.State.PAUSED|Job.State.PAUSED} to be resumed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. - * 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.resumeJob(request); - */ resumeJob( request?: protos.google.cloud.scheduler.v1.IResumeJobRequest, optionsOrCallback?: @@ -860,6 +860,27 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.resumeJob(request, options, callback); } + /** + * Forces a job to run now. + * + * When this method is called, Cloud Scheduler will dispatch the job, even + * if the job is already running. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. + * 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/v1/cloud_scheduler.run_job.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_RunJob_async + */ runJob( request?: protos.google.cloud.scheduler.v1.IRunJobRequest, options?: CallOptions @@ -887,27 +908,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Forces a job to run now. - * - * When this method is called, Cloud Scheduler will dispatch the job, even - * if the job is already running. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1.Job}. - * 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.runJob(request); - */ runJob( request?: protos.google.cloud.scheduler.v1.IRunJobRequest, optionsOrCallback?: @@ -948,33 +948,6 @@ export class CloudSchedulerClient { return this.innerApiCalls.runJob(request, options, callback); } - listJobs( - request?: protos.google.cloud.scheduler.v1.IListJobsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.scheduler.v1.IJob[], - protos.google.cloud.scheduler.v1.IListJobsRequest | null, - protos.google.cloud.scheduler.v1.IListJobsResponse - ] - >; - listJobs( - request: protos.google.cloud.scheduler.v1.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.scheduler.v1.IListJobsRequest, - protos.google.cloud.scheduler.v1.IListJobsResponse | null | undefined, - protos.google.cloud.scheduler.v1.IJob - > - ): void; - listJobs( - request: protos.google.cloud.scheduler.v1.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.scheduler.v1.IListJobsRequest, - protos.google.cloud.scheduler.v1.IListJobsResponse | null | undefined, - protos.google.cloud.scheduler.v1.IJob - > - ): void; /** * Lists jobs. * @@ -1011,6 +984,33 @@ export class CloudSchedulerClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listJobs( + request?: protos.google.cloud.scheduler.v1.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.scheduler.v1.IJob[], + protos.google.cloud.scheduler.v1.IListJobsRequest | null, + protos.google.cloud.scheduler.v1.IListJobsResponse + ] + >; + listJobs( + request: protos.google.cloud.scheduler.v1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.scheduler.v1.IListJobsRequest, + protos.google.cloud.scheduler.v1.IListJobsResponse | null | undefined, + protos.google.cloud.scheduler.v1.IJob + > + ): void; + listJobs( + request: protos.google.cloud.scheduler.v1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.scheduler.v1.IListJobsRequest, + protos.google.cloud.scheduler.v1.IListJobsResponse | null | undefined, + protos.google.cloud.scheduler.v1.IJob + > + ): void; listJobs( request?: protos.google.cloud.scheduler.v1.IListJobsRequest, optionsOrCallback?: @@ -1141,11 +1141,8 @@ export class CloudSchedulerClient { * 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.listJobsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/cloud_scheduler.list_jobs.js + * region_tag:cloudscheduler_v1_generated_CloudScheduler_ListJobs_async */ listJobsAsync( request?: protos.google.cloud.scheduler.v1.IListJobsRequest, @@ -1159,7 +1156,6 @@ export class CloudSchedulerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-scheduler/src/v1beta1/cloud_scheduler_client.ts b/packages/google-cloud-scheduler/src/v1beta1/cloud_scheduler_client.ts index 43428a8c75a..b49d7c29985 100644 --- a/packages/google-cloud-scheduler/src/v1beta1/cloud_scheduler_client.ts +++ b/packages/google-cloud-scheduler/src/v1beta1/cloud_scheduler_client.ts @@ -327,6 +327,24 @@ export class CloudSchedulerClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. + * 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/v1beta1/cloud_scheduler.get_job.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_async + */ getJob( request?: protos.google.cloud.scheduler.v1beta1.IGetJobRequest, options?: CallOptions @@ -354,24 +372,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Gets a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. - * 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.getJob(request); - */ getJob( request?: protos.google.cloud.scheduler.v1beta1.IGetJobRequest, optionsOrCallback?: @@ -413,6 +413,30 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.getJob(request, options, callback); } + /** + * Creates a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID`. + * @param {google.cloud.scheduler.v1beta1.Job} request.job + * Required. The job to add. The user can optionally specify a name for the + * job in {@link google.cloud.scheduler.v1beta1.Job.name|name}. {@link google.cloud.scheduler.v1beta1.Job.name|name} cannot be the same as an + * existing job. If a name is not specified then the system will + * generate a random unique name that will be returned + * ({@link google.cloud.scheduler.v1beta1.Job.name|name}) in the response. + * @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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. + * 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/v1beta1/cloud_scheduler.create_job.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_async + */ createJob( request?: protos.google.cloud.scheduler.v1beta1.ICreateJobRequest, options?: CallOptions @@ -444,30 +468,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Creates a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID`. - * @param {google.cloud.scheduler.v1beta1.Job} request.job - * Required. The job to add. The user can optionally specify a name for the - * job in {@link google.cloud.scheduler.v1beta1.Job.name|name}. {@link google.cloud.scheduler.v1beta1.Job.name|name} cannot be the same as an - * existing job. If a name is not specified then the system will - * generate a random unique name that will be returned - * ({@link google.cloud.scheduler.v1beta1.Job.name|name}) in the response. - * @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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. - * 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.createJob(request); - */ createJob( request?: protos.google.cloud.scheduler.v1beta1.ICreateJobRequest, optionsOrCallback?: @@ -511,6 +511,36 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.createJob(request, options, callback); } + /** + * Updates a job. + * + * If successful, the updated {@link google.cloud.scheduler.v1beta1.Job|Job} is returned. If the job does + * not exist, `NOT_FOUND` is returned. + * + * If UpdateJob does not successfully return, it is possible for the + * job to be in an {@link google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED|Job.State.UPDATE_FAILED} state. A job in this state may + * not be executed. If this happens, retry the UpdateJob request + * until a successful response is received. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.scheduler.v1beta1.Job} request.job + * Required. The new job properties. {@link google.cloud.scheduler.v1beta1.Job.name|name} must be specified. + * + * Output only fields cannot be modified using UpdateJob. + * Any value specified for an output only field will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * A mask used to specify which fields of the job are being updated. + * @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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. + * 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/v1beta1/cloud_scheduler.update_job.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_async + */ updateJob( request?: protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest, options?: CallOptions @@ -542,36 +572,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Updates a job. - * - * If successful, the updated {@link google.cloud.scheduler.v1beta1.Job|Job} is returned. If the job does - * not exist, `NOT_FOUND` is returned. - * - * If UpdateJob does not successfully return, it is possible for the - * job to be in an {@link google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED|Job.State.UPDATE_FAILED} state. A job in this state may - * not be executed. If this happens, retry the UpdateJob request - * until a successful response is received. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.scheduler.v1beta1.Job} request.job - * Required. The new job properties. {@link google.cloud.scheduler.v1beta1.Job.name|name} must be specified. - * - * Output only fields cannot be modified using UpdateJob. - * Any value specified for an output only field will be ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * A mask used to specify which fields of the job are being updated. - * @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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. - * 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.updateJob(request); - */ updateJob( request?: protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest, optionsOrCallback?: @@ -615,6 +615,24 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.updateJob(request, options, callback); } + /** + * Deletes a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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/v1beta1/cloud_scheduler.delete_job.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_async + */ deleteJob( request?: protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest, options?: CallOptions @@ -646,24 +664,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Deletes a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.deleteJob(request); - */ deleteJob( request?: protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest, optionsOrCallback?: @@ -707,6 +707,30 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.deleteJob(request, options, callback); } + /** + * Pauses a job. + * + * If a job is paused then the system will stop executing the job + * until it is re-enabled via {@link google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob|ResumeJob}. The + * state of the job is stored in {@link google.cloud.scheduler.v1beta1.Job.state|state}; if paused it + * will be set to {@link google.cloud.scheduler.v1beta1.Job.State.PAUSED|Job.State.PAUSED}. A job must be in {@link google.cloud.scheduler.v1beta1.Job.State.ENABLED|Job.State.ENABLED} + * to be paused. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. + * 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/v1beta1/cloud_scheduler.pause_job.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_async + */ pauseJob( request?: protos.google.cloud.scheduler.v1beta1.IPauseJobRequest, options?: CallOptions @@ -734,30 +758,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Pauses a job. - * - * If a job is paused then the system will stop executing the job - * until it is re-enabled via {@link google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob|ResumeJob}. The - * state of the job is stored in {@link google.cloud.scheduler.v1beta1.Job.state|state}; if paused it - * will be set to {@link google.cloud.scheduler.v1beta1.Job.State.PAUSED|Job.State.PAUSED}. A job must be in {@link google.cloud.scheduler.v1beta1.Job.State.ENABLED|Job.State.ENABLED} - * to be paused. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. - * 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.pauseJob(request); - */ pauseJob( request?: protos.google.cloud.scheduler.v1beta1.IPauseJobRequest, optionsOrCallback?: @@ -799,6 +799,29 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.pauseJob(request, options, callback); } + /** + * Resume a job. + * + * This method reenables a job after it has been {@link google.cloud.scheduler.v1beta1.Job.State.PAUSED|Job.State.PAUSED}. The + * state of a job is stored in {@link google.cloud.scheduler.v1beta1.Job.state|Job.state}; after calling this method it + * will be set to {@link google.cloud.scheduler.v1beta1.Job.State.ENABLED|Job.State.ENABLED}. A job must be in + * {@link google.cloud.scheduler.v1beta1.Job.State.PAUSED|Job.State.PAUSED} to be resumed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. + * 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/v1beta1/cloud_scheduler.resume_job.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_async + */ resumeJob( request?: protos.google.cloud.scheduler.v1beta1.IResumeJobRequest, options?: CallOptions @@ -830,29 +853,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Resume a job. - * - * This method reenables a job after it has been {@link google.cloud.scheduler.v1beta1.Job.State.PAUSED|Job.State.PAUSED}. The - * state of a job is stored in {@link google.cloud.scheduler.v1beta1.Job.state|Job.state}; after calling this method it - * will be set to {@link google.cloud.scheduler.v1beta1.Job.State.ENABLED|Job.State.ENABLED}. A job must be in - * {@link google.cloud.scheduler.v1beta1.Job.State.PAUSED|Job.State.PAUSED} to be resumed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. - * 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.resumeJob(request); - */ resumeJob( request?: protos.google.cloud.scheduler.v1beta1.IResumeJobRequest, optionsOrCallback?: @@ -896,6 +896,27 @@ export class CloudSchedulerClient { this.initialize(); return this.innerApiCalls.resumeJob(request, options, callback); } + /** + * Forces a job to run now. + * + * When this method is called, Cloud Scheduler will dispatch the job, even + * if the job is already running. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The job name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. + * 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/v1beta1/cloud_scheduler.run_job.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_async + */ runJob( request?: protos.google.cloud.scheduler.v1beta1.IRunJobRequest, options?: CallOptions @@ -923,27 +944,6 @@ export class CloudSchedulerClient { {} | null | undefined > ): void; - /** - * Forces a job to run now. - * - * When this method is called, Cloud Scheduler will dispatch the job, even - * if the job is already running. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The job name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 [Job]{@link google.cloud.scheduler.v1beta1.Job}. - * 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.runJob(request); - */ runJob( request?: protos.google.cloud.scheduler.v1beta1.IRunJobRequest, optionsOrCallback?: @@ -986,37 +986,6 @@ export class CloudSchedulerClient { return this.innerApiCalls.runJob(request, options, callback); } - listJobs( - request?: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.scheduler.v1beta1.IJob[], - protos.google.cloud.scheduler.v1beta1.IListJobsRequest | null, - protos.google.cloud.scheduler.v1beta1.IListJobsResponse - ] - >; - listJobs( - request: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.scheduler.v1beta1.IListJobsRequest, - | protos.google.cloud.scheduler.v1beta1.IListJobsResponse - | null - | undefined, - protos.google.cloud.scheduler.v1beta1.IJob - > - ): void; - listJobs( - request: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.scheduler.v1beta1.IListJobsRequest, - | protos.google.cloud.scheduler.v1beta1.IListJobsResponse - | null - | undefined, - protos.google.cloud.scheduler.v1beta1.IJob - > - ): void; /** * Lists jobs. * @@ -1053,6 +1022,37 @@ export class CloudSchedulerClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listJobs( + request?: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.scheduler.v1beta1.IJob[], + protos.google.cloud.scheduler.v1beta1.IListJobsRequest | null, + protos.google.cloud.scheduler.v1beta1.IListJobsResponse + ] + >; + listJobs( + request: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.scheduler.v1beta1.IListJobsRequest, + | protos.google.cloud.scheduler.v1beta1.IListJobsResponse + | null + | undefined, + protos.google.cloud.scheduler.v1beta1.IJob + > + ): void; + listJobs( + request: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.scheduler.v1beta1.IListJobsRequest, + | protos.google.cloud.scheduler.v1beta1.IListJobsResponse + | null + | undefined, + protos.google.cloud.scheduler.v1beta1.IJob + > + ): void; listJobs( request?: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, optionsOrCallback?: @@ -1187,11 +1187,8 @@ export class CloudSchedulerClient { * 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.listJobsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/cloud_scheduler.list_jobs.js + * region_tag:cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_async */ listJobsAsync( request?: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, @@ -1205,7 +1202,6 @@ export class CloudSchedulerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize();