Skip to content

Commit f520e33

Browse files
gcf-owl-bot[bot]kelskBenjamin E. Coe
authored
docs(samples): add auto-generated samples for Node with api short name in region tag (#297)
* docs(samples): add auto-generated samples for Node with api short name in region tag PiperOrigin-RevId: 399287285 Source-Link: googleapis/googleapis@1575986 Source-Link: googleapis/googleapis-gen@b27fff6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: bump engines Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: kelsk <[email protected]> Co-authored-by: Benjamin E. Coe <[email protected]>
1 parent 7e7779b commit f520e33

16 files changed

+842
-7
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
function main(parent, notes) {
18+
// [START containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
24+
* the notes are to be created.
25+
*/
26+
// const parent = 'abc123'
27+
/**
28+
* The notes to create. Max allowed length is 1000.
29+
*/
30+
// const notes = 1234
31+
32+
// Imports the Grafeas library
33+
const {GrafeasClient} = require('@google-cloud/grafeas').v1;
34+
35+
// Instantiates a client
36+
const grafeasClient = new GrafeasClient();
37+
38+
async function batchCreateNotes() {
39+
// Construct request
40+
const request = {
41+
parent,
42+
notes,
43+
};
44+
45+
// Run request
46+
const response = await grafeasClient.batchCreateNotes(request);
47+
console.log(response);
48+
}
49+
50+
batchCreateNotes();
51+
// [END containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async]
52+
}
53+
54+
process.on('unhandledRejection', err => {
55+
console.error(err.message);
56+
process.exitCode = 1;
57+
});
58+
main(...process.argv.slice(2));
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
function main(parent, occurrences) {
18+
// [START containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
24+
* the occurrences are to be created.
25+
*/
26+
// const parent = 'abc123'
27+
/**
28+
* The occurrences to create. Max allowed length is 1000.
29+
*/
30+
// const occurrences = 1234
31+
32+
// Imports the Grafeas library
33+
const {GrafeasClient} = require('@google-cloud/grafeas').v1;
34+
35+
// Instantiates a client
36+
const grafeasClient = new GrafeasClient();
37+
38+
async function batchCreateOccurrences() {
39+
// Construct request
40+
const request = {
41+
parent,
42+
occurrences,
43+
};
44+
45+
// Run request
46+
const response = await grafeasClient.batchCreateOccurrences(request);
47+
console.log(response);
48+
}
49+
50+
batchCreateOccurrences();
51+
// [END containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async]
52+
}
53+
54+
process.on('unhandledRejection', err => {
55+
console.error(err.message);
56+
process.exitCode = 1;
57+
});
58+
main(...process.argv.slice(2));
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
function main(parent, noteId, note) {
18+
// [START containeranalysis_v1_generated_Grafeas_CreateNote_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
24+
* the note is to be created.
25+
*/
26+
// const parent = 'abc123'
27+
/**
28+
* The ID to use for this note.
29+
*/
30+
// const noteId = 'abc123'
31+
/**
32+
* The note to create.
33+
*/
34+
// const note = ''
35+
36+
// Imports the Grafeas library
37+
const {GrafeasClient} = require('@google-cloud/grafeas').v1;
38+
39+
// Instantiates a client
40+
const grafeasClient = new GrafeasClient();
41+
42+
async function createNote() {
43+
// Construct request
44+
const request = {
45+
parent,
46+
noteId,
47+
note,
48+
};
49+
50+
// Run request
51+
const response = await grafeasClient.createNote(request);
52+
console.log(response);
53+
}
54+
55+
createNote();
56+
// [END containeranalysis_v1_generated_Grafeas_CreateNote_async]
57+
}
58+
59+
process.on('unhandledRejection', err => {
60+
console.error(err.message);
61+
process.exitCode = 1;
62+
});
63+
main(...process.argv.slice(2));
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
function main(parent, occurrence) {
18+
// [START containeranalysis_v1_generated_Grafeas_CreateOccurrence_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* The name of the project in the form of `projects/[PROJECT_ID]`, under which
24+
* the occurrence is to be created.
25+
*/
26+
// const parent = 'abc123'
27+
/**
28+
* The occurrence to create.
29+
*/
30+
// const occurrence = ''
31+
32+
// Imports the Grafeas library
33+
const {GrafeasClient} = require('@google-cloud/grafeas').v1;
34+
35+
// Instantiates a client
36+
const grafeasClient = new GrafeasClient();
37+
38+
async function createOccurrence() {
39+
// Construct request
40+
const request = {
41+
parent,
42+
occurrence,
43+
};
44+
45+
// Run request
46+
const response = await grafeasClient.createOccurrence(request);
47+
console.log(response);
48+
}
49+
50+
createOccurrence();
51+
// [END containeranalysis_v1_generated_Grafeas_CreateOccurrence_async]
52+
}
53+
54+
process.on('unhandledRejection', err => {
55+
console.error(err.message);
56+
process.exitCode = 1;
57+
});
58+
main(...process.argv.slice(2));
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
function main(name) {
18+
// [START containeranalysis_v1_generated_Grafeas_DeleteNote_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* The name of the note in the form of
24+
* `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
25+
*/
26+
// const name = 'abc123'
27+
28+
// Imports the Grafeas library
29+
const {GrafeasClient} = require('@google-cloud/grafeas').v1;
30+
31+
// Instantiates a client
32+
const grafeasClient = new GrafeasClient();
33+
34+
async function deleteNote() {
35+
// Construct request
36+
const request = {
37+
name,
38+
};
39+
40+
// Run request
41+
const response = await grafeasClient.deleteNote(request);
42+
console.log(response);
43+
}
44+
45+
deleteNote();
46+
// [END containeranalysis_v1_generated_Grafeas_DeleteNote_async]
47+
}
48+
49+
process.on('unhandledRejection', err => {
50+
console.error(err.message);
51+
process.exitCode = 1;
52+
});
53+
main(...process.argv.slice(2));
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
function main(name) {
18+
// [START containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* The name of the occurrence in the form of
24+
* `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
25+
*/
26+
// const name = 'abc123'
27+
28+
// Imports the Grafeas library
29+
const {GrafeasClient} = require('@google-cloud/grafeas').v1;
30+
31+
// Instantiates a client
32+
const grafeasClient = new GrafeasClient();
33+
34+
async function deleteOccurrence() {
35+
// Construct request
36+
const request = {
37+
name,
38+
};
39+
40+
// Run request
41+
const response = await grafeasClient.deleteOccurrence(request);
42+
console.log(response);
43+
}
44+
45+
deleteOccurrence();
46+
// [END containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async]
47+
}
48+
49+
process.on('unhandledRejection', err => {
50+
console.error(err.message);
51+
process.exitCode = 1;
52+
});
53+
main(...process.argv.slice(2));

0 commit comments

Comments
 (0)