-
Notifications
You must be signed in to change notification settings - Fork 598
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 (#50)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 408439482 Source-Link: googleapis/googleapis@b9f6184 Source-Link: googleapis/googleapis-gen@eb888bc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
- Loading branch information
1 parent
5a00939
commit dccf6e9
Showing
6 changed files
with
328 additions
and
107 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 | ||
} |
64 changes: 64 additions & 0 deletions
64
packages/google-cloud-vpc-access/samples/generated/v1/vpc_access_service.create_connector.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,64 @@ | ||
// 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, connectorId, connector) { | ||
// [START vpcaccess_v1_generated_VpcAccessService_CreateConnector_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The project and location in which the configuration should be created, | ||
* specified in the format `projects/* /locations/*`. | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Required. The ID to use for this connector. | ||
*/ | ||
// const connectorId = 'abc123' | ||
/** | ||
* Required. Resource to create. | ||
*/ | ||
// const connector = {} | ||
|
||
// Imports the Vpcaccess library | ||
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1; | ||
|
||
// Instantiates a client | ||
const vpcaccessClient = new VpcAccessServiceClient(); | ||
|
||
async function callCreateConnector() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
connectorId, | ||
connector, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await vpcaccessClient.createConnector(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callCreateConnector(); | ||
// [END vpcaccess_v1_generated_VpcAccessService_CreateConnector_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
53 changes: 53 additions & 0 deletions
53
packages/google-cloud-vpc-access/samples/generated/v1/vpc_access_service.delete_connector.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,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 vpcaccess_v1_generated_VpcAccessService_DeleteConnector_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Name of a Serverless VPC Access connector to delete. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Vpcaccess library | ||
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1; | ||
|
||
// Instantiates a client | ||
const vpcaccessClient = new VpcAccessServiceClient(); | ||
|
||
async function callDeleteConnector() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await vpcaccessClient.deleteConnector(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callDeleteConnector(); | ||
// [END vpcaccess_v1_generated_VpcAccessService_DeleteConnector_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
52 changes: 52 additions & 0 deletions
52
packages/google-cloud-vpc-access/samples/generated/v1/vpc_access_service.get_connector.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,52 @@ | ||
// 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 vpcaccess_v1_generated_VpcAccessService_GetConnector_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Name of a Serverless VPC Access connector to get. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Vpcaccess library | ||
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1; | ||
|
||
// Instantiates a client | ||
const vpcaccessClient = new VpcAccessServiceClient(); | ||
|
||
async function callGetConnector() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await vpcaccessClient.getConnector(request); | ||
console.log(response); | ||
} | ||
|
||
callGetConnector(); | ||
// [END vpcaccess_v1_generated_VpcAccessService_GetConnector_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
62 changes: 62 additions & 0 deletions
62
packages/google-cloud-vpc-access/samples/generated/v1/vpc_access_service.list_connectors.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,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(parent) { | ||
// [START vpcaccess_v1_generated_VpcAccessService_ListConnectors_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The project and location from which the routes should be listed. | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Maximum number of functions to return per call. | ||
*/ | ||
// const pageSize = 1234 | ||
/** | ||
* Continuation token. | ||
*/ | ||
// const pageToken = 'abc123' | ||
|
||
// Imports the Vpcaccess library | ||
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1; | ||
|
||
// Instantiates a client | ||
const vpcaccessClient = new VpcAccessServiceClient(); | ||
|
||
async function callListConnectors() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
}; | ||
|
||
// Run request | ||
const iterable = await vpcaccessClient.listConnectorsAsync(request); | ||
for await (const response of iterable) { | ||
console.log(response); | ||
} | ||
} | ||
|
||
callListConnectors(); | ||
// [END vpcaccess_v1_generated_VpcAccessService_ListConnectors_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.