-
Notifications
You must be signed in to change notification settings - Fork 598
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 (#633)
- [ ] 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
23d61bc
commit 41b2fb3
Showing
17 changed files
with
977 additions
and
278 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 | ||
} |
56 changes: 56 additions & 0 deletions
56
packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.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,56 @@ | ||
// 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(document) { | ||
// [START language_v1_generated_LanguageService_AnalyzeEntities_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Input document. | ||
*/ | ||
// const document = {} | ||
/** | ||
* The encoding type used by the API to calculate offsets. | ||
*/ | ||
// const encodingType = {} | ||
|
||
// Imports the Language library | ||
const {LanguageServiceClient} = require('@google-cloud/language').v1; | ||
|
||
// Instantiates a client | ||
const languageClient = new LanguageServiceClient(); | ||
|
||
async function callAnalyzeEntities() { | ||
// Construct request | ||
const request = { | ||
document, | ||
}; | ||
|
||
// Run request | ||
const response = await languageClient.analyzeEntities(request); | ||
console.log(response); | ||
} | ||
|
||
callAnalyzeEntities(); | ||
// [END language_v1_generated_LanguageService_AnalyzeEntities_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
56 changes: 56 additions & 0 deletions
56
...s/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.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,56 @@ | ||
// 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(document) { | ||
// [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Input document. | ||
*/ | ||
// const document = {} | ||
/** | ||
* The encoding type used by the API to calculate offsets. | ||
*/ | ||
// const encodingType = {} | ||
|
||
// Imports the Language library | ||
const {LanguageServiceClient} = require('@google-cloud/language').v1; | ||
|
||
// Instantiates a client | ||
const languageClient = new LanguageServiceClient(); | ||
|
||
async function callAnalyzeEntitySentiment() { | ||
// Construct request | ||
const request = { | ||
document, | ||
}; | ||
|
||
// Run request | ||
const response = await languageClient.analyzeEntitySentiment(request); | ||
console.log(response); | ||
} | ||
|
||
callAnalyzeEntitySentiment(); | ||
// [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
56 changes: 56 additions & 0 deletions
56
packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.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,56 @@ | ||
// 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(document) { | ||
// [START language_v1_generated_LanguageService_AnalyzeSentiment_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Input document. | ||
*/ | ||
// const document = {} | ||
/** | ||
* The encoding type used by the API to calculate sentence offsets. | ||
*/ | ||
// const encodingType = {} | ||
|
||
// Imports the Language library | ||
const {LanguageServiceClient} = require('@google-cloud/language').v1; | ||
|
||
// Instantiates a client | ||
const languageClient = new LanguageServiceClient(); | ||
|
||
async function callAnalyzeSentiment() { | ||
// Construct request | ||
const request = { | ||
document, | ||
}; | ||
|
||
// Run request | ||
const response = await languageClient.analyzeSentiment(request); | ||
console.log(response); | ||
} | ||
|
||
callAnalyzeSentiment(); | ||
// [END language_v1_generated_LanguageService_AnalyzeSentiment_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
56 changes: 56 additions & 0 deletions
56
packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.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,56 @@ | ||
// 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(document) { | ||
// [START language_v1_generated_LanguageService_AnalyzeSyntax_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Input document. | ||
*/ | ||
// const document = {} | ||
/** | ||
* The encoding type used by the API to calculate offsets. | ||
*/ | ||
// const encodingType = {} | ||
|
||
// Imports the Language library | ||
const {LanguageServiceClient} = require('@google-cloud/language').v1; | ||
|
||
// Instantiates a client | ||
const languageClient = new LanguageServiceClient(); | ||
|
||
async function callAnalyzeSyntax() { | ||
// Construct request | ||
const request = { | ||
document, | ||
}; | ||
|
||
// Run request | ||
const response = await languageClient.analyzeSyntax(request); | ||
console.log(response); | ||
} | ||
|
||
callAnalyzeSyntax(); | ||
// [END language_v1_generated_LanguageService_AnalyzeSyntax_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
61 changes: 61 additions & 0 deletions
61
packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.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(document, features) { | ||
// [START language_v1_generated_LanguageService_AnnotateText_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Input document. | ||
*/ | ||
// const document = {} | ||
/** | ||
* The enabled features. | ||
*/ | ||
// const features = {} | ||
/** | ||
* The encoding type used by the API to calculate offsets. | ||
*/ | ||
// const encodingType = {} | ||
|
||
// Imports the Language library | ||
const {LanguageServiceClient} = require('@google-cloud/language').v1; | ||
|
||
// Instantiates a client | ||
const languageClient = new LanguageServiceClient(); | ||
|
||
async function callAnnotateText() { | ||
// Construct request | ||
const request = { | ||
document, | ||
features, | ||
}; | ||
|
||
// Run request | ||
const response = await languageClient.annotateText(request); | ||
console.log(response); | ||
} | ||
|
||
callAnnotateText(); | ||
// [END language_v1_generated_LanguageService_AnnotateText_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
52 changes: 52 additions & 0 deletions
52
packages/google-cloud-language/samples/generated/v1/language_service.classify_text.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,52 @@ | ||
// 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(document) { | ||
// [START language_v1_generated_LanguageService_ClassifyText_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Input document. | ||
*/ | ||
// const document = {} | ||
|
||
// Imports the Language library | ||
const {LanguageServiceClient} = require('@google-cloud/language').v1; | ||
|
||
// Instantiates a client | ||
const languageClient = new LanguageServiceClient(); | ||
|
||
async function callClassifyText() { | ||
// Construct request | ||
const request = { | ||
document, | ||
}; | ||
|
||
// Run request | ||
const response = await languageClient.classifyText(request); | ||
console.log(response); | ||
} | ||
|
||
callClassifyText(); | ||
// [END language_v1_generated_LanguageService_ClassifyText_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.