Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#745)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 408439482
Source-Link: googleapis/googleapis@b9f6184
Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 22, 2021
1 parent 8307ad0 commit ba4abb1
Show file tree
Hide file tree
Showing 23 changed files with 741 additions and 837 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-translate/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
Expand Up @@ -57,7 +57,7 @@ function main(
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*/
// const outputConfig = ''
// const outputConfig = {}
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
Expand Down Expand Up @@ -93,7 +93,7 @@ function main(
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function batchTranslateDocument() {
async function callBatchTranslateDocument() {
// Construct request
const request = {
parent,
Expand All @@ -109,7 +109,7 @@ function main(
console.log(response);
}

batchTranslateDocument();
callBatchTranslateDocument();
// [END translate_v3_generated_TranslationService_BatchTranslateDocument_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function main(
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*/
// const outputConfig = ''
// const outputConfig = {}
/**
* Optional. Glossaries to be applied for translation.
* It's keyed by target language code.
Expand All @@ -90,7 +90,7 @@ function main(
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function batchTranslateText() {
async function callBatchTranslateText() {
// Construct request
const request = {
parent,
Expand All @@ -106,7 +106,7 @@ function main(
console.log(response);
}

batchTranslateText();
callBatchTranslateText();
// [END translate_v3_generated_TranslationService_BatchTranslateText_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ function main(parent, glossary) {
/**
* Required. The glossary to create.
*/
// const glossary = ''
// const glossary = {}

// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;

// Instantiates a client
const translationClient = new TranslationServiceClient();

async function createGlossary() {
async function callCreateGlossary() {
// Construct request
const request = {
parent,
Expand All @@ -47,7 +47,7 @@ function main(parent, glossary) {
console.log(response);
}

createGlossary();
callCreateGlossary();
// [END translate_v3_generated_TranslationService_CreateGlossary_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(name) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function deleteGlossary() {
async function callDeleteGlossary() {
// Construct request
const request = {
name,
Expand All @@ -42,7 +42,7 @@ function main(name) {
console.log(response);
}

deleteGlossary();
callDeleteGlossary();
// [END translate_v3_generated_TranslationService_DeleteGlossary_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function main(parent) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function detectLanguage() {
async function callDetectLanguage() {
// Construct request
const request = {
parent,
Expand All @@ -76,7 +76,7 @@ function main(parent) {
console.log(response);
}

detectLanguage();
callDetectLanguage();
// [END translate_v3_generated_TranslationService_DetectLanguage_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(name) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function getGlossary() {
async function callGetGlossary() {
// Construct request
const request = {
name,
Expand All @@ -41,7 +41,7 @@ function main(name) {
console.log(response);
}

getGlossary();
callGetGlossary();
// [END translate_v3_generated_TranslationService_GetGlossary_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function main(parent) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function getSupportedLanguages() {
async function callGetSupportedLanguages() {
// Construct request
const request = {
parent,
Expand All @@ -66,7 +66,7 @@ function main(parent) {
console.log(response);
}

getSupportedLanguages();
callGetSupportedLanguages();
// [END translate_v3_generated_TranslationService_GetSupportedLanguages_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(parent) {
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Typically, this is the value of [ListGlossariesResponse.next_page_token]
* Typically, this is the value of ListGlossariesResponse.next_page_token
* returned from the previous call to `ListGlossaries` method.
* The first page is returned if `page_token`is empty or missing.
*/
Expand Down Expand Up @@ -61,7 +61,7 @@ function main(parent) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function listGlossaries() {
async function callListGlossaries() {
// Construct request
const request = {
parent,
Expand All @@ -74,7 +74,7 @@ function main(parent) {
}
}

listGlossaries();
callListGlossaries();
// [END translate_v3_generated_TranslationService_ListGlossaries_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ function main(parent, targetLanguageCode, documentInputConfig) {
/**
* Required. Input configurations.
*/
// const documentInputConfig = ''
// const documentInputConfig = {}
/**
* Optional. Output configurations.
* Defines if the output file should be stored within Cloud Storage as well
* as the desired output format. If not provided the translated file will
* only be returned through a byte-stream and its output mime type will be
* the same as the input file's mime type.
*/
// const documentOutputConfig = ''
// const documentOutputConfig = {}
/**
* Optional. The `model` type requested for this translation.
* The format depends on model type:
Expand All @@ -72,7 +72,7 @@ function main(parent, targetLanguageCode, documentInputConfig) {
* region (have the same location-id) as the model, otherwise an
* INVALID_ARGUMENT (400) error is returned.
*/
// const glossaryConfig = ''
// const glossaryConfig = {}
/**
* Optional. The labels with user-defined metadata for the request.
* Label keys and values can be no longer than 63 characters (Unicode
Expand All @@ -90,7 +90,7 @@ function main(parent, targetLanguageCode, documentInputConfig) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function translateDocument() {
async function callTranslateDocument() {
// Construct request
const request = {
parent,
Expand All @@ -103,7 +103,7 @@ function main(parent, targetLanguageCode, documentInputConfig) {
console.log(response);
}

translateDocument();
callTranslateDocument();
// [END translate_v3_generated_TranslationService_TranslateDocument_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function main(contents, targetLanguageCode, parent) {
* within the same region (have the same location-id) as the model, otherwise
* an INVALID_ARGUMENT (400) error is returned.
*/
// const glossaryConfig = ''
// const glossaryConfig = {}
/**
* Optional. The labels with user-defined metadata for the request.
* Label keys and values can be no longer than 63 characters
Expand All @@ -93,7 +93,7 @@ function main(contents, targetLanguageCode, parent) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function translateText() {
async function callTranslateText() {
// Construct request
const request = {
contents,
Expand All @@ -106,7 +106,7 @@ function main(contents, targetLanguageCode, parent) {
console.log(response);
}

translateText();
callTranslateText();
// [END translate_v3_generated_TranslationService_TranslateText_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function main(
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*/
// const outputConfig = ''
// const outputConfig = {}
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
Expand Down Expand Up @@ -93,7 +93,7 @@ function main(
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function batchTranslateDocument() {
async function callBatchTranslateDocument() {
// Construct request
const request = {
parent,
Expand All @@ -109,7 +109,7 @@ function main(
console.log(response);
}

batchTranslateDocument();
callBatchTranslateDocument();
// [END translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function main(
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*/
// const outputConfig = ''
// const outputConfig = {}
/**
* Optional. Glossaries to be applied for translation.
* It's keyed by target language code.
Expand All @@ -89,7 +89,7 @@ function main(
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function batchTranslateText() {
async function callBatchTranslateText() {
// Construct request
const request = {
parent,
Expand All @@ -105,7 +105,7 @@ function main(
console.log(response);
}

batchTranslateText();
callBatchTranslateText();
// [END translate_v3beta1_generated_TranslationService_BatchTranslateText_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ function main(parent, glossary) {
/**
* Required. The glossary to create.
*/
// const glossary = ''
// const glossary = {}

// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3beta1;

// Instantiates a client
const translationClient = new TranslationServiceClient();

async function createGlossary() {
async function callCreateGlossary() {
// Construct request
const request = {
parent,
Expand All @@ -47,7 +47,7 @@ function main(parent, glossary) {
console.log(response);
}

createGlossary();
callCreateGlossary();
// [END translate_v3beta1_generated_TranslationService_CreateGlossary_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(name) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function deleteGlossary() {
async function callDeleteGlossary() {
// Construct request
const request = {
name,
Expand All @@ -42,7 +42,7 @@ function main(name) {
console.log(response);
}

deleteGlossary();
callDeleteGlossary();
// [END translate_v3beta1_generated_TranslationService_DeleteGlossary_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function main(parent) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function detectLanguage() {
async function callDetectLanguage() {
// Construct request
const request = {
parent,
Expand All @@ -75,7 +75,7 @@ function main(parent) {
console.log(response);
}

detectLanguage();
callDetectLanguage();
// [END translate_v3beta1_generated_TranslationService_DetectLanguage_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(name) {
// Instantiates a client
const translationClient = new TranslationServiceClient();

async function getGlossary() {
async function callGetGlossary() {
// Construct request
const request = {
name,
Expand All @@ -41,7 +41,7 @@ function main(name) {
console.log(response);
}

getGlossary();
callGetGlossary();
// [END translate_v3beta1_generated_TranslationService_GetGlossary_async]
}

Expand Down
Loading

0 comments on commit ba4abb1

Please sign in to comment.