-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(samples): add example tags to generated samples (#312)
PiperOrigin-RevId: 408439482 Source-Link: googleapis/googleapis@b9f6184 Source-Link: googleapis/googleapis-gen@eb888bc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
- Loading branch information
1 parent
bf80632
commit 6bc8569
Showing
18 changed files
with
1,306 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ | |
"img.shields.io" | ||
], | ||
"silent": true, | ||
"concurrency": 10 | ||
"concurrency": 5 | ||
} |
56 changes: 56 additions & 0 deletions
56
...-cloud-secretmanager/samples/generated/v1/secret_manager_service.access_secret_version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
59 changes: 59 additions & 0 deletions
59
...gle-cloud-secretmanager/samples/generated/v1/secret_manager_service.add_secret_version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
67 changes: 67 additions & 0 deletions
67
...s/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.create_secret.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
60 changes: 60 additions & 0 deletions
60
...s/google-cloud-secretmanager/samples/generated/v1/secret_manager_service.delete_secret.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
60 changes: 60 additions & 0 deletions
60
...cloud-secretmanager/samples/generated/v1/secret_manager_service.destroy_secret_version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
60 changes: 60 additions & 0 deletions
60
...cloud-secretmanager/samples/generated/v1/secret_manager_service.disable_secret_version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
Oops, something went wrong.