diff --git a/packages/google-devtools-artifactregistry/.jsdoc.js b/packages/google-devtools-artifactregistry/.jsdoc.js index 075132d7d85..532a80143b5 100644 --- a/packages/google-devtools-artifactregistry/.jsdoc.js +++ b/packages/google-devtools-artifactregistry/.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/artifact-registry', diff --git a/packages/google-devtools-artifactregistry/.mocharc.js b/packages/google-devtools-artifactregistry/.mocharc.js index cdb7b752160..49e7e228701 100644 --- a/packages/google-devtools-artifactregistry/.mocharc.js +++ b/packages/google-devtools-artifactregistry/.mocharc.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-devtools-artifactregistry/.prettierrc.js b/packages/google-devtools-artifactregistry/.prettierrc.js index d546a4ad546..1e6cec783e4 100644 --- a/packages/google-devtools-artifactregistry/.prettierrc.js +++ b/packages/google-devtools-artifactregistry/.prettierrc.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-devtools-artifactregistry/protos/protos.d.ts b/packages/google-devtools-artifactregistry/protos/protos.d.ts index 3555d16b035..65d7527c8f4 100644 --- a/packages/google-devtools-artifactregistry/protos/protos.d.ts +++ b/packages/google-devtools-artifactregistry/protos/protos.d.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-devtools-artifactregistry/protos/protos.js b/packages/google-devtools-artifactregistry/protos/protos.js index 3b422c3e1d8..ecc36162379 100644 --- a/packages/google-devtools-artifactregistry/protos/protos.js +++ b/packages/google-devtools-artifactregistry/protos/protos.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_repository.js index b21e52ee61c..31e4eee5c99 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_repository.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_tag.js index 52009b55e7a..65e179892da 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.create_tag.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_package.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_package.js index 8102d023d4f..3182dfcaafc 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_package.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_package.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_repository.js index 28feb656099..417477c2e77 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_repository.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_tag.js index f03f13bcc37..848398d4313 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_tag.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_version.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_version.js index f6d6b959a84..89e0fe6f0bb 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_version.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.delete_version.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_docker_image.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_docker_image.js index 077ba9f0ce1..c5ec14d2069 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_docker_image.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_docker_image.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_file.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_file.js index c2c0d170991..947a76e4a3f 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_file.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_file.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_iam_policy.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_iam_policy.js index 560c3562ad5..94c86686012 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_iam_policy.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_iam_policy.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_package.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_package.js index d31d0d29293..904ad1c01fb 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_package.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_package.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_project_settings.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_project_settings.js index 5d701ee64d2..f35139db26e 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_project_settings.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_project_settings.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_repository.js index 0d1b36c0c43..19e29582166 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_repository.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_tag.js index 183a026dd83..7075a8d6c4c 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_tag.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_version.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_version.js index a3aaa2ad83a..8197ba8371a 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_version.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.get_version.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_apt_artifacts.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_apt_artifacts.js index 93647627825..7777baeabe5 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_apt_artifacts.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_apt_artifacts.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_yum_artifacts.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_yum_artifacts.js index 19f33ba3d25..4d8d43fbeab 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_yum_artifacts.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.import_yum_artifacts.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_docker_images.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_docker_images.js index c1770610836..94a5cc96460 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_docker_images.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_docker_images.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_files.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_files.js index 935926ba7b4..18d08865caa 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_files.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_files.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_packages.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_packages.js index b605cad1b06..dea1563b637 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_packages.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_packages.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_repositories.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_repositories.js index 149260a6474..a9ae7e7d5af 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_repositories.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_repositories.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_tags.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_tags.js index 00edd6f06fa..aaae98758ba 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_tags.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_tags.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_versions.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_versions.js index b4aaff1672b..42cfc63bca5 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_versions.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.list_versions.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.set_iam_policy.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.set_iam_policy.js index af915f200bc..224d684e33c 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.set_iam_policy.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.set_iam_policy.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.test_iam_permissions.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.test_iam_permissions.js index d2e1afac7d1..343fb73694c 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.test_iam_permissions.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.test_iam_permissions.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_project_settings.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_project_settings.js index dacae106949..3129244d36f 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_project_settings.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_project_settings.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_repository.js index c6a84f63013..5183bf67ae5 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_repository.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-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_tag.js index 5236b49655b..9e3b8ae13c1 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/artifact_registry.update_tag.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_repository.js index 825954eedc9..9341f250462 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_repository.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_tag.js index 638ca8c2952..8e2e6007230 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.create_tag.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_package.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_package.js index 04267a342ae..cdd58e430bf 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_package.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_package.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_repository.js index 95e3f67e636..9348b99dcf4 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_repository.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_tag.js index 78d713e5b1c..925cc99351c 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_tag.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_version.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_version.js index 11b6655382f..c7200680120 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_version.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.delete_version.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_file.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_file.js index 2e915e6dbd1..b799deb6d63 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_file.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_file.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_iam_policy.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_iam_policy.js index ff94e203ffd..e59a3b8fd5d 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_iam_policy.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_iam_policy.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_package.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_package.js index e3e97994d0d..9c19f11c032 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_package.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_package.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_project_settings.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_project_settings.js index cb53fc20317..d10d842e05e 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_project_settings.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_project_settings.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_repository.js index 557ce53fbc1..0ddb274a142 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_repository.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_tag.js index 9e4b6d4150d..509bc806a28 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_tag.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_version.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_version.js index 99bb585933a..9f76a47b6ad 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_version.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.get_version.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_apt_artifacts.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_apt_artifacts.js index c5fa1fc628c..b68e743cf10 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_apt_artifacts.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_apt_artifacts.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_yum_artifacts.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_yum_artifacts.js index 430f99782cf..ac6f7be7cab 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_yum_artifacts.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.import_yum_artifacts.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_files.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_files.js index d7ac00918da..d67e9249ac0 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_files.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_files.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_packages.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_packages.js index ad87951ebde..44043b4989b 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_packages.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_packages.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_repositories.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_repositories.js index 02f2f5a24f0..e6bca968d90 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_repositories.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_repositories.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_tags.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_tags.js index 075863a6cf1..1a948f679d2 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_tags.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_tags.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_versions.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_versions.js index 5694623a903..8172e26ca8c 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_versions.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.list_versions.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.set_iam_policy.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.set_iam_policy.js index 16c4224a980..98e1c63e556 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.set_iam_policy.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.set_iam_policy.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.test_iam_permissions.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.test_iam_permissions.js index 913875826a9..dcc3081770b 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.test_iam_permissions.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.test_iam_permissions.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_project_settings.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_project_settings.js index 70da02598f2..1d5093e9948 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_project_settings.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_project_settings.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_repository.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_repository.js index b16618ac210..d4aa1d3a222 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_repository.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_repository.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-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_tag.js b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_tag.js index 074f88b0ca0..587b8ffe2f6 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_tag.js +++ b/packages/google-devtools-artifactregistry/samples/generated/v1beta2/artifact_registry.update_tag.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-devtools-artifactregistry/src/index.ts b/packages/google-devtools-artifactregistry/src/index.ts index 4f4f6f496a2..6213b077a4f 100644 --- a/packages/google-devtools-artifactregistry/src/index.ts +++ b/packages/google-devtools-artifactregistry/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-devtools-artifactregistry/src/v1/artifact_registry_client.ts b/packages/google-devtools-artifactregistry/src/v1/artifact_registry_client.ts index 329daac8e15..bd2bec55739 100644 --- a/packages/google-devtools-artifactregistry/src/v1/artifact_registry_client.ts +++ b/packages/google-devtools-artifactregistry/src/v1/artifact_registry_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. @@ -27,6 +27,8 @@ import type { LROperation, PaginationCallback, GaxCall, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -73,6 +75,7 @@ export class ArtifactRegistryClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; artifactRegistryStub?: Promise<{[name: string]: Function}>; @@ -135,6 +138,9 @@ export class ArtifactRegistryClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -167,6 +173,10 @@ export class ArtifactRegistryClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -4001,6 +4011,86 @@ export class ArtifactRegistryClient { callSettings ) as AsyncIterable; } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * 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.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + // -------------------- // -- Path templates -- // -------------------- @@ -4535,6 +4625,7 @@ export class ArtifactRegistryClient { return this.artifactRegistryStub.then(stub => { this._terminated = true; stub.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-devtools-artifactregistry/src/v1/index.ts b/packages/google-devtools-artifactregistry/src/v1/index.ts index 00ba1f8a05c..2491b7166cd 100644 --- a/packages/google-devtools-artifactregistry/src/v1/index.ts +++ b/packages/google-devtools-artifactregistry/src/v1/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-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts b/packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts index 5b2438e27c0..6cada79d9b9 100644 --- a/packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_client.ts +++ b/packages/google-devtools-artifactregistry/src/v1beta2/artifact_registry_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. @@ -27,6 +27,8 @@ import type { LROperation, PaginationCallback, GaxCall, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -73,6 +75,7 @@ export class ArtifactRegistryClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; artifactRegistryStub?: Promise<{[name: string]: Function}>; @@ -135,6 +138,9 @@ export class ArtifactRegistryClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -167,6 +173,10 @@ export class ArtifactRegistryClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -3744,6 +3754,86 @@ export class ArtifactRegistryClient { callSettings ) as AsyncIterable; } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * 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.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + // -------------------- // -- Path templates -- // -------------------- @@ -4207,6 +4297,7 @@ export class ArtifactRegistryClient { return this.artifactRegistryStub.then(stub => { this._terminated = true; stub.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-devtools-artifactregistry/src/v1beta2/index.ts b/packages/google-devtools-artifactregistry/src/v1beta2/index.ts index 00ba1f8a05c..2491b7166cd 100644 --- a/packages/google-devtools-artifactregistry/src/v1beta2/index.ts +++ b/packages/google-devtools-artifactregistry/src/v1beta2/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-devtools-artifactregistry/system-test/fixtures/sample/src/index.js b/packages/google-devtools-artifactregistry/system-test/fixtures/sample/src/index.js index c68dc0e39d1..8e7a9106aee 100644 --- a/packages/google-devtools-artifactregistry/system-test/fixtures/sample/src/index.js +++ b/packages/google-devtools-artifactregistry/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-devtools-artifactregistry/system-test/fixtures/sample/src/index.ts b/packages/google-devtools-artifactregistry/system-test/fixtures/sample/src/index.ts index bc98c741265..e830f64db5a 100644 --- a/packages/google-devtools-artifactregistry/system-test/fixtures/sample/src/index.ts +++ b/packages/google-devtools-artifactregistry/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-devtools-artifactregistry/system-test/install.ts b/packages/google-devtools-artifactregistry/system-test/install.ts index 6dd1eaadafa..f61fe236476 100644 --- a/packages/google-devtools-artifactregistry/system-test/install.ts +++ b/packages/google-devtools-artifactregistry/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-devtools-artifactregistry/test/gapic_artifact_registry_v1.ts b/packages/google-devtools-artifactregistry/test/gapic_artifact_registry_v1.ts index e0d0a73d3d3..906e191b3da 100644 --- a/packages/google-devtools-artifactregistry/test/gapic_artifact_registry_v1.ts +++ b/packages/google-devtools-artifactregistry/test/gapic_artifact_registry_v1.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. @@ -25,7 +25,12 @@ import * as artifactregistryModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -5359,6 +5364,204 @@ describe('v1.ArtifactRegistryClient', () => { ); }); }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new artifactregistryModule.v1.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new artifactregistryModule.v1.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new artifactregistryModule.v1.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new artifactregistryModule.v1.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new artifactregistryModule.v1.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); describe('Path templates', () => { describe('aptArtifact', () => { diff --git a/packages/google-devtools-artifactregistry/test/gapic_artifact_registry_v1beta2.ts b/packages/google-devtools-artifactregistry/test/gapic_artifact_registry_v1beta2.ts index a0b692ad94d..ad769a1a65e 100644 --- a/packages/google-devtools-artifactregistry/test/gapic_artifact_registry_v1beta2.ts +++ b/packages/google-devtools-artifactregistry/test/gapic_artifact_registry_v1beta2.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. @@ -25,7 +25,12 @@ import * as artifactregistryModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -4918,6 +4923,204 @@ describe('v1beta2.ArtifactRegistryClient', () => { ); }); }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new artifactregistryModule.v1beta2.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new artifactregistryModule.v1beta2.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new artifactregistryModule.v1beta2.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new artifactregistryModule.v1beta2.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new artifactregistryModule.v1beta2.ArtifactRegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); describe('Path templates', () => { describe('aptArtifact', () => {