-
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: fix docstring formatting and add generated samples (#84)
* docs: fix docstring formatting Committer: @parthea PiperOrigin-RevId: 404008335 Source-Link: googleapis/googleapis@4dd6036 Source-Link: googleapis/googleapis-gen@5fb830d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWZiODMwZDRiMmQ4NzNhOTgyYzJhYzhhMDQwODdiMDIxZjNiMjQwOCJ9 * 🦉 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
9c8a6b6
commit c2e630c
Showing
4 changed files
with
204 additions
and
4 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
62 changes: 62 additions & 0 deletions
62
packages/google-api-servicecontrol/samples/generated/v1/quota_controller.allocate_quota.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() { | ||
// [START servicecontrol_v1_generated_QuotaController_AllocateQuota_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Name of the service as specified in the service configuration. For example, | ||
* `"pubsub.googleapis.com"`. | ||
* See [google.api.Service][google.api.Service] for the definition of a service name. | ||
*/ | ||
// const serviceName = 'abc123' | ||
/** | ||
* Operation that describes the quota allocation. | ||
*/ | ||
// const allocateOperation = '' | ||
/** | ||
* Specifies which version of service configuration should be used to process | ||
* the request. If unspecified or no matching version can be found, the latest | ||
* one will be used. | ||
*/ | ||
// const serviceConfigId = 'abc123' | ||
|
||
// Imports the Servicecontrol library | ||
const {QuotaControllerClient} = require('@google-cloud/service-control').v1; | ||
|
||
// Instantiates a client | ||
const servicecontrolClient = new QuotaControllerClient(); | ||
|
||
async function allocateQuota() { | ||
// Construct request | ||
const request = {}; | ||
|
||
// Run request | ||
const response = await servicecontrolClient.allocateQuota(request); | ||
console.log(response); | ||
} | ||
|
||
allocateQuota(); | ||
// [END servicecontrol_v1_generated_QuotaController_AllocateQuota_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-servicecontrol/samples/generated/v1/service_controller.check.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() { | ||
// [START servicecontrol_v1_generated_ServiceController_Check_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* The service name as specified in its service configuration. For example, | ||
* `"pubsub.googleapis.com"`. | ||
* See | ||
* [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) | ||
* for the definition of a service name. | ||
*/ | ||
// const serviceName = 'abc123' | ||
/** | ||
* The operation to be checked. | ||
*/ | ||
// const operation = '' | ||
/** | ||
* Specifies which version of service configuration should be used to process | ||
* the request. | ||
* If unspecified or no matching version can be found, the | ||
* latest one will be used. | ||
*/ | ||
// const serviceConfigId = 'abc123' | ||
|
||
// Imports the Servicecontrol library | ||
const {ServiceControllerClient} = require('@google-cloud/service-control').v1; | ||
|
||
// Instantiates a client | ||
const servicecontrolClient = new ServiceControllerClient(); | ||
|
||
async function check() { | ||
// Construct request | ||
const request = {}; | ||
|
||
// Run request | ||
const response = await servicecontrolClient.check(request); | ||
console.log(response); | ||
} | ||
|
||
check(); | ||
// [END servicecontrol_v1_generated_ServiceController_Check_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
73 changes: 73 additions & 0 deletions
73
packages/google-api-servicecontrol/samples/generated/v1/service_controller.report.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,73 @@ | ||
// 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() { | ||
// [START servicecontrol_v1_generated_ServiceController_Report_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* The service name as specified in its service configuration. For example, | ||
* `"pubsub.googleapis.com"`. | ||
* See | ||
* [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) | ||
* for the definition of a service name. | ||
*/ | ||
// const serviceName = 'abc123' | ||
/** | ||
* Operations to be reported. | ||
* Typically the service should report one operation per request. | ||
* Putting multiple operations into a single request is allowed, but should | ||
* be used only when multiple operations are natually available at the time | ||
* of the report. | ||
* There is no limit on the number of operations in the same ReportRequest, | ||
* however the ReportRequest size should be no larger than 1MB. See | ||
* [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors] | ||
* for partial failure behavior. | ||
*/ | ||
// const operations = 1234 | ||
/** | ||
* Specifies which version of service config should be used to process the | ||
* request. | ||
* If unspecified or no matching version can be found, the | ||
* latest one will be used. | ||
*/ | ||
// const serviceConfigId = 'abc123' | ||
|
||
// Imports the Servicecontrol library | ||
const {ServiceControllerClient} = require('@google-cloud/service-control').v1; | ||
|
||
// Instantiates a client | ||
const servicecontrolClient = new ServiceControllerClient(); | ||
|
||
async function report() { | ||
// Construct request | ||
const request = {}; | ||
|
||
// Run request | ||
const response = await servicecontrolClient.report(request); | ||
console.log(response); | ||
} | ||
|
||
report(); | ||
// [END servicecontrol_v1_generated_ServiceController_Report_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |