Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#633)
Browse files Browse the repository at this point in the history
- [ ] 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
gcf-owl-bot[bot] authored Nov 10, 2021
1 parent 23d61bc commit 41b2fb3
Show file tree
Hide file tree
Showing 17 changed files with 977 additions and 278 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-language/linkinator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"img.shields.io"
],
"silent": true,
"concurrency": 10
"concurrency": 5
}
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));
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));
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));
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));
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));
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));
Loading

0 comments on commit 41b2fb3

Please sign in to comment.