Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#75)
Browse files Browse the repository at this point in the history
* docs(samples): add example tags to generated samples

PiperOrigin-RevId: 408439482

Source-Link: googleapis/googleapis@b9f6184

Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 11, 2021
1 parent a05ad01 commit 36f95af
Show file tree
Hide file tree
Showing 17 changed files with 1,307 additions and 432 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-apigateway/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,65 @@
// 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, apiId, api) {
// [START apigateway_v1_generated_ApiGatewayService_CreateApi_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent resource of the API, of the form:
* `projects/* /locations/global`
*/
// const parent = 'abc123'
/**
* Required. Identifier to assign to the API. Must be unique within scope of
* the parent resource.
*/
// const apiId = 'abc123'
/**
* Required. API resource.
*/
// const api = {}

// Imports the Apigateway library
const {ApiGatewayServiceClient} = require('@google-cloud/api-gateway').v1;

// Instantiates a client
const apigatewayClient = new ApiGatewayServiceClient();

async function callCreateApi() {
// Construct request
const request = {
parent,
apiId,
api,
};

// Run request
const [operation] = await apigatewayClient.createApi(request);
const [response] = await operation.promise();
console.log(response);
}

callCreateApi();
// [END apigateway_v1_generated_ApiGatewayService_CreateApi_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,65 @@
// 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, apiConfigId, apiConfig) {
// [START apigateway_v1_generated_ApiGatewayService_CreateApiConfig_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent resource of the API Config, of the form:
* `projects/* /locations/global/apis/*`
*/
// const parent = 'abc123'
/**
* Required. Identifier to assign to the API Config. Must be unique within scope of
* the parent resource.
*/
// const apiConfigId = 'abc123'
/**
* Required. API resource.
*/
// const apiConfig = {}

// Imports the Apigateway library
const {ApiGatewayServiceClient} = require('@google-cloud/api-gateway').v1;

// Instantiates a client
const apigatewayClient = new ApiGatewayServiceClient();

async function callCreateApiConfig() {
// Construct request
const request = {
parent,
apiConfigId,
apiConfig,
};

// Run request
const [operation] = await apigatewayClient.createApiConfig(request);
const [response] = await operation.promise();
console.log(response);
}

callCreateApiConfig();
// [END apigateway_v1_generated_ApiGatewayService_CreateApiConfig_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,65 @@
// 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, gatewayId, gateway) {
// [START apigateway_v1_generated_ApiGatewayService_CreateGateway_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent resource of the Gateway, of the form:
* `projects/* /locations/*`
*/
// const parent = 'abc123'
/**
* Required. Identifier to assign to the Gateway. Must be unique within scope of
* the parent resource.
*/
// const gatewayId = 'abc123'
/**
* Required. Gateway resource.
*/
// const gateway = {}

// Imports the Apigateway library
const {ApiGatewayServiceClient} = require('@google-cloud/api-gateway').v1;

// Instantiates a client
const apigatewayClient = new ApiGatewayServiceClient();

async function callCreateGateway() {
// Construct request
const request = {
parent,
gatewayId,
gateway,
};

// Run request
const [operation] = await apigatewayClient.createGateway(request);
const [response] = await operation.promise();
console.log(response);
}

callCreateGateway();
// [END apigateway_v1_generated_ApiGatewayService_CreateGateway_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,54 @@
// 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 apigateway_v1_generated_ApiGatewayService_DeleteApi_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the form:
* `projects/* /locations/global/apis/*`
*/
// const name = 'abc123'

// Imports the Apigateway library
const {ApiGatewayServiceClient} = require('@google-cloud/api-gateway').v1;

// Instantiates a client
const apigatewayClient = new ApiGatewayServiceClient();

async function callDeleteApi() {
// Construct request
const request = {
name,
};

// Run request
const [operation] = await apigatewayClient.deleteApi(request);
const [response] = await operation.promise();
console.log(response);
}

callDeleteApi();
// [END apigateway_v1_generated_ApiGatewayService_DeleteApi_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,54 @@
// 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 apigateway_v1_generated_ApiGatewayService_DeleteApiConfig_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the form:
* `projects/* /locations/global/apis/* /configs/*`
*/
// const name = 'abc123'

// Imports the Apigateway library
const {ApiGatewayServiceClient} = require('@google-cloud/api-gateway').v1;

// Instantiates a client
const apigatewayClient = new ApiGatewayServiceClient();

async function callDeleteApiConfig() {
// Construct request
const request = {
name,
};

// Run request
const [operation] = await apigatewayClient.deleteApiConfig(request);
const [response] = await operation.promise();
console.log(response);
}

callDeleteApiConfig();
// [END apigateway_v1_generated_ApiGatewayService_DeleteApiConfig_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,54 @@
// 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 apigateway_v1_generated_ApiGatewayService_DeleteGateway_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the form:
* `projects/* /locations/* /gateways/*`
*/
// const name = 'abc123'

// Imports the Apigateway library
const {ApiGatewayServiceClient} = require('@google-cloud/api-gateway').v1;

// Instantiates a client
const apigatewayClient = new ApiGatewayServiceClient();

async function callDeleteGateway() {
// Construct request
const request = {
name,
};

// Run request
const [operation] = await apigatewayClient.deleteGateway(request);
const [response] = await operation.promise();
console.log(response);
}

callDeleteGateway();
// [END apigateway_v1_generated_ApiGatewayService_DeleteGateway_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading

0 comments on commit 36f95af

Please sign in to comment.