-
Notifications
You must be signed in to change notification settings - Fork 592
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 (#75)
* 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
1 parent
a05ad01
commit 36f95af
Showing
17 changed files
with
1,307 additions
and
432 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 | ||
} |
65 changes: 65 additions & 0 deletions
65
packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api.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,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)); |
65 changes: 65 additions & 0 deletions
65
...ges/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api_config.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,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)); |
65 changes: 65 additions & 0 deletions
65
packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_gateway.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,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)); |
54 changes: 54 additions & 0 deletions
54
packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api.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,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)); |
54 changes: 54 additions & 0 deletions
54
...ges/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api_config.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,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)); |
54 changes: 54 additions & 0 deletions
54
packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_gateway.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,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)); |
Oops, something went wrong.