diff --git a/packages/google-cloud-talent/.jsdoc.js b/packages/google-cloud-talent/.jsdoc.js index 717c4717a57..51310083eb3 100644 --- a/packages/google-cloud-talent/.jsdoc.js +++ b/packages/google-cloud-talent/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2022 Google LLC', + copyright: 'Copyright 2023 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/talent', diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js index 4401c38206d..3f95d6c9b79 100644 --- a/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js index 9a74b803f5c..6316049aac3 100644 --- a/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js index 434cbf422d0..af23e3b24d8 100644 --- a/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js b/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js index fb184a72c44..9acede5a5d8 100644 --- a/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js index 7ebcf8d801e..7c0da5a74d3 100644 --- a/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js b/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js index 8ba7f3c7a69..05abde42fcd 100644 --- a/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js +++ b/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js b/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js index 5ec537394b2..5b5ef84fa74 100644 --- a/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js +++ b/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js index f098f9f157a..467446acdb3 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js index e23cd39f091..434b315f83a 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js index e31a64e6b5f..5298aacdcd2 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js index d5e3b9f942c..f7b5b713e21 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js index f8d1e867926..0f6a1420caf 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js index 30a2b628081..fb9f7c6296b 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js index c579a8c5d0e..3be0a163e29 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js index 0c33fbf1f50..d1f8a6f9e75 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js index 035b48d0691..2b6a8d36537 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js index 96b4d2d5631..9995aa3470f 100644 --- a/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js index 2d87e569ecc..51ce7c7e136 100644 --- a/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js index 2a4664caa39..554d36f7835 100644 --- a/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js index 6743e8f71e4..f92b087ce7c 100644 --- a/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js index c53f997a400..a4728a2400a 100644 --- a/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js index 45d51292322..842e44c86b5 100644 --- a/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js index 772d0484772..64da6f964db 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js index 2bbc497be56..906dbc0ea03 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js index c2d74594719..5a88bbffdb5 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js index 880c105b79a..6c7d21e45b9 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js index 62715f420e2..b8b600c67b9 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js b/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js index 9ca47610b70..2edeba82aca 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js b/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js index 93894679c98..b0c8ab5ee5a 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js index 221d392ed02..4737712ff5a 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js index a46daf0c1fa..520ed2d888c 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js index 880e6036e48..7ab03bcbe0b 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js index d08774346dc..0e54e05f489 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js index c9d1ec7b627..b6dff7bb59f 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js index 4a42661a325..689f1e20d91 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js index 5176424701e..885b533b3d6 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js index 40408d5be23..5abd9230128 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js index 7b6a43cf041..89c09132571 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js index 9ab18315a1a..17e03e20aaa 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js index 39802780392..b8bcbf253be 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js index 87a9b941e01..53ba56c8e61 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js index dc8e2c49f4b..559c3efe3f6 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js index 1a1eae144c3..e5785bc98cd 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js index 7be262f2a00..93656860f20 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4/company_service_client.ts b/packages/google-cloud-talent/src/v4/company_service_client.ts index 8f6e4b44909..1375abfe71f 100644 --- a/packages/google-cloud-talent/src/v4/company_service_client.ts +++ b/packages/google-cloud-talent/src/v4/company_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4/completion_client.ts b/packages/google-cloud-talent/src/v4/completion_client.ts index 3b3bd8f719e..1d0ffd84400 100644 --- a/packages/google-cloud-talent/src/v4/completion_client.ts +++ b/packages/google-cloud-talent/src/v4/completion_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4/event_service_client.ts b/packages/google-cloud-talent/src/v4/event_service_client.ts index ca142a2acd6..652f52e841e 100644 --- a/packages/google-cloud-talent/src/v4/event_service_client.ts +++ b/packages/google-cloud-talent/src/v4/event_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4/index.ts b/packages/google-cloud-talent/src/v4/index.ts index ae43ee2aedb..ba7652cc1a4 100644 --- a/packages/google-cloud-talent/src/v4/index.ts +++ b/packages/google-cloud-talent/src/v4/index.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4/job_service_client.ts b/packages/google-cloud-talent/src/v4/job_service_client.ts index 7d9d04806ec..3fd21d56d25 100644 --- a/packages/google-cloud-talent/src/v4/job_service_client.ts +++ b/packages/google-cloud-talent/src/v4/job_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -2169,6 +2169,183 @@ export class JobServiceClient { callSettings ) as AsyncIterable; } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-talent/src/v4/tenant_service_client.ts b/packages/google-cloud-talent/src/v4/tenant_service_client.ts index b73fccba28c..f7c7061f884 100644 --- a/packages/google-cloud-talent/src/v4/tenant_service_client.ts +++ b/packages/google-cloud-talent/src/v4/tenant_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts index 2ba348d6f68..3e031236283 100644 --- a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4beta1/completion_client.ts b/packages/google-cloud-talent/src/v4beta1/completion_client.ts index 1a35ee04186..fa0161812fe 100644 --- a/packages/google-cloud-talent/src/v4beta1/completion_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/completion_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts index 04a4bc59730..c44fb01df61 100644 --- a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4beta1/index.ts b/packages/google-cloud-talent/src/v4beta1/index.ts index ae43ee2aedb..ba7652cc1a4 100644 --- a/packages/google-cloud-talent/src/v4beta1/index.ts +++ b/packages/google-cloud-talent/src/v4beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts index 61597fa46ae..eb73f10c562 100644 --- a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts index 8601f36a0dd..34a68bac07e 100644 --- a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/system-test/fixtures/sample/src/index.js b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.js index c54b08c0c95..80fb55051e7 100644 --- a/packages/google-cloud-talent/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.ts index 9f025f1684a..ae7deddfaf4 100644 --- a/packages/google-cloud-talent/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/system-test/install.ts b/packages/google-cloud-talent/system-test/install.ts index 6dd1eaadafa..f61fe236476 100644 --- a/packages/google-cloud-talent/system-test/install.ts +++ b/packages/google-cloud-talent/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_company_service_v4.ts b/packages/google-cloud-talent/test/gapic_company_service_v4.ts index c4b8337841f..dfe9d65ded0 100644 --- a/packages/google-cloud-talent/test/gapic_company_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_company_service_v4.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts index 82f39e3ba5e..6e90587b495 100644 --- a/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_completion_v4.ts b/packages/google-cloud-talent/test/gapic_completion_v4.ts index 9e534e156ff..c4c68f6a01e 100644 --- a/packages/google-cloud-talent/test/gapic_completion_v4.ts +++ b/packages/google-cloud-talent/test/gapic_completion_v4.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts b/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts index e635eb83ce8..7a0c158ae43 100644 --- a/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_event_service_v4.ts b/packages/google-cloud-talent/test/gapic_event_service_v4.ts index 744e1525180..4aa5f25f622 100644 --- a/packages/google-cloud-talent/test/gapic_event_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_event_service_v4.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts index 37a7bb8bbeb..7af8631c572 100644 --- a/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_job_service_v4.ts b/packages/google-cloud-talent/test/gapic_job_service_v4.ts index 0d66e5a3fee..c98fec17842 100644 --- a/packages/google-cloud-talent/test/gapic_job_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_job_service_v4.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1905,6 +1905,311 @@ describe('v4.JobServiceClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('company', () => { diff --git a/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts index 76e070b0c57..924e0ade56e 100644 --- a/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts b/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts index 9b254655772..818fad327ca 100644 --- a/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts index c7a39b69dc7..658e0d8a36f 100644 --- a/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.