Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#50)
Browse files Browse the repository at this point in the history
- [ ] 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
gcf-owl-bot[bot] authored Nov 10, 2021
1 parent 5a00939 commit dccf6e9
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 107 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-vpc-access/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,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));
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));
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));
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));
Loading

0 comments on commit dccf6e9

Please sign in to comment.