From 6bc85693ca3867ddf8a294c10ee6ef7c15883af7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 12:03:22 -0500 Subject: [PATCH] docs(samples): add example tags to generated samples (#312) PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 --- .../linkinator.config.json | 2 +- ...t_manager_service.access_secret_version.js | 56 ++ ...cret_manager_service.add_secret_version.js | 59 ++ .../secret_manager_service.create_secret.js | 67 ++ .../secret_manager_service.delete_secret.js | 60 ++ ..._manager_service.destroy_secret_version.js | 60 ++ ..._manager_service.disable_secret_version.js | 60 ++ ...t_manager_service.enable_secret_version.js | 60 ++ .../secret_manager_service.get_iam_policy.js | 59 ++ .../v1/secret_manager_service.get_secret.js | 53 ++ ...cret_manager_service.get_secret_version.js | 56 ++ ...et_manager_service.list_secret_versions.js | 76 ++ .../v1/secret_manager_service.list_secrets.js | 75 ++ .../secret_manager_service.set_iam_policy.js | 62 ++ ...et_manager_service.test_iam_permissions.js | 62 ++ .../secret_manager_service.update_secret.js | 58 ++ .../samples/package.json | 2 +- .../src/v1/secret_manager_service_client.ts | 766 +++++++++--------- 18 files changed, 1306 insertions(+), 387 deletions(-) create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.access_secret_version.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.add_secret_version.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.create_secret.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.delete_secret.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.destroy_secret_version.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.disable_secret_version.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.enable_secret_version.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_iam_policy.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret_version.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secret_versions.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secrets.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.set_iam_policy.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.test_iam_permissions.js create mode 100644 packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.update_secret.js diff --git a/packages/google-cloud-secretmanager/linkinator.config.json b/packages/google-cloud-secretmanager/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-secretmanager/linkinator.config.json +++ b/packages/google-cloud-secretmanager/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.access_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.access_secret_version.js new file mode 100644 index 00000000000..4dcd143b8d9 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.access_secret_version.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format + * `projects/* /secrets/* /versions/*`. + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created SecretVersion google.cloud.secretmanager.v1.SecretVersion. + */ + // const name = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callAccessSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.accessSecretVersion(request); + console.log(response); + } + + callAccessSecretVersion(); + // [END secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.add_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.add_secret_version.js new file mode 100644 index 00000000000..b49ceaf50c6 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.add_secret_version.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, payload) { + // [START secretmanager_v1_generated_SecretManagerService_AddSecretVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Secret google.cloud.secretmanager.v1.Secret to associate with the + * SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format `projects/* /secrets/*`. + */ + // const parent = 'abc123' + /** + * Required. The secret payload of the SecretVersion google.cloud.secretmanager.v1.SecretVersion. + */ + // const payload = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callAddSecretVersion() { + // Construct request + const request = { + parent, + payload, + }; + + // Run request + const response = await secretmanagerClient.addSecretVersion(request); + console.log(response); + } + + callAddSecretVersion(); + // [END secretmanager_v1_generated_SecretManagerService_AddSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.create_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.create_secret.js new file mode 100644 index 00000000000..02333881067 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.create_secret.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, secretId, secret) { + // [START secretmanager_v1_generated_SecretManagerService_CreateSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project to associate with the + * Secret google.cloud.secretmanager.v1.Secret, in the format `projects/*`. + */ + // const parent = 'abc123' + /** + * Required. This must be unique within the project. + * A secret ID is a string with a maximum length of 255 characters and can + * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + * underscore (`_`) characters. + */ + // const secretId = 'abc123' + /** + * Required. A Secret google.cloud.secretmanager.v1.Secret with initial field values. + */ + // const secret = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callCreateSecret() { + // Construct request + const request = { + parent, + secretId, + secret, + }; + + // Run request + const response = await secretmanagerClient.createSecret(request); + console.log(response); + } + + callCreateSecret(); + // [END secretmanager_v1_generated_SecretManagerService_CreateSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.delete_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.delete_secret.js new file mode 100644 index 00000000000..308fc4057a2 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.delete_secret.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START secretmanager_v1_generated_SecretManagerService_DeleteSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Secret google.cloud.secretmanager.v1.Secret to delete in the format + * `projects/* /secrets/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the Secret google.cloud.secretmanager.v1.Secret. The request succeeds if it matches + * the etag of the currently stored secret object. If the etag is omitted, + * the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callDeleteSecret() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.deleteSecret(request); + console.log(response); + } + + callDeleteSecret(); + // [END secretmanager_v1_generated_SecretManagerService_DeleteSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.destroy_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.destroy_secret_version.js new file mode 100644 index 00000000000..a5e7e9ea7d1 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.destroy_secret_version.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the SecretVersion google.cloud.secretmanager.v1.SecretVersion to destroy in the format + * `projects/* /secrets/* /versions/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the SecretVersion google.cloud.secretmanager.v1.SecretVersion. The request succeeds if it matches + * the etag of the currently stored secret version object. If the etag is + * omitted, the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callDestroySecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.destroySecretVersion(request); + console.log(response); + } + + callDestroySecretVersion(); + // [END secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.disable_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.disable_secret_version.js new file mode 100644 index 00000000000..fd54295dde3 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.disable_secret_version.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the SecretVersion google.cloud.secretmanager.v1.SecretVersion to disable in the format + * `projects/* /secrets/* /versions/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the SecretVersion google.cloud.secretmanager.v1.SecretVersion. The request succeeds if it matches + * the etag of the currently stored secret version object. If the etag is + * omitted, the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callDisableSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.disableSecretVersion(request); + console.log(response); + } + + callDisableSecretVersion(); + // [END secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.enable_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.enable_secret_version.js new file mode 100644 index 00000000000..dc81e3c13f8 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.enable_secret_version.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the SecretVersion google.cloud.secretmanager.v1.SecretVersion to enable in the format + * `projects/* /secrets/* /versions/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the SecretVersion google.cloud.secretmanager.v1.SecretVersion. The request succeeds if it matches + * the etag of the currently stored secret version object. If the etag is + * omitted, the request succeeds. + */ + // const etag = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callEnableSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.enableSecretVersion(request); + console.log(response); + } + + callEnableSecretVersion(); + // [END secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_iam_policy.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_iam_policy.js new file mode 100644 index 00000000000..b5b0551b6ff --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_iam_policy.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(resource) { + // [START secretmanager_v1_generated_SecretManagerService_GetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + */ + // const options = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await secretmanagerClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END secretmanager_v1_generated_SecretManagerService_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret.js new file mode 100644 index 00000000000..beb8113c21a --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START secretmanager_v1_generated_SecretManagerService_GetSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Secret google.cloud.secretmanager.v1.Secret, in the format `projects/* /secrets/*`. + */ + // const name = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callGetSecret() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.getSecret(request); + console.log(response); + } + + callGetSecret(); + // [END secretmanager_v1_generated_SecretManagerService_GetSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret_version.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret_version.js new file mode 100644 index 00000000000..12eb732c974 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.get_secret_version.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START secretmanager_v1_generated_SecretManagerService_GetSecretVersion_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the SecretVersion google.cloud.secretmanager.v1.SecretVersion in the format + * `projects/* /secrets/* /versions/*`. + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created SecretVersion google.cloud.secretmanager.v1.SecretVersion. + */ + // const name = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callGetSecretVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await secretmanagerClient.getSecretVersion(request); + console.log(response); + } + + callGetSecretVersion(); + // [END secretmanager_v1_generated_SecretManagerService_GetSecretVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secret_versions.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secret_versions.js new file mode 100644 index 00000000000..d4512a7d29e --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secret_versions.js @@ -0,0 +1,76 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START secretmanager_v1_generated_SecretManagerService_ListSecretVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Secret google.cloud.secretmanager.v1.Secret associated with the + * SecretVersions google.cloud.secretmanager.v1.SecretVersion to list, in the format + * `projects/* /secrets/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListSecretVersionsResponse.next_page_token . + */ + // const pageToken = 'abc123' + /** + * Optional. Filter string, adhering to the rules in + * List-operation + * filtering (https://cloud.google.com/secret-manager/docs/filtering). List + * only secret versions matching the filter. If filter is empty, all secret + * versions are listed. + */ + // const filter = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callListSecretVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await secretmanagerClient.listSecretVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecretVersions(); + // [END secretmanager_v1_generated_SecretManagerService_ListSecretVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secrets.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secrets.js new file mode 100644 index 00000000000..550e7ed005f --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.list_secrets.js @@ -0,0 +1,75 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START secretmanager_v1_generated_SecretManagerService_ListSecrets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project associated with the + * Secrets google.cloud.secretmanager.v1.Secret, in the format `projects/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of results to be returned in a single page. If + * set to 0, the server decides the number of results to return. If the + * number is greater than 25000, it is capped at 25000. + */ + // const pageSize = 1234 + /** + * Optional. Pagination token, returned earlier via + * ListSecretsResponse.next_page_token google.cloud.secretmanager.v1.ListSecretsResponse.next_page_token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter string, adhering to the rules in + * List-operation + * filtering (https://cloud.google.com/secret-manager/docs/filtering). List + * only secrets matching the filter. If filter is empty, all secrets are + * listed. + */ + // const filter = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callListSecrets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await secretmanagerClient.listSecretsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecrets(); + // [END secretmanager_v1_generated_SecretManagerService_ListSecrets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.set_iam_policy.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.set_iam_policy.js new file mode 100644 index 00000000000..f593f353686 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.set_iam_policy.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(resource, policy) { + // [START secretmanager_v1_generated_SecretManagerService_SetIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await secretmanagerClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END secretmanager_v1_generated_SecretManagerService_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.test_iam_permissions.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.test_iam_permissions.js new file mode 100644 index 00000000000..e5ca5a353bd --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.test_iam_permissions.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(resource, permissions) { + // [START secretmanager_v1_generated_SecretManagerService_TestIamPermissions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await secretmanagerClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END secretmanager_v1_generated_SecretManagerService_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.update_secret.js b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.update_secret.js new file mode 100644 index 00000000000..7517c4f22a8 --- /dev/null +++ b/packages/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.update_secret.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(secret, updateMask) { + // [START secretmanager_v1_generated_SecretManagerService_UpdateSecret_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Secret google.cloud.secretmanager.v1.Secret with updated field values. + */ + // const secret = {} + /** + * Required. Specifies the fields to be updated. + */ + // const updateMask = {} + + // Imports the Secretmanager library + const {SecretManagerServiceClient} = + require('@google-cloud/secret-manager').v1; + + // Instantiates a client + const secretmanagerClient = new SecretManagerServiceClient(); + + async function callUpdateSecret() { + // Construct request + const request = { + secret, + updateMask, + }; + + // Run request + const response = await secretmanagerClient.updateSecret(request); + console.log(response); + } + + callUpdateSecret(); + // [END secretmanager_v1_generated_SecretManagerService_UpdateSecret_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-secretmanager/samples/package.json b/packages/google-cloud-secretmanager/samples/package.json index 7da337c1182..68275be3d1f 100644 --- a/packages/google-cloud-secretmanager/samples/package.json +++ b/packages/google-cloud-secretmanager/samples/package.json @@ -8,7 +8,7 @@ "author": "Google LLC", "repository": "googleapis/nodejs-secret-manager", "engines": { - "node": ">=8" + "node": ">=10" }, "scripts": { "test": "c8 mocha --recursive test/ --timeout=800000" diff --git a/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts b/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts index feb2209db72..6bb485751bf 100644 --- a/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts +++ b/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts @@ -348,6 +348,32 @@ export class SecretManagerServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a new {@link google.cloud.secretmanager.v1.Secret|Secret} containing no {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersions}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to associate with the + * {@link google.cloud.secretmanager.v1.Secret|Secret}, in the format `projects/*`. + * @param {string} request.secretId + * Required. This must be unique within the project. + * + * A secret ID is a string with a maximum length of 255 characters and can + * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + * underscore (`_`) characters. + * @param {google.cloud.secretmanager.v1.Secret} request.secret + * Required. A {@link google.cloud.secretmanager.v1.Secret|Secret} with initial field values. + * @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 [Secret]{@link google.cloud.secretmanager.v1.Secret}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.create_secret.js + * region_tag:secretmanager_v1_generated_SecretManagerService_CreateSecret_async + */ createSecret( request?: protos.google.cloud.secretmanager.v1.ICreateSecretRequest, options?: CallOptions @@ -379,32 +405,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Creates a new {@link google.cloud.secretmanager.v1.Secret|Secret} containing no {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersions}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the project to associate with the - * {@link google.cloud.secretmanager.v1.Secret|Secret}, in the format `projects/*`. - * @param {string} request.secretId - * Required. This must be unique within the project. - * - * A secret ID is a string with a maximum length of 255 characters and can - * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - * underscore (`_`) characters. - * @param {google.cloud.secretmanager.v1.Secret} request.secret - * Required. A {@link google.cloud.secretmanager.v1.Secret|Secret} with initial field values. - * @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 [Secret]{@link google.cloud.secretmanager.v1.Secret}. - * 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.createSecret(request); - */ createSecret( request?: protos.google.cloud.secretmanager.v1.ICreateSecretRequest, optionsOrCallback?: @@ -448,6 +448,27 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.createSecret(request, options, callback); } + /** + * Creates a new {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} containing secret data and attaches + * it to an existing {@link google.cloud.secretmanager.v1.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the {@link google.cloud.secretmanager.v1.Secret|Secret} to associate with the + * {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} in the format `projects/* /secrets/*`. + * @param {google.cloud.secretmanager.v1.SecretPayload} request.payload + * Required. The secret payload of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.add_secret_version.js + * region_tag:secretmanager_v1_generated_SecretManagerService_AddSecretVersion_async + */ addSecretVersion( request?: protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest, options?: CallOptions @@ -479,27 +500,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Creates a new {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} containing secret data and attaches - * it to an existing {@link google.cloud.secretmanager.v1.Secret|Secret}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the {@link google.cloud.secretmanager.v1.Secret|Secret} to associate with the - * {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} in the format `projects/* /secrets/*`. - * @param {google.cloud.secretmanager.v1.SecretPayload} request.payload - * Required. The secret payload of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. - * 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.addSecretVersion(request); - */ addSecretVersion( request?: protos.google.cloud.secretmanager.v1.IAddSecretVersionRequest, optionsOrCallback?: @@ -543,6 +543,23 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.addSecretVersion(request, options, callback); } + /** + * Gets metadata for a given {@link google.cloud.secretmanager.v1.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the {@link google.cloud.secretmanager.v1.Secret|Secret}, in the format `projects/* /secrets/*`. + * @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 [Secret]{@link google.cloud.secretmanager.v1.Secret}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.get_secret.js + * region_tag:secretmanager_v1_generated_SecretManagerService_GetSecret_async + */ getSecret( request?: protos.google.cloud.secretmanager.v1.IGetSecretRequest, options?: CallOptions @@ -570,23 +587,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Gets metadata for a given {@link google.cloud.secretmanager.v1.Secret|Secret}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the {@link google.cloud.secretmanager.v1.Secret|Secret}, in the format `projects/* /secrets/*`. - * @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 [Secret]{@link google.cloud.secretmanager.v1.Secret}. - * 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.getSecret(request); - */ getSecret( request?: protos.google.cloud.secretmanager.v1.IGetSecretRequest, optionsOrCallback?: @@ -628,6 +628,25 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.getSecret(request, options, callback); } + /** + * Updates metadata of an existing {@link google.cloud.secretmanager.v1.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.secretmanager.v1.Secret} request.secret + * Required. {@link google.cloud.secretmanager.v1.Secret|Secret} with updated field values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Specifies the fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Secret]{@link google.cloud.secretmanager.v1.Secret}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.update_secret.js + * region_tag:secretmanager_v1_generated_SecretManagerService_UpdateSecret_async + */ updateSecret( request?: protos.google.cloud.secretmanager.v1.IUpdateSecretRequest, options?: CallOptions @@ -659,25 +678,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Updates metadata of an existing {@link google.cloud.secretmanager.v1.Secret|Secret}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.secretmanager.v1.Secret} request.secret - * Required. {@link google.cloud.secretmanager.v1.Secret|Secret} with updated field values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Specifies the fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Secret]{@link google.cloud.secretmanager.v1.Secret}. - * 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.updateSecret(request); - */ updateSecret( request?: protos.google.cloud.secretmanager.v1.IUpdateSecretRequest, optionsOrCallback?: @@ -721,6 +721,28 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.updateSecret(request, options, callback); } + /** + * Deletes a {@link google.cloud.secretmanager.v1.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the {@link google.cloud.secretmanager.v1.Secret|Secret} to delete in the format + * `projects/* /secrets/*`. + * @param {string} [request.etag] + * Optional. Etag of the {@link google.cloud.secretmanager.v1.Secret|Secret}. The request succeeds if it matches + * the etag of the currently stored secret object. If the etag is omitted, + * the request succeeds. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.delete_secret.js + * region_tag:secretmanager_v1_generated_SecretManagerService_DeleteSecret_async + */ deleteSecret( request?: protos.google.cloud.secretmanager.v1.IDeleteSecretRequest, options?: CallOptions @@ -752,28 +774,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Deletes a {@link google.cloud.secretmanager.v1.Secret|Secret}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the {@link google.cloud.secretmanager.v1.Secret|Secret} to delete in the format - * `projects/* /secrets/*`. - * @param {string} [request.etag] - * Optional. Etag of the {@link google.cloud.secretmanager.v1.Secret|Secret}. The request succeeds if it matches - * the etag of the currently stored secret object. If the etag is omitted, - * the request succeeds. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteSecret(request); - */ deleteSecret( request?: protos.google.cloud.secretmanager.v1.IDeleteSecretRequest, optionsOrCallback?: @@ -817,6 +817,30 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.deleteSecret(request, options, callback); } + /** + * Gets metadata for a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} in the format + * `projects/* /secrets/* /versions/*`. + * + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.get_secret_version.js + * region_tag:secretmanager_v1_generated_SecretManagerService_GetSecretVersion_async + */ getSecretVersion( request?: protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest, options?: CallOptions @@ -848,30 +872,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Gets metadata for a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * - * `projects/* /secrets/* /versions/latest` is an alias to the most recently - * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} in the format - * `projects/* /secrets/* /versions/*`. - * - * `projects/* /secrets/* /versions/latest` is an alias to the most recently - * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. - * 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.getSecretVersion(request); - */ getSecretVersion( request?: protos.google.cloud.secretmanager.v1.IGetSecretVersionRequest, optionsOrCallback?: @@ -915,6 +915,30 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.getSecretVersion(request, options, callback); } + /** + * Accesses a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. This call returns the secret data. + * + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} in the format + * `projects/* /secrets/* /versions/*`. + * + * `projects/* /secrets/* /versions/latest` is an alias to the most recently + * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * @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 [AccessSecretVersionResponse]{@link google.cloud.secretmanager.v1.AccessSecretVersionResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.access_secret_version.js + * region_tag:secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_async + */ accessSecretVersion( request?: protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest, options?: CallOptions @@ -949,30 +973,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Accesses a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. This call returns the secret data. - * - * `projects/* /secrets/* /versions/latest` is an alias to the most recently - * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} in the format - * `projects/* /secrets/* /versions/*`. - * - * `projects/* /secrets/* /versions/latest` is an alias to the most recently - * created {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * @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 [AccessSecretVersionResponse]{@link google.cloud.secretmanager.v1.AccessSecretVersionResponse}. - * 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.accessSecretVersion(request); - */ accessSecretVersion( request?: protos.google.cloud.secretmanager.v1.IAccessSecretVersionRequest, optionsOrCallback?: @@ -1019,6 +1019,31 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.accessSecretVersion(request, options, callback); } + /** + * Disables a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * + * Sets the {@link google.cloud.secretmanager.v1.SecretVersion.state|state} of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to + * {@link google.cloud.secretmanager.v1.SecretVersion.State.DISABLED|DISABLED}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to disable in the format + * `projects/* /secrets/* /versions/*`. + * @param {string} [request.etag] + * Optional. Etag of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. The request succeeds if it matches + * the etag of the currently stored secret version object. If the etag is + * omitted, the request succeeds. + * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.disable_secret_version.js + * region_tag:secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_async + */ disableSecretVersion( request?: protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest, options?: CallOptions @@ -1053,31 +1078,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Disables a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * - * Sets the {@link google.cloud.secretmanager.v1.SecretVersion.state|state} of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to - * {@link google.cloud.secretmanager.v1.SecretVersion.State.DISABLED|DISABLED}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to disable in the format - * `projects/* /secrets/* /versions/*`. - * @param {string} [request.etag] - * Optional. Etag of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. The request succeeds if it matches - * the etag of the currently stored secret version object. If the etag is - * omitted, the request succeeds. - * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. - * 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.disableSecretVersion(request); - */ disableSecretVersion( request?: protos.google.cloud.secretmanager.v1.IDisableSecretVersionRequest, optionsOrCallback?: @@ -1124,6 +1124,31 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.disableSecretVersion(request, options, callback); } + /** + * Enables a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * + * Sets the {@link google.cloud.secretmanager.v1.SecretVersion.state|state} of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to + * {@link google.cloud.secretmanager.v1.SecretVersion.State.ENABLED|ENABLED}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to enable in the format + * `projects/* /secrets/* /versions/*`. + * @param {string} [request.etag] + * Optional. Etag of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. The request succeeds if it matches + * the etag of the currently stored secret version object. If the etag is + * omitted, the request succeeds. + * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.enable_secret_version.js + * region_tag:secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_async + */ enableSecretVersion( request?: protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest, options?: CallOptions @@ -1158,31 +1183,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Enables a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * - * Sets the {@link google.cloud.secretmanager.v1.SecretVersion.state|state} of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to - * {@link google.cloud.secretmanager.v1.SecretVersion.State.ENABLED|ENABLED}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to enable in the format - * `projects/* /secrets/* /versions/*`. - * @param {string} [request.etag] - * Optional. Etag of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. The request succeeds if it matches - * the etag of the currently stored secret version object. If the etag is - * omitted, the request succeeds. - * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. - * 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.enableSecretVersion(request); - */ enableSecretVersion( request?: protos.google.cloud.secretmanager.v1.IEnableSecretVersionRequest, optionsOrCallback?: @@ -1229,6 +1229,32 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.enableSecretVersion(request, options, callback); } + /** + * Destroys a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. + * + * Sets the {@link google.cloud.secretmanager.v1.SecretVersion.state|state} of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to + * {@link google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED|DESTROYED} and irrevocably destroys the + * secret data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to destroy in the format + * `projects/* /secrets/* /versions/*`. + * @param {string} [request.etag] + * Optional. Etag of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. The request succeeds if it matches + * the etag of the currently stored secret version object. If the etag is + * omitted, the request succeeds. + * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.destroy_secret_version.js + * region_tag:secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_async + */ destroySecretVersion( request?: protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest, options?: CallOptions @@ -1263,32 +1289,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Destroys a {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. - * - * Sets the {@link google.cloud.secretmanager.v1.SecretVersion.state|state} of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to - * {@link google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED|DESTROYED} and irrevocably destroys the - * secret data. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion} to destroy in the format - * `projects/* /secrets/* /versions/*`. - * @param {string} [request.etag] - * Optional. Etag of the {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersion}. The request succeeds if it matches - * the etag of the currently stored secret version object. If the etag is - * omitted, the request succeeds. - * @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 [SecretVersion]{@link google.cloud.secretmanager.v1.SecretVersion}. - * 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.destroySecretVersion(request); - */ destroySecretVersion( request?: protos.google.cloud.secretmanager.v1.IDestroySecretVersionRequest, optionsOrCallback?: @@ -1335,6 +1335,33 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.destroySecretVersion(request, options, callback); } + /** + * Sets the access control policy on the specified secret. Replaces any + * existing policy. + * + * Permissions on {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersions} are enforced according + * to the policy set on the associated {@link google.cloud.secretmanager.v1.Secret|Secret}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.set_iam_policy.js + * region_tag:secretmanager_v1_generated_SecretManagerService_SetIamPolicy_async + */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions @@ -1362,33 +1389,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Sets the access control policy on the specified secret. Replaces any - * existing policy. - * - * Permissions on {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersions} are enforced according - * to the policy set on the associated {@link google.cloud.secretmanager.v1.Secret|Secret}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @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 [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setIamPolicy(request); - */ setIamPolicy( request?: protos.google.iam.v1.ISetIamPolicyRequest, optionsOrCallback?: @@ -1428,6 +1428,28 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } + /** + * Gets the access control policy for a secret. + * Returns empty policy if the secret exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/secret_manager_service.get_iam_policy.js + * region_tag:secretmanager_v1_generated_SecretManagerService_GetIamPolicy_async + */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions @@ -1455,28 +1477,6 @@ export class SecretManagerServiceClient { {} | null | undefined > ): void; - /** - * Gets the access control policy for a secret. - * Returns empty policy if the secret exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * @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 [Policy]{@link google.iam.v1.Policy}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getIamPolicy(request); - */ getIamPolicy( request?: protos.google.iam.v1.IGetIamPolicyRequest, optionsOrCallback?: @@ -1516,33 +1516,6 @@ export class SecretManagerServiceClient { this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined - ] - >; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Returns permissions that a caller has for the specified secret. * If the secret does not exist, this call returns an empty set of @@ -1569,9 +1542,36 @@ export class SecretManagerServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.testIamPermissions(request); + * @example include:samples/generated/v1/secret_manager_service.test_iam_permissions.js + * region_tag:secretmanager_v1_generated_SecretManagerService_TestIamPermissions_async */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; testIamPermissions( request?: protos.google.iam.v1.ITestIamPermissionsRequest, optionsOrCallback?: @@ -1612,37 +1612,6 @@ export class SecretManagerServiceClient { return this.innerApiCalls.testIamPermissions(request, options, callback); } - listSecrets( - request?: protos.google.cloud.secretmanager.v1.IListSecretsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.secretmanager.v1.ISecret[], - protos.google.cloud.secretmanager.v1.IListSecretsRequest | null, - protos.google.cloud.secretmanager.v1.IListSecretsResponse - ] - >; - listSecrets( - request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.secretmanager.v1.IListSecretsRequest, - | protos.google.cloud.secretmanager.v1.IListSecretsResponse - | null - | undefined, - protos.google.cloud.secretmanager.v1.ISecret - > - ): void; - listSecrets( - request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, - callback: PaginationCallback< - protos.google.cloud.secretmanager.v1.IListSecretsRequest, - | protos.google.cloud.secretmanager.v1.IListSecretsResponse - | null - | undefined, - protos.google.cloud.secretmanager.v1.ISecret - > - ): void; /** * Lists {@link google.cloud.secretmanager.v1.Secret|Secrets}. * @@ -1677,6 +1646,37 @@ export class SecretManagerServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listSecrets( + request?: protos.google.cloud.secretmanager.v1.IListSecretsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1.ISecret[], + protos.google.cloud.secretmanager.v1.IListSecretsRequest | null, + protos.google.cloud.secretmanager.v1.IListSecretsResponse + ] + >; + listSecrets( + request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1.IListSecretsRequest, + | protos.google.cloud.secretmanager.v1.IListSecretsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1.ISecret + > + ): void; + listSecrets( + request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1.IListSecretsRequest, + | protos.google.cloud.secretmanager.v1.IListSecretsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1.ISecret + > + ): void; listSecrets( request?: protos.google.cloud.secretmanager.v1.IListSecretsRequest, optionsOrCallback?: @@ -1765,7 +1765,8 @@ export class SecretManagerServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecrets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecrets.createStream( this.innerApiCalls.listSecrets as gax.GaxCall, @@ -1806,11 +1807,8 @@ export class SecretManagerServiceClient { * 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.listSecretsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/secret_manager_service.list_secrets.js + * region_tag:secretmanager_v1_generated_SecretManagerService_ListSecrets_async */ listSecretsAsync( request?: protos.google.cloud.secretmanager.v1.IListSecretsRequest, @@ -1824,8 +1822,8 @@ export class SecretManagerServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecrets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecrets.asyncIterate( this.innerApiCalls['listSecrets'] as GaxCall, @@ -1833,37 +1831,6 @@ export class SecretManagerServiceClient { callSettings ) as AsyncIterable; } - listSecretVersions( - request?: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.secretmanager.v1.ISecretVersion[], - protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest | null, - protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse - ] - >; - listSecretVersions( - request: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, - | protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse - | null - | undefined, - protos.google.cloud.secretmanager.v1.ISecretVersion - > - ): void; - listSecretVersions( - request: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, - | protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse - | null - | undefined, - protos.google.cloud.secretmanager.v1.ISecretVersion - > - ): void; /** * Lists {@link google.cloud.secretmanager.v1.SecretVersion|SecretVersions}. This call does not return secret * data. @@ -1900,6 +1867,37 @@ export class SecretManagerServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listSecretVersions( + request?: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.secretmanager.v1.ISecretVersion[], + protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest | null, + protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse + ] + >; + listSecretVersions( + request: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, + | protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1.ISecretVersion + > + ): void; + listSecretVersions( + request: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, + | protos.google.cloud.secretmanager.v1.IListSecretVersionsResponse + | null + | undefined, + protos.google.cloud.secretmanager.v1.ISecretVersion + > + ): void; listSecretVersions( request?: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, optionsOrCallback?: @@ -1989,7 +1987,8 @@ export class SecretManagerServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecretVersions']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecretVersions.createStream( this.innerApiCalls.listSecretVersions as gax.GaxCall, @@ -2031,11 +2030,8 @@ export class SecretManagerServiceClient { * 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.listSecretVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/secret_manager_service.list_secret_versions.js + * region_tag:secretmanager_v1_generated_SecretManagerService_ListSecretVersions_async */ listSecretVersionsAsync( request?: protos.google.cloud.secretmanager.v1.IListSecretVersionsRequest, @@ -2049,8 +2045,8 @@ export class SecretManagerServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listSecretVersions']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSecretVersions.asyncIterate( this.innerApiCalls['listSecretVersions'] as GaxCall,