Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 217a41d

Browse files
docs(samples): add example tags to generated samples (#633)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 408439482 Source-Link: googleapis/googleapis@b9f6184 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
1 parent 24a189d commit 217a41d

17 files changed

Lines changed: 977 additions & 278 deletions

linkinator.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"img.shields.io"
77
],
88
"silent": true,
9-
"concurrency": 10
9+
"concurrency": 5
1010
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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(document) {
18+
// [START language_v1_generated_LanguageService_AnalyzeEntities_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* Input document.
24+
*/
25+
// const document = {}
26+
/**
27+
* The encoding type used by the API to calculate offsets.
28+
*/
29+
// const encodingType = {}
30+
31+
// Imports the Language library
32+
const {LanguageServiceClient} = require('@google-cloud/language').v1;
33+
34+
// Instantiates a client
35+
const languageClient = new LanguageServiceClient();
36+
37+
async function callAnalyzeEntities() {
38+
// Construct request
39+
const request = {
40+
document,
41+
};
42+
43+
// Run request
44+
const response = await languageClient.analyzeEntities(request);
45+
console.log(response);
46+
}
47+
48+
callAnalyzeEntities();
49+
// [END language_v1_generated_LanguageService_AnalyzeEntities_async]
50+
}
51+
52+
process.on('unhandledRejection', err => {
53+
console.error(err.message);
54+
process.exitCode = 1;
55+
});
56+
main(...process.argv.slice(2));
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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(document) {
18+
// [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* Input document.
24+
*/
25+
// const document = {}
26+
/**
27+
* The encoding type used by the API to calculate offsets.
28+
*/
29+
// const encodingType = {}
30+
31+
// Imports the Language library
32+
const {LanguageServiceClient} = require('@google-cloud/language').v1;
33+
34+
// Instantiates a client
35+
const languageClient = new LanguageServiceClient();
36+
37+
async function callAnalyzeEntitySentiment() {
38+
// Construct request
39+
const request = {
40+
document,
41+
};
42+
43+
// Run request
44+
const response = await languageClient.analyzeEntitySentiment(request);
45+
console.log(response);
46+
}
47+
48+
callAnalyzeEntitySentiment();
49+
// [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_async]
50+
}
51+
52+
process.on('unhandledRejection', err => {
53+
console.error(err.message);
54+
process.exitCode = 1;
55+
});
56+
main(...process.argv.slice(2));
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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(document) {
18+
// [START language_v1_generated_LanguageService_AnalyzeSentiment_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* Input document.
24+
*/
25+
// const document = {}
26+
/**
27+
* The encoding type used by the API to calculate sentence offsets.
28+
*/
29+
// const encodingType = {}
30+
31+
// Imports the Language library
32+
const {LanguageServiceClient} = require('@google-cloud/language').v1;
33+
34+
// Instantiates a client
35+
const languageClient = new LanguageServiceClient();
36+
37+
async function callAnalyzeSentiment() {
38+
// Construct request
39+
const request = {
40+
document,
41+
};
42+
43+
// Run request
44+
const response = await languageClient.analyzeSentiment(request);
45+
console.log(response);
46+
}
47+
48+
callAnalyzeSentiment();
49+
// [END language_v1_generated_LanguageService_AnalyzeSentiment_async]
50+
}
51+
52+
process.on('unhandledRejection', err => {
53+
console.error(err.message);
54+
process.exitCode = 1;
55+
});
56+
main(...process.argv.slice(2));
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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(document) {
18+
// [START language_v1_generated_LanguageService_AnalyzeSyntax_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* Input document.
24+
*/
25+
// const document = {}
26+
/**
27+
* The encoding type used by the API to calculate offsets.
28+
*/
29+
// const encodingType = {}
30+
31+
// Imports the Language library
32+
const {LanguageServiceClient} = require('@google-cloud/language').v1;
33+
34+
// Instantiates a client
35+
const languageClient = new LanguageServiceClient();
36+
37+
async function callAnalyzeSyntax() {
38+
// Construct request
39+
const request = {
40+
document,
41+
};
42+
43+
// Run request
44+
const response = await languageClient.analyzeSyntax(request);
45+
console.log(response);
46+
}
47+
48+
callAnalyzeSyntax();
49+
// [END language_v1_generated_LanguageService_AnalyzeSyntax_async]
50+
}
51+
52+
process.on('unhandledRejection', err => {
53+
console.error(err.message);
54+
process.exitCode = 1;
55+
});
56+
main(...process.argv.slice(2));
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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(document, features) {
18+
// [START language_v1_generated_LanguageService_AnnotateText_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* Input document.
24+
*/
25+
// const document = {}
26+
/**
27+
* The enabled features.
28+
*/
29+
// const features = {}
30+
/**
31+
* The encoding type used by the API to calculate offsets.
32+
*/
33+
// const encodingType = {}
34+
35+
// Imports the Language library
36+
const {LanguageServiceClient} = require('@google-cloud/language').v1;
37+
38+
// Instantiates a client
39+
const languageClient = new LanguageServiceClient();
40+
41+
async function callAnnotateText() {
42+
// Construct request
43+
const request = {
44+
document,
45+
features,
46+
};
47+
48+
// Run request
49+
const response = await languageClient.annotateText(request);
50+
console.log(response);
51+
}
52+
53+
callAnnotateText();
54+
// [END language_v1_generated_LanguageService_AnnotateText_async]
55+
}
56+
57+
process.on('unhandledRejection', err => {
58+
console.error(err.message);
59+
process.exitCode = 1;
60+
});
61+
main(...process.argv.slice(2));
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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(document) {
18+
// [START language_v1_generated_LanguageService_ClassifyText_async]
19+
/**
20+
* TODO(developer): Uncomment these variables before running the sample.
21+
*/
22+
/**
23+
* Input document.
24+
*/
25+
// const document = {}
26+
27+
// Imports the Language library
28+
const {LanguageServiceClient} = require('@google-cloud/language').v1;
29+
30+
// Instantiates a client
31+
const languageClient = new LanguageServiceClient();
32+
33+
async function callClassifyText() {
34+
// Construct request
35+
const request = {
36+
document,
37+
};
38+
39+
// Run request
40+
const response = await languageClient.classifyText(request);
41+
console.log(response);
42+
}
43+
44+
callClassifyText();
45+
// [END language_v1_generated_LanguageService_ClassifyText_async]
46+
}
47+
48+
process.on('unhandledRejection', err => {
49+
console.error(err.message);
50+
process.exitCode = 1;
51+
});
52+
main(...process.argv.slice(2));

0 commit comments

Comments
 (0)