-
Notifications
You must be signed in to change notification settings - Fork 596
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 (#99)
- [ ] 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
8fd9a88
commit d2bd0da
Showing
18 changed files
with
1,423 additions
and
515 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 | ||
} |
53 changes: 53 additions & 0 deletions
53
packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.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(service) { | ||
// [START servicemanagement_v1_generated_ServiceManager_CreateService_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Initial values for the service resource. | ||
*/ | ||
// const service = {} | ||
|
||
// Imports the Servicemanagement library | ||
const {ServiceManagerClient} = require('@google-cloud/service-management').v1; | ||
|
||
// Instantiates a client | ||
const servicemanagementClient = new ServiceManagerClient(); | ||
|
||
async function callCreateService() { | ||
// Construct request | ||
const request = { | ||
service, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await servicemanagementClient.createService(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callCreateService(); | ||
// [END servicemanagement_v1_generated_ServiceManager_CreateService_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
58 changes: 58 additions & 0 deletions
58
...oogle-api-servicemanagement/samples/generated/v1/service_manager.create_service_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,58 @@ | ||
// 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(serviceName, serviceConfig) { | ||
// [START servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the service. See the overview (https://cloud.google.com/service-management/overview) | ||
* for naming requirements. For example: `example.googleapis.com`. | ||
*/ | ||
// const serviceName = 'abc123' | ||
/** | ||
* Required. The service configuration resource. | ||
*/ | ||
// const serviceConfig = {} | ||
|
||
// Imports the Servicemanagement library | ||
const {ServiceManagerClient} = require('@google-cloud/service-management').v1; | ||
|
||
// Instantiates a client | ||
const servicemanagementClient = new ServiceManagerClient(); | ||
|
||
async function callCreateServiceConfig() { | ||
// Construct request | ||
const request = { | ||
serviceName, | ||
serviceConfig, | ||
}; | ||
|
||
// Run request | ||
const response = await servicemanagementClient.createServiceConfig(request); | ||
console.log(response); | ||
} | ||
|
||
callCreateServiceConfig(); | ||
// [END servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
61 changes: 61 additions & 0 deletions
61
...ogle-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.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,61 @@ | ||
// 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(serviceName, rollout) { | ||
// [START servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the service. See the overview (https://cloud.google.com/service-management/overview) | ||
* for naming requirements. For example: `example.googleapis.com`. | ||
*/ | ||
// const serviceName = 'abc123' | ||
/** | ||
* Required. The rollout resource. The `service_name` field is output only. | ||
*/ | ||
// const rollout = {} | ||
|
||
// Imports the Servicemanagement library | ||
const {ServiceManagerClient} = require('@google-cloud/service-management').v1; | ||
|
||
// Instantiates a client | ||
const servicemanagementClient = new ServiceManagerClient(); | ||
|
||
async function callCreateServiceRollout() { | ||
// Construct request | ||
const request = { | ||
serviceName, | ||
rollout, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await servicemanagementClient.createServiceRollout( | ||
request | ||
); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callCreateServiceRollout(); | ||
// [END servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_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-api-servicemanagement/samples/generated/v1/service_manager.delete_service.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(serviceName) { | ||
// [START servicemanagement_v1_generated_ServiceManager_DeleteService_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the service. See the overview (https://cloud.google.com/service-management/overview) | ||
* for naming requirements. For example: `example.googleapis.com`. | ||
*/ | ||
// const serviceName = 'abc123' | ||
|
||
// Imports the Servicemanagement library | ||
const {ServiceManagerClient} = require('@google-cloud/service-management').v1; | ||
|
||
// Instantiates a client | ||
const servicemanagementClient = new ServiceManagerClient(); | ||
|
||
async function callDeleteService() { | ||
// Construct request | ||
const request = { | ||
serviceName, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await servicemanagementClient.deleteService(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callDeleteService(); | ||
// [END servicemanagement_v1_generated_ServiceManager_DeleteService_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
65 changes: 65 additions & 0 deletions
65
...ages/google-api-servicemanagement/samples/generated/v1/service_manager.disable_service.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(serviceName, consumerId) { | ||
// [START servicemanagement_v1_generated_ServiceManager_DisableService_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Name of the service to disable. Specifying an unknown service name | ||
* will cause the request to fail. | ||
*/ | ||
// const serviceName = 'abc123' | ||
/** | ||
* Required. The identity of consumer resource which service disablement will be | ||
* applied to. | ||
* The Google Service Management implementation accepts the following | ||
* forms: | ||
* - "project:<project_id>" | ||
* Note: this is made compatible with | ||
* google.api.servicecontrol.v1.Operation.consumer_id. | ||
*/ | ||
// const consumerId = 'abc123' | ||
|
||
// Imports the Servicemanagement library | ||
const {ServiceManagerClient} = require('@google-cloud/service-management').v1; | ||
|
||
// Instantiates a client | ||
const servicemanagementClient = new ServiceManagerClient(); | ||
|
||
async function callDisableService() { | ||
// Construct request | ||
const request = { | ||
serviceName, | ||
consumerId, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await servicemanagementClient.disableService(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callDisableService(); | ||
// [END servicemanagement_v1_generated_ServiceManager_DisableService_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-api-servicemanagement/samples/generated/v1/service_manager.enable_service.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(serviceName, consumerId) { | ||
// [START servicemanagement_v1_generated_ServiceManager_EnableService_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Name of the service to enable. Specifying an unknown service name will | ||
* cause the request to fail. | ||
*/ | ||
// const serviceName = 'abc123' | ||
/** | ||
* Required. The identity of consumer resource which service enablement will be | ||
* applied to. | ||
* The Google Service Management implementation accepts the following | ||
* forms: | ||
* - "project:<project_id>" | ||
* Note: this is made compatible with | ||
* google.api.servicecontrol.v1.Operation.consumer_id. | ||
*/ | ||
// const consumerId = 'abc123' | ||
|
||
// Imports the Servicemanagement library | ||
const {ServiceManagerClient} = require('@google-cloud/service-management').v1; | ||
|
||
// Instantiates a client | ||
const servicemanagementClient = new ServiceManagerClient(); | ||
|
||
async function callEnableService() { | ||
// Construct request | ||
const request = { | ||
serviceName, | ||
consumerId, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await servicemanagementClient.enableService(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callEnableService(); | ||
// [END servicemanagement_v1_generated_ServiceManager_EnableService_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.