Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#312)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 408439482
Source-Link: googleapis/googleapis@b9f6184
Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Nov 10, 2021
1 parent bf80632 commit 6bc8569
Show file tree
Hide file tree
Showing 18 changed files with 1,306 additions and 387 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-secretmanager/linkinator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"img.shields.io"
],
"silent": true,
"concurrency": 10
"concurrency": 5
}
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));
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));
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));
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));
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));
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));
Loading

0 comments on commit 6bc8569

Please sign in to comment.