-
Notifications
You must be signed in to change notification settings - Fork 2k
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 (#287)
* docs(samples): add example tags to generated samples PiperOrigin-RevId: 408439482 Source-Link: googleapis/googleapis@b9f6184 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: change node version for sample Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Takashi Matsuo <tmatsuo@google.com>
- Loading branch information
1 parent
b0301ab
commit 315dd21
Showing
19 changed files
with
1,158 additions
and
1 deletion.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
generated,README.md,.eslintrc.yml/generated/v1/cloud_build.approve_build.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(name) { | ||
// [START cloudbuild_v1_generated_CloudBuild_ApproveBuild_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Name of the target build. | ||
* For example: "projects/{$project_id}/builds/{$build_id}" | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* Approval decision and metadata. | ||
*/ | ||
// const approvalResult = {} | ||
|
||
// Imports the Cloudbuild library | ||
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; | ||
|
||
// Instantiates a client | ||
const cloudbuildClient = new CloudBuildClient(); | ||
|
||
async function callApproveBuild() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await cloudbuildClient.approveBuild(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callApproveBuild(); | ||
// [END cloudbuild_v1_generated_CloudBuild_ApproveBuild_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
62 changes: 62 additions & 0 deletions
62
generated,README.md,.eslintrc.yml/generated/v1/cloud_build.cancel_build.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(projectId, id) { | ||
// [START cloudbuild_v1_generated_CloudBuild_CancelBuild_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* The name of the `Build` to cancel. | ||
* Format: `projects/{project}/locations/{location}/builds/{build}` | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* Required. ID of the project. | ||
*/ | ||
// const projectId = 'abc123' | ||
/** | ||
* Required. ID of the build. | ||
*/ | ||
// const id = 'abc123' | ||
|
||
// Imports the Cloudbuild library | ||
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; | ||
|
||
// Instantiates a client | ||
const cloudbuildClient = new CloudBuildClient(); | ||
|
||
async function callCancelBuild() { | ||
// Construct request | ||
const request = { | ||
projectId, | ||
id, | ||
}; | ||
|
||
// Run request | ||
const response = await cloudbuildClient.cancelBuild(request); | ||
console.log(response); | ||
} | ||
|
||
callCancelBuild(); | ||
// [END cloudbuild_v1_generated_CloudBuild_CancelBuild_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
63 changes: 63 additions & 0 deletions
63
generated,README.md,.eslintrc.yml/generated/v1/cloud_build.create_build.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,63 @@ | ||
// 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(projectId, build) { | ||
// [START cloudbuild_v1_generated_CloudBuild_CreateBuild_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* The parent resource where this build will be created. | ||
* Format: `projects/{project}/locations/{location}` | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Required. ID of the project. | ||
*/ | ||
// const projectId = 'abc123' | ||
/** | ||
* Required. Build resource to create. | ||
*/ | ||
// const build = {} | ||
|
||
// Imports the Cloudbuild library | ||
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; | ||
|
||
// Instantiates a client | ||
const cloudbuildClient = new CloudBuildClient(); | ||
|
||
async function callCreateBuild() { | ||
// Construct request | ||
const request = { | ||
projectId, | ||
build, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await cloudbuildClient.createBuild(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callCreateBuild(); | ||
// [END cloudbuild_v1_generated_CloudBuild_CreateBuild_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
62 changes: 62 additions & 0 deletions
62
generated,README.md,.eslintrc.yml/generated/v1/cloud_build.create_build_trigger.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(projectId, trigger) { | ||
// [START cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* The parent resource where this trigger will be created. | ||
* Format: `projects/{project}/locations/{location}` | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Required. ID of the project for which to configure automatic builds. | ||
*/ | ||
// const projectId = 'abc123' | ||
/** | ||
* Required. `BuildTrigger` to create. | ||
*/ | ||
// const trigger = {} | ||
|
||
// Imports the Cloudbuild library | ||
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; | ||
|
||
// Instantiates a client | ||
const cloudbuildClient = new CloudBuildClient(); | ||
|
||
async function callCreateBuildTrigger() { | ||
// Construct request | ||
const request = { | ||
projectId, | ||
trigger, | ||
}; | ||
|
||
// Run request | ||
const response = await cloudbuildClient.createBuildTrigger(request); | ||
console.log(response); | ||
} | ||
|
||
callCreateBuildTrigger(); | ||
// [END cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
72 changes: 72 additions & 0 deletions
72
generated,README.md,.eslintrc.yml/generated/v1/cloud_build.create_worker_pool.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,72 @@ | ||
// 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, workerPool, workerPoolId) { | ||
// [START cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The parent resource where this worker pool will be created. | ||
* Format: `projects/{project}/locations/{location}`. | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Required. `WorkerPool` resource to create. | ||
*/ | ||
// const workerPool = {} | ||
/** | ||
* Required. Immutable. The ID to use for the `WorkerPool`, which will become | ||
* the final component of the resource name. | ||
* This value should be 1-63 characters, and valid characters | ||
* are /[a-z][0-9]-/. | ||
*/ | ||
// const workerPoolId = 'abc123' | ||
/** | ||
* If set, validate the request and preview the response, but do not actually | ||
* post it. | ||
*/ | ||
// const validateOnly = true | ||
|
||
// Imports the Cloudbuild library | ||
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; | ||
|
||
// Instantiates a client | ||
const cloudbuildClient = new CloudBuildClient(); | ||
|
||
async function callCreateWorkerPool() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
workerPool, | ||
workerPoolId, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await cloudbuildClient.createWorkerPool(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callCreateWorkerPool(); | ||
// [END cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
62 changes: 62 additions & 0 deletions
62
generated,README.md,.eslintrc.yml/generated/v1/cloud_build.delete_build_trigger.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(projectId, triggerId) { | ||
// [START cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* The name of the `Trigger` to delete. | ||
* Format: `projects/{project}/locations/{location}/triggers/{trigger}` | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* Required. ID of the project that owns the trigger. | ||
*/ | ||
// const projectId = 'abc123' | ||
/** | ||
* Required. ID of the `BuildTrigger` to delete. | ||
*/ | ||
// const triggerId = 'abc123' | ||
|
||
// Imports the Cloudbuild library | ||
const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; | ||
|
||
// Instantiates a client | ||
const cloudbuildClient = new CloudBuildClient(); | ||
|
||
async function callDeleteBuildTrigger() { | ||
// Construct request | ||
const request = { | ||
projectId, | ||
triggerId, | ||
}; | ||
|
||
// Run request | ||
const response = await cloudbuildClient.deleteBuildTrigger(request); | ||
console.log(response); | ||
} | ||
|
||
callDeleteBuildTrigger(); | ||
// [END cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.