Socket
Socket
Sign inDemoInstall

@google-cloud/translate

Package Overview
Dependencies
158
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.3.1 to 7.0.0

23

build/src/index.d.ts

@@ -17,14 +17,17 @@ import * as v2 from './v2';

*
* @example <caption>Install the v3 client library with <a
* href="https://www.npmjs.com/">npm</a>:</caption>
* @example Install the v3 client library with <a href="https://www.npmjs.com/">npm</a>:
* ```
* npm install --save @google-cloud/translate
*
* @example <caption>Import the v3 client library:</caption>
* ```
* @example Import the v3 client library:
* ```
* const {TranslationServiceClient} = require('@google-cloud/translate');
*
* @example <caption>Create a v3 client that uses <a
* href="https://goo.gl/64dyYX">Application Default Credentials
* (ADC)</a>:</caption>
* ```
* @example Create a v3 client that uses <a href="https://goo.gl/64dyYX">Application Default Credentials (ADC)</a>:
* ```
* const client = new TranslationServiceClient();
*
* ```
* @example <caption>include:samples/quickstart.js</caption>

@@ -34,8 +37,12 @@ * region_tag:translate_quickstart

*
* @example <caption>Install the v3beta1 client library:</caption>
* @example Install the v3beta1 client library:
* ```
* npm install --save @google-cloud/translate
*
* @example <caption>Import the v3beta1 client library:</caption>
* ```
* @example Import the v3beta1 client library:
* ```
* const {TranslationServiceClient} =
* require('@google-cloud/translate').v3beta1;
* ```
*/

@@ -42,0 +49,0 @@ import * as v3beta1 from './v3beta1';

@@ -17,3 +17,7 @@ "use strict";

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -24,3 +28,3 @@ if (k2 === undefined) k2 = k;

var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};

@@ -46,14 +50,17 @@ Object.defineProperty(exports, "__esModule", { value: true });

*
* @example <caption>Install the v3 client library with <a
* href="https://www.npmjs.com/">npm</a>:</caption>
* @example Install the v3 client library with <a href="https://www.npmjs.com/">npm</a>:
* ```
* npm install --save @google-cloud/translate
*
* @example <caption>Import the v3 client library:</caption>
* ```
* @example Import the v3 client library:
* ```
* const {TranslationServiceClient} = require('@google-cloud/translate');
*
* @example <caption>Create a v3 client that uses <a
* href="https://goo.gl/64dyYX">Application Default Credentials
* (ADC)</a>:</caption>
* ```
* @example Create a v3 client that uses <a href="https://goo.gl/64dyYX">Application Default Credentials (ADC)</a>:
* ```
* const client = new TranslationServiceClient();
*
* ```
* @example <caption>include:samples/quickstart.js</caption>

@@ -63,8 +70,12 @@ * region_tag:translate_quickstart

*
* @example <caption>Install the v3beta1 client library:</caption>
* @example Install the v3beta1 client library:
* ```
* npm install --save @google-cloud/translate
*
* @example <caption>Import the v3beta1 client library:</caption>
* ```
* @example Import the v3beta1 client library:
* ```
* const {TranslationServiceClient} =
* require('@google-cloud/translate').v3beta1;
* ```
*/

@@ -71,0 +82,0 @@ const v3beta1 = require("./v3beta1");

@@ -68,3 +68,3 @@ import { Service, Metadata } from '@google-cloud/common';

/**
* With [Google Translate](https://cloud.google.com/translate), you can
* With {@link https://cloud.google.com/translate| Google Translate}, you can
* dynamically translate text between thousands of language pairs.

@@ -84,2 +84,3 @@ *

* @example
* ```
* //-

@@ -92,2 +93,3 @@ * // <h3>Custom Translation API</h3>

*
* ```
* @example <caption>include:samples/quickstart.js</caption>

@@ -94,0 +96,0 @@ * region_tag:translate_quickstart

@@ -55,3 +55,3 @@ "use strict";

/**
* With [Google Translate](https://cloud.google.com/translate), you can
* With {@link https://cloud.google.com/translate| Google Translate}, you can
* dynamically translate text between thousands of language pairs.

@@ -71,2 +71,3 @@ *

* @example
* ```
* //-

@@ -79,2 +80,3 @@ * // <h3>Custom Translation API</h3>

*
* ```
* @example <caption>include:samples/quickstart.js</caption>

@@ -134,2 +136,3 @@ * region_tag:translate_quickstart

* @example
* ```
* const {Translate} = require('@google-cloud/translate');

@@ -184,2 +187,3 @@ *

*
* ```
* @example <caption>include:samples/translate.js</caption>

@@ -221,3 +225,3 @@ * region_tag:translate_detect_language

* @memberof v2
* @property {string} code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1)
* @property {string} code The {@link https://en.wikipedia.org/wiki/ISO_639-1| ISO 639-1}
* language code.

@@ -232,3 +236,3 @@ * @property {string} name The language name. This can be translated into your

* @param {object[]} results The languages supported by the API.
* @param {string} results.code The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1)
* @param {string} results.code The {@link https://en.wikipedia.org/wiki/ISO_639-1| ISO 639-1}
* language code.

@@ -315,3 +319,3 @@ * @param {string} results.name The language name. This can be translated into your

*
* @see [Translate Text](https://cloud.google.com/translate/v2/using_rest#Translate)
* @see {@link https://cloud.google.com/translate/v2/using_rest#Translate| Translate Text}
*

@@ -330,2 +334,3 @@ * @throws {Error} If `options` is provided as an object without a `to`

* @example
* ```
* //-

@@ -381,2 +386,3 @@ * // Pass a string and a language code to get the translation.

*
* ```
* @example <caption>include:samples/translate.js</caption>

@@ -472,3 +478,3 @@ * region_tag:translate_translate_text

*/
promisify_1.promisifyAll(Translate, { exclude: ['request'] });
(0, promisify_1.promisifyAll)(Translate, { exclude: ['request'] });
//# sourceMappingURL=index.js.map
"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -20,4 +20,5 @@ // Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.TranslationServiceClient = void 0;
var translation_service_client_1 = require("./translation_service_client");
Object.defineProperty(exports, "TranslationServiceClient", { enumerable: true, get: function () { return translation_service_client_1.TranslationServiceClient; } });
//# sourceMappingURL=index.js.map

@@ -37,3 +37,3 @@ /// <reference types="node" />

* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -61,7 +61,6 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
*/

@@ -107,18 +106,386 @@ constructor(opts?: ClientOptions);

getProjectId(callback: Callback<string, undefined, undefined>): void;
translateText(request?: protos.google.cloud.translation.v3.ITranslateTextRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3.ITranslateTextResponse, protos.google.cloud.translation.v3.ITranslateTextRequest | undefined, {} | undefined]>;
/**
* Translates input text and returns translated text.
*
* @param {Object} request
* The request object that will be sent.
* @param {string[]} request.contents
* Required. The content of the input in string format.
* We recommend the total content be less than 30k codepoints. The max length
* of this field is 1024.
* Use BatchTranslateText for larger text.
* @param {string} [request.mimeType]
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
* @param {string} [request.sourceLanguageCode]
* Optional. The BCP-47 language code of the input text if
* known, for example, "en-US" or "sr-Latn". Supported language codes are
* listed in Language Support. If the source language isn't specified, the API
* attempts to identify the source language automatically and returns the
* source language within the response.
* @param {string} request.targetLanguageCode
* Required. The BCP-47 language code to use for translation of the input
* text, set to one of the language codes listed in Language Support.
* @param {string} request.parent
* Required. Project or location to make a call. Must refer to a caller's
* project.
*
* Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
*
* Non-global location is required for requests using AutoML models or
* custom glossaries.
*
* Models and glossaries must be within the same region (have same
* location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.model]
* Optional. The `model` type requested for this translation.
*
* The format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* For global (non-regionalized) requests, use `location-id` `global`.
* For example,
* `projects/{project-number-or-id}/locations/global/models/general/nmt`.
*
* If not provided, the default Google model (NMT) will be used.
* @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig]
* Optional. Glossary to be applied. The glossary must be
* within the same region (have the same location-id) as the model, otherwise
* an INVALID_ARGUMENT (400) error is returned.
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints), can only contain lowercase letters, numeric
* characters, underscores and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/advanced/labels for more
* information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3.TranslateTextResponse}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.translate_text.js</caption>
* region_tag:translate_v3_generated_TranslationService_TranslateText_async
*/
translateText(request?: protos.google.cloud.translation.v3.ITranslateTextRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3.ITranslateTextResponse,
protos.google.cloud.translation.v3.ITranslateTextRequest | undefined,
{} | undefined
]>;
translateText(request: protos.google.cloud.translation.v3.ITranslateTextRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.ITranslateTextResponse, protos.google.cloud.translation.v3.ITranslateTextRequest | null | undefined, {} | null | undefined>): void;
translateText(request: protos.google.cloud.translation.v3.ITranslateTextRequest, callback: Callback<protos.google.cloud.translation.v3.ITranslateTextResponse, protos.google.cloud.translation.v3.ITranslateTextRequest | null | undefined, {} | null | undefined>): void;
detectLanguage(request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3.IDetectLanguageResponse, protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined, {} | undefined]>;
/**
* Detects the language of text within a request.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Project or location to make a call. Must refer to a caller's
* project.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}` or
* `projects/{project-number-or-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
*
* Only models within the same region (has same location-id) can be used.
* Otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.model]
* Optional. The language detection model to be used.
*
* Format:
* `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
*
* Only one language detection model is currently supported:
* `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
*
* If not specified, the default model is used.
* @param {string} request.content
* The content of the input stored as a string.
* @param {string} [request.mimeType]
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints), can only contain lowercase letters, numeric
* characters, underscores and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/advanced/labels for more
* information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3.DetectLanguageResponse}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.detect_language.js</caption>
* region_tag:translate_v3_generated_TranslationService_DetectLanguage_async
*/
detectLanguage(request?: protos.google.cloud.translation.v3.IDetectLanguageRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3.IDetectLanguageResponse,
protos.google.cloud.translation.v3.IDetectLanguageRequest | undefined,
{} | undefined
]>;
detectLanguage(request: protos.google.cloud.translation.v3.IDetectLanguageRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IDetectLanguageResponse, protos.google.cloud.translation.v3.IDetectLanguageRequest | null | undefined, {} | null | undefined>): void;
detectLanguage(request: protos.google.cloud.translation.v3.IDetectLanguageRequest, callback: Callback<protos.google.cloud.translation.v3.IDetectLanguageResponse, protos.google.cloud.translation.v3.IDetectLanguageRequest | null | undefined, {} | null | undefined>): void;
getSupportedLanguages(request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3.ISupportedLanguages, (protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest | undefined), {} | undefined]>;
/**
* Returns a list of supported languages for translation.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Project or location to make a call. Must refer to a caller's
* project.
*
* Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
*
* Non-global location is required for AutoML models.
*
* Only models within the same region (have same location-id) can be used,
* otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.displayLanguageCode]
* Optional. The language to use to return localized, human readable names
* of supported languages. If missing, then display names are not returned
* in a response.
* @param {string} [request.model]
* Optional. Get supported languages of this model.
*
* The format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* Returns languages supported by the specified model.
* If missing, we get supported languages of Google general NMT model.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3.SupportedLanguages}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.get_supported_languages.js</caption>
* region_tag:translate_v3_generated_TranslationService_GetSupportedLanguages_async
*/
getSupportedLanguages(request?: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3.ISupportedLanguages,
(protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest | undefined),
{} | undefined
]>;
getSupportedLanguages(request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.ISupportedLanguages, protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest | null | undefined, {} | null | undefined>): void;
getSupportedLanguages(request: protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest, callback: Callback<protos.google.cloud.translation.v3.ISupportedLanguages, protos.google.cloud.translation.v3.IGetSupportedLanguagesRequest | null | undefined, {} | null | undefined>): void;
translateDocument(request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3.ITranslateDocumentResponse, protos.google.cloud.translation.v3.ITranslateDocumentRequest | undefined, {} | undefined]>;
/**
* Translates documents in synchronous mode.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
*
* Non-global location is required for requests using AutoML models or custom
* glossaries.
*
* Models and glossaries must be within the same region (have the same
* location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.sourceLanguageCode]
* Optional. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support. If the source language isn't specified, the API attempts
* to identify the source language automatically and returns the source
* language within the response. Source language must be specified if the
* request contains a glossary or a custom model.
* @param {string} request.targetLanguageCode
* Required. The BCP-47 language code to use for translation of the input
* document, set to one of the language codes listed in Language Support.
* @param {google.cloud.translation.v3.DocumentInputConfig} request.documentInputConfig
* Required. Input configurations.
* @param {google.cloud.translation.v3.DocumentOutputConfig} [request.documentOutputConfig]
* 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.
* @param {string} [request.model]
* Optional. The `model` type requested for this translation.
*
* The format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If not provided, the default Google model (NMT) will be used for
* translation.
* @param {google.cloud.translation.v3.TranslateTextGlossaryConfig} [request.glossaryConfig]
* Optional. Glossary to be applied. The glossary must be within the same
* region (have the same location-id) as the model, otherwise an
* INVALID_ARGUMENT (400) error is returned.
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters (Unicode
* codepoints), can only contain lowercase letters, numeric characters,
* underscores and dashes. International characters are allowed. Label values
* are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/advanced/labels for more
* information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3.TranslateDocumentResponse}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.translate_document.js</caption>
* region_tag:translate_v3_generated_TranslationService_TranslateDocument_async
*/
translateDocument(request?: protos.google.cloud.translation.v3.ITranslateDocumentRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3.ITranslateDocumentResponse,
protos.google.cloud.translation.v3.ITranslateDocumentRequest | undefined,
{} | undefined
]>;
translateDocument(request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.ITranslateDocumentResponse, protos.google.cloud.translation.v3.ITranslateDocumentRequest | null | undefined, {} | null | undefined>): void;
translateDocument(request: protos.google.cloud.translation.v3.ITranslateDocumentRequest, callback: Callback<protos.google.cloud.translation.v3.ITranslateDocumentResponse, protos.google.cloud.translation.v3.ITranslateDocumentRequest | null | undefined, {} | null | undefined>): void;
getGlossary(request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined, {} | undefined]>;
/**
* Gets a glossary. Returns NOT_FOUND, if the glossary doesn't
* exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the glossary to retrieve.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3.Glossary}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.get_glossary.js</caption>
* region_tag:translate_v3_generated_TranslationService_GetGlossary_async
*/
getGlossary(request?: protos.google.cloud.translation.v3.IGetGlossaryRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3.IGlossary,
protos.google.cloud.translation.v3.IGetGlossaryRequest | undefined,
{} | undefined
]>;
getGlossary(request: protos.google.cloud.translation.v3.IGetGlossaryRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, {} | null | undefined>): void;
getGlossary(request: protos.google.cloud.translation.v3.IGetGlossaryRequest, callback: Callback<protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.IGetGlossaryRequest | null | undefined, {} | null | undefined>): void;
batchTranslateText(request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3.IBatchTranslateResponse, protos.google.cloud.translation.v3.IBatchTranslateMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Translates a large volume of text in asynchronous batch mode.
* This function provides real-time output as the inputs are being processed.
* If caller cancels a request, the partial results (for an input file, it's
* all or nothing) may still be available on the specified output location.
*
* This call returns immediately and you can
* use google.longrunning.Operation.name to poll the status of the call.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Location to make a call. Must refer to a caller's project.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
* @param {string} request.sourceLanguageCode
* Required. Source language code.
* @param {string[]} request.targetLanguageCodes
* Required. Specify up to 10 language codes here.
* @param {number[]} [request.models]
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is
* not requested for a language pair, then default google model (nmt) is used.
* @param {number[]} request.inputConfigs
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
* @param {google.cloud.translation.v3.OutputConfig} request.outputConfig
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
* @param {number[]} [request.glossaries]
* Optional. Glossaries to be applied for translation.
* It's keyed by target language code.
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints), can only contain lowercase letters, numeric
* characters, underscores and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/advanced/labels for more
* information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.batch_translate_text.js</caption>
* region_tag:translate_v3_generated_TranslationService_BatchTranslateText_async
*/
batchTranslateText(request?: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3.IBatchTranslateResponse, protos.google.cloud.translation.v3.IBatchTranslateMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
batchTranslateText(request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3.IBatchTranslateResponse, protos.google.cloud.translation.v3.IBatchTranslateMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -135,10 +502,89 @@ batchTranslateText(request: protos.google.cloud.translation.v3.IBatchTranslateTextRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3.IBatchTranslateResponse, protos.google.cloud.translation.v3.IBatchTranslateMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkBatchTranslateTextProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3/translation_service.batch_translate_text.js</caption>
* region_tag:translate_v3_generated_TranslationService_BatchTranslateText_async
*/
checkBatchTranslateTextProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3.BatchTranslateResponse, protos.google.cloud.translation.v3.BatchTranslateMetadata>>;
batchTranslateDocument(request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Translates a large volume of document in asynchronous batch mode.
* This function provides real-time output as the inputs are being processed.
* If caller cancels a request, the partial results (for an input file, it's
* all or nothing) may still be available on the specified output location.
*
* This call returns immediately and you can use
* google.longrunning.Operation.name to poll the status of the call.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
* @param {string} request.sourceLanguageCode
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support (https://cloud.google.com/translate/docs/languages).
* @param {string[]} request.targetLanguageCodes
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
* @param {number[]} request.inputConfigs
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
* @param {google.cloud.translation.v3.BatchDocumentOutputConfig} request.outputConfig
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
* @param {number[]} [request.models]
* 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,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is
* not requested for a language pair, then default google model (nmt) is used.
* @param {number[]} [request.glossaries]
* Optional. Glossaries to be applied. It's keyed by target language code.
* @param {number[]} [request.formatConversions]
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.batch_translate_document.js</caption>
* region_tag:translate_v3_generated_TranslationService_BatchTranslateDocument_async
*/
batchTranslateDocument(request?: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
batchTranslateDocument(request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -155,10 +601,33 @@ batchTranslateDocument(request: protos.google.cloud.translation.v3.IBatchTranslateDocumentRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3.IBatchTranslateDocumentMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkBatchTranslateDocumentProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3/translation_service.batch_translate_document.js</caption>
* region_tag:translate_v3_generated_TranslationService_BatchTranslateDocument_async
*/
checkBatchTranslateDocumentProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3.BatchTranslateDocumentResponse, protos.google.cloud.translation.v3.BatchTranslateDocumentMetadata>>;
createGlossary(request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.ICreateGlossaryMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Creates a glossary and returns the long-running operation. Returns
* NOT_FOUND, if the project doesn't exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. The project name.
* @param {google.cloud.translation.v3.Glossary} request.glossary
* Required. The glossary to create.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.create_glossary.js</caption>
* region_tag:translate_v3_generated_TranslationService_CreateGlossary_async
*/
createGlossary(request?: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.ICreateGlossaryMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
createGlossary(request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.ICreateGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -175,10 +644,32 @@ createGlossary(request: protos.google.cloud.translation.v3.ICreateGlossaryRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3.IGlossary, protos.google.cloud.translation.v3.ICreateGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkCreateGlossaryProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3/translation_service.create_glossary.js</caption>
* region_tag:translate_v3_generated_TranslationService_CreateGlossary_async
*/
checkCreateGlossaryProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3.Glossary, protos.google.cloud.translation.v3.CreateGlossaryMetadata>>;
deleteGlossary(request?: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3.IDeleteGlossaryResponse, protos.google.cloud.translation.v3.IDeleteGlossaryMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Deletes a glossary, or cancels glossary construction
* if the glossary isn't created yet.
* Returns NOT_FOUND, if the glossary doesn't exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the glossary to delete.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3/translation_service.delete_glossary.js</caption>
* region_tag:translate_v3_generated_TranslationService_DeleteGlossary_async
*/
deleteGlossary(request?: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3.IDeleteGlossaryResponse, protos.google.cloud.translation.v3.IDeleteGlossaryMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
deleteGlossary(request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3.IDeleteGlossaryResponse, protos.google.cloud.translation.v3.IDeleteGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -195,10 +686,57 @@ deleteGlossary(request: protos.google.cloud.translation.v3.IDeleteGlossaryRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3.IDeleteGlossaryResponse, protos.google.cloud.translation.v3.IDeleteGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkDeleteGlossaryProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3/translation_service.delete_glossary.js</caption>
* region_tag:translate_v3_generated_TranslationService_DeleteGlossary_async
*/
checkDeleteGlossaryProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3.DeleteGlossaryResponse, protos.google.cloud.translation.v3.DeleteGlossaryMetadata>>;
listGlossaries(request?: protos.google.cloud.translation.v3.IListGlossariesRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3.IGlossary[], protos.google.cloud.translation.v3.IListGlossariesRequest | null, protos.google.cloud.translation.v3.IListGlossariesResponse]>;
/**
* Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't
* exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. The name of the project from which to list all of the glossaries.
* @param {number} [request.pageSize]
* Optional. Requested page size. The server may return fewer glossaries than
* requested. If unspecified, the server picks an appropriate default.
* @param {string} [request.pageToken]
* Optional. A token identifying a page of results the server should return.
* 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.
* @param {string} [request.filter]
* Optional. Filter specifying constraints of a list operation.
* Specify the constraint by the format of "key=value", where key must be
* "src" or "tgt", and the value must be a valid language code.
* For multiple restrictions, concatenate them by "AND" (uppercase only),
* such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
* here, which means using 'en-US' and 'en' can lead to different results,
* which depends on the language code you used when you create the glossary.
* For the unidirectional glossaries, the "src" and "tgt" add restrictions
* on the source and target language code separately.
* For the equivalent term set glossaries, the "src" and/or "tgt" add
* restrictions on the term set.
* For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
* glossaries which exactly match the source language code as "en-US" and the
* target language code "zh-CN", but all equivalent term set glossaries which
* contain "en-US" and "zh-CN" in their language set will be picked.
* If missing, no filtering is performed.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3.Glossary}.
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
* Note that it can affect your quota.
* We recommend using `listGlossariesAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/
listGlossaries(request?: protos.google.cloud.translation.v3.IListGlossariesRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3.IGlossary[],
protos.google.cloud.translation.v3.IListGlossariesRequest | null,
protos.google.cloud.translation.v3.IListGlossariesResponse
]>;
listGlossaries(request: protos.google.cloud.translation.v3.IListGlossariesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.translation.v3.IListGlossariesRequest, protos.google.cloud.translation.v3.IListGlossariesResponse | null | undefined, protos.google.cloud.translation.v3.IGlossary>): void;

@@ -293,7 +831,4 @@ listGlossaries(request: protos.google.cloud.translation.v3.IListGlossariesRequest, callback: PaginationCallback<protos.google.cloud.translation.v3.IListGlossariesRequest, protos.google.cloud.translation.v3.IListGlossariesResponse | null | undefined, protos.google.cloud.translation.v3.IGlossary>): void;

* for more details and examples.
* @example
* const iterable = client.listGlossariesAsync(request);
* for await (const response of iterable) {
* // process response
* }
* @example <caption>include:samples/generated/v3/translation_service.list_glossaries.js</caption>
* region_tag:translate_v3_generated_TranslationService_ListGlossaries_async
*/

@@ -300,0 +835,0 @@ listGlossariesAsync(request?: protos.google.cloud.translation.v3.IListGlossariesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.translation.v3.IGlossary>;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -20,4 +20,5 @@ // Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.TranslationServiceClient = void 0;
var translation_service_client_1 = require("./translation_service_client");
Object.defineProperty(exports, "TranslationServiceClient", { enumerable: true, get: function () { return translation_service_client_1.TranslationServiceClient; } });
//# sourceMappingURL=index.js.map

@@ -37,3 +37,3 @@ /// <reference types="node" />

* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -61,7 +61,6 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
*/

@@ -107,18 +106,382 @@ constructor(opts?: ClientOptions);

getProjectId(callback: Callback<string, undefined, undefined>): void;
translateText(request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3beta1.ITranslateTextResponse, protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined, {} | undefined]>;
/**
* Translates input text and returns translated text.
*
* @param {Object} request
* The request object that will be sent.
* @param {string[]} request.contents
* Required. The content of the input in string format.
* We recommend the total content be less than 30k codepoints. The max length
* of this field is 1024.
* Use BatchTranslateText for larger text.
* @param {string} [request.mimeType]
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
* @param {string} [request.sourceLanguageCode]
* Optional. The BCP-47 language code of the input text if
* known, for example, "en-US" or "sr-Latn". Supported language codes are
* listed in Language Support. If the source language isn't specified, the API
* attempts to identify the source language automatically and returns the
* source language within the response.
* @param {string} request.targetLanguageCode
* Required. The BCP-47 language code to use for translation of the input
* text, set to one of the language codes listed in Language Support.
* @param {string} request.parent
* Required. Project or location to make a call. Must refer to a caller's
* project.
*
* Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
*
* Non-global location is required for requests using AutoML models or
* custom glossaries.
*
* Models and glossaries must be within the same region (have same
* location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.model]
* Optional. The `model` type requested for this translation.
*
* The format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* For global (non-regionalized) requests, use `location-id` `global`.
* For example,
* `projects/{project-number-or-id}/locations/global/models/general/nmt`.
*
* If not provided, the default Google model (NMT) will be used
* @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig]
* Optional. Glossary to be applied. The glossary must be
* within the same region (have the same location-id) as the model, otherwise
* an INVALID_ARGUMENT (400) error is returned.
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints), can only contain lowercase letters, numeric
* characters, underscores and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/labels for more information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [TranslateTextResponse]{@link google.cloud.translation.v3beta1.TranslateTextResponse}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.translate_text.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_TranslateText_async
*/
translateText(request?: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3beta1.ITranslateTextResponse,
protos.google.cloud.translation.v3beta1.ITranslateTextRequest | undefined,
{} | undefined
]>;
translateText(request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3beta1.ITranslateTextResponse, protos.google.cloud.translation.v3beta1.ITranslateTextRequest | null | undefined, {} | null | undefined>): void;
translateText(request: protos.google.cloud.translation.v3beta1.ITranslateTextRequest, callback: Callback<protos.google.cloud.translation.v3beta1.ITranslateTextResponse, protos.google.cloud.translation.v3beta1.ITranslateTextRequest | null | undefined, {} | null | undefined>): void;
detectLanguage(request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, (protos.google.cloud.translation.v3beta1.IDetectLanguageRequest | undefined), {} | undefined]>;
/**
* Detects the language of text within a request.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Project or location to make a call. Must refer to a caller's
* project.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}` or
* `projects/{project-number-or-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
*
* Only models within the same region (has same location-id) can be used.
* Otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.model]
* Optional. The language detection model to be used.
*
* Format:
* `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
*
* Only one language detection model is currently supported:
* `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
*
* If not specified, the default model is used.
* @param {string} request.content
* The content of the input stored as a string.
* @param {string} [request.mimeType]
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints), can only contain lowercase letters, numeric
* characters, underscores and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/labels for more information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [DetectLanguageResponse]{@link google.cloud.translation.v3beta1.DetectLanguageResponse}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.detect_language.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_DetectLanguage_async
*/
detectLanguage(request?: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3beta1.IDetectLanguageResponse,
(protos.google.cloud.translation.v3beta1.IDetectLanguageRequest | undefined),
{} | undefined
]>;
detectLanguage(request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, protos.google.cloud.translation.v3beta1.IDetectLanguageRequest | null | undefined, {} | null | undefined>): void;
detectLanguage(request: protos.google.cloud.translation.v3beta1.IDetectLanguageRequest, callback: Callback<protos.google.cloud.translation.v3beta1.IDetectLanguageResponse, protos.google.cloud.translation.v3beta1.IDetectLanguageRequest | null | undefined, {} | null | undefined>): void;
getSupportedLanguages(request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3beta1.ISupportedLanguages, (protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest | undefined), {} | undefined]>;
/**
* Returns a list of supported languages for translation.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Project or location to make a call. Must refer to a caller's
* project.
*
* Format: `projects/{project-number-or-id}` or
* `projects/{project-number-or-id}/locations/{location-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global` or
* `projects/{project-number-or-id}`.
*
* Non-global location is required for AutoML models.
*
* Only models within the same region (have same location-id) can be used,
* otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.displayLanguageCode]
* Optional. The language to use to return localized, human readable names
* of supported languages. If missing, then display names are not returned
* in a response.
* @param {string} [request.model]
* Optional. Get supported languages of this model.
*
* The format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* Returns languages supported by the specified model.
* If missing, we get supported languages of Google general NMT model.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [SupportedLanguages]{@link google.cloud.translation.v3beta1.SupportedLanguages}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.get_supported_languages.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_GetSupportedLanguages_async
*/
getSupportedLanguages(request?: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3beta1.ISupportedLanguages,
(protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest | undefined),
{} | undefined
]>;
getSupportedLanguages(request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3beta1.ISupportedLanguages, protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest | null | undefined, {} | null | undefined>): void;
getSupportedLanguages(request: protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest, callback: Callback<protos.google.cloud.translation.v3beta1.ISupportedLanguages, protos.google.cloud.translation.v3beta1.IGetSupportedLanguagesRequest | null | undefined, {} | null | undefined>): void;
translateDocument(request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, (protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest | undefined), {} | undefined]>;
/**
* Translates documents in synchronous mode.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* For global calls, use `projects/{project-number-or-id}/locations/global`.
*
* Non-global location is required for requests using AutoML models or custom
* glossaries.
*
* Models and glossaries must be within the same region (have the same
* location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
* @param {string} [request.sourceLanguageCode]
* Optional. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support. If the source language isn't specified, the API attempts
* to identify the source language automatically and returns the source
* language within the response. Source language must be specified if the
* request contains a glossary or a custom model.
* @param {string} request.targetLanguageCode
* Required. The BCP-47 language code to use for translation of the input
* document, set to one of the language codes listed in Language Support.
* @param {google.cloud.translation.v3beta1.DocumentInputConfig} request.documentInputConfig
* Required. Input configurations.
* @param {google.cloud.translation.v3beta1.DocumentOutputConfig} [request.documentOutputConfig]
* 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.
* @param {string} [request.model]
* Optional. The `model` type requested for this translation.
*
* The format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If not provided, the default Google model (NMT) will be used for
* translation.
* @param {google.cloud.translation.v3beta1.TranslateTextGlossaryConfig} [request.glossaryConfig]
* Optional. Glossary to be applied. The glossary must be within the same
* region (have the same location-id) as the model, otherwise an
* INVALID_ARGUMENT (400) error is returned.
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters (Unicode
* codepoints), can only contain lowercase letters, numeric characters,
* underscores and dashes. International characters are allowed. Label values
* are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/advanced/labels for more
* information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [TranslateDocumentResponse]{@link google.cloud.translation.v3beta1.TranslateDocumentResponse}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.translate_document.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_TranslateDocument_async
*/
translateDocument(request?: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse,
(protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest | undefined),
{} | undefined
]>;
translateDocument(request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest | null | undefined, {} | null | undefined>): void;
translateDocument(request: protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest, callback: Callback<protos.google.cloud.translation.v3beta1.ITranslateDocumentResponse, protos.google.cloud.translation.v3beta1.ITranslateDocumentRequest | null | undefined, {} | null | undefined>): void;
getGlossary(request?: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3beta1.IGlossary, protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined, {} | undefined]>;
/**
* Gets a glossary. Returns NOT_FOUND, if the glossary doesn't
* exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the glossary to retrieve.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing [Glossary]{@link google.cloud.translation.v3beta1.Glossary}.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.get_glossary.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_GetGlossary_async
*/
getGlossary(request?: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3beta1.IGlossary,
protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | undefined,
{} | undefined
]>;
getGlossary(request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3beta1.IGlossary, protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | null | undefined, {} | null | undefined>): void;
getGlossary(request: protos.google.cloud.translation.v3beta1.IGetGlossaryRequest, callback: Callback<protos.google.cloud.translation.v3beta1.IGlossary, protos.google.cloud.translation.v3beta1.IGetGlossaryRequest | null | undefined, {} | null | undefined>): void;
batchTranslateText(request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Translates a large volume of text in asynchronous batch mode.
* This function provides real-time output as the inputs are being processed.
* If caller cancels a request, the partial results (for an input file, it's
* all or nothing) may still be available on the specified output location.
*
* This call returns immediately and you can
* use google.longrunning.Operation.name to poll the status of the call.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Location to make a call. Must refer to a caller's project.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
* @param {string} request.sourceLanguageCode
* Required. Source language code.
* @param {string[]} request.targetLanguageCodes
* Required. Specify up to 10 language codes here.
* @param {number[]} [request.models]
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is model name. Value can be a built-in general model,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is
* not requested for a language pair, then default google model (nmt) is used.
* @param {number[]} request.inputConfigs
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
* @param {google.cloud.translation.v3beta1.OutputConfig} request.outputConfig
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
* @param {number[]} [request.glossaries]
* Optional. Glossaries to be applied for translation.
* It's keyed by target language code.
* @param {number[]} [request.labels]
* Optional. The labels with user-defined metadata for the request.
*
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints), can only contain lowercase letters, numeric
* characters, underscores and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
*
* See https://cloud.google.com/translate/docs/labels for more information.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.batch_translate_text.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateText_async
*/
batchTranslateText(request?: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
batchTranslateText(request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -135,10 +498,89 @@ batchTranslateText(request: protos.google.cloud.translation.v3beta1.IBatchTranslateTextRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkBatchTranslateTextProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3beta1/translation_service.batch_translate_text.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateText_async
*/
checkBatchTranslateTextProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3beta1.BatchTranslateResponse, protos.google.cloud.translation.v3beta1.BatchTranslateMetadata>>;
batchTranslateDocument(request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Translates a large volume of documents in asynchronous batch mode.
* This function provides real-time output as the inputs are being processed.
* If caller cancels a request, the partial results (for an input file, it's
* all or nothing) may still be available on the specified output location.
*
* This call returns immediately and you can use
* google.longrunning.Operation.name to poll the status of the call.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. Location to make a regional call.
*
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
*
* The `global` location is not supported for batch translation.
*
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
* @param {string} request.sourceLanguageCode
* Required. The BCP-47 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support (https://cloud.google.com/translate/docs/languages).
* @param {string[]} request.targetLanguageCodes
* Required. The BCP-47 language code to use for translation of the input
* document. Specify up to 10 language codes here.
* @param {number[]} request.inputConfigs
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
* @param {google.cloud.translation.v3beta1.BatchDocumentOutputConfig} request.outputConfig
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
* @param {number[]} [request.models]
* 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,
* or an AutoML Translation model.
*
* The value format depends on model type:
*
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
*
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
*
*
* If the map is empty or a specific model is not requested for a language
* pair, then default google model (nmt) is used.
* @param {number[]} [request.glossaries]
* Optional. Glossaries to be applied. It's keyed by target language code.
* @param {number[]} [request.formatConversions]
* Optional. File format conversion map to be applied to all input files.
* Map's key is the original mime_type. Map's value is the target mime_type of
* translated documents.
*
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
*
* If nothing specified, output files will be in the same format as the
* original file.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.batch_translate_document.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async
*/
batchTranslateDocument(request?: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
batchTranslateDocument(request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -155,10 +597,33 @@ batchTranslateDocument(request: protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentResponse, protos.google.cloud.translation.v3beta1.IBatchTranslateDocumentMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkBatchTranslateDocumentProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3beta1/translation_service.batch_translate_document.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_BatchTranslateDocument_async
*/
checkBatchTranslateDocumentProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3beta1.BatchTranslateDocumentResponse, protos.google.cloud.translation.v3beta1.BatchTranslateDocumentMetadata>>;
createGlossary(request?: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3beta1.IGlossary, protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Creates a glossary and returns the long-running operation. Returns
* NOT_FOUND, if the project doesn't exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. The project name.
* @param {google.cloud.translation.v3beta1.Glossary} request.glossary
* Required. The glossary to create.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.create_glossary.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_CreateGlossary_async
*/
createGlossary(request?: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3beta1.IGlossary, protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
createGlossary(request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IGlossary, protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -175,10 +640,32 @@ createGlossary(request: protos.google.cloud.translation.v3beta1.ICreateGlossaryRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IGlossary, protos.google.cloud.translation.v3beta1.ICreateGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkCreateGlossaryProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3beta1/translation_service.create_glossary.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_CreateGlossary_async
*/
checkCreateGlossaryProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3beta1.Glossary, protos.google.cloud.translation.v3beta1.CreateGlossaryMetadata>>;
deleteGlossary(request?: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
/**
* Deletes a glossary, or cancels glossary construction
* if the glossary isn't created yet.
* Returns NOT_FOUND, if the glossary doesn't exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the glossary to delete.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
* for more details and examples.
* @example <caption>include:samples/generated/v3beta1/translation_service.delete_glossary.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_DeleteGlossary_async
*/
deleteGlossary(request?: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
deleteGlossary(request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -195,10 +682,57 @@ deleteGlossary(request: protos.google.cloud.translation.v3beta1.IDeleteGlossaryRequest, callback: Callback<LROperation<protos.google.cloud.translation.v3beta1.IDeleteGlossaryResponse, protos.google.cloud.translation.v3beta1.IDeleteGlossaryMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

* for more details and examples.
* @example
* const decodedOperation = await checkDeleteGlossaryProgress(name);
* console.log(decodedOperation.result);
* console.log(decodedOperation.done);
* console.log(decodedOperation.metadata);
* @example <caption>include:samples/generated/v3beta1/translation_service.delete_glossary.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_DeleteGlossary_async
*/
checkDeleteGlossaryProgress(name: string): Promise<LROperation<protos.google.cloud.translation.v3beta1.DeleteGlossaryResponse, protos.google.cloud.translation.v3beta1.DeleteGlossaryMetadata>>;
listGlossaries(request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options?: CallOptions): Promise<[protos.google.cloud.translation.v3beta1.IGlossary[], protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null, protos.google.cloud.translation.v3beta1.IListGlossariesResponse]>;
/**
* Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't
* exist.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. The name of the project from which to list all of the glossaries.
* @param {number} [request.pageSize]
* Optional. Requested page size. The server may return fewer glossaries than
* requested. If unspecified, the server picks an appropriate default.
* @param {string} [request.pageToken]
* Optional. A token identifying a page of results the server should return.
* 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.
* @param {string} [request.filter]
* Optional. Filter specifying constraints of a list operation.
* Specify the constraint by the format of "key=value", where key must be
* "src" or "tgt", and the value must be a valid language code.
* For multiple restrictions, concatenate them by "AND" (uppercase only),
* such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
* here, which means using 'en-US' and 'en' can lead to different results,
* which depends on the language code you used when you create the glossary.
* For the unidirectional glossaries, the "src" and "tgt" add restrictions
* on the source and target language code separately.
* For the equivalent term set glossaries, the "src" and/or "tgt" add
* restrictions on the term set.
* For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
* glossaries which exactly match the source language code as "en-US" and the
* target language code "zh-CN", but all equivalent term set glossaries which
* contain "en-US" and "zh-CN" in their language set will be picked.
* If missing, no filtering is performed.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is Array of [Glossary]{@link google.cloud.translation.v3beta1.Glossary}.
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
* Note that it can affect your quota.
* We recommend using `listGlossariesAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/
listGlossaries(request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options?: CallOptions): Promise<[
protos.google.cloud.translation.v3beta1.IGlossary[],
protos.google.cloud.translation.v3beta1.IListGlossariesRequest | null,
protos.google.cloud.translation.v3beta1.IListGlossariesResponse
]>;
listGlossaries(request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.translation.v3beta1.IListGlossariesRequest, protos.google.cloud.translation.v3beta1.IListGlossariesResponse | null | undefined, protos.google.cloud.translation.v3beta1.IGlossary>): void;

@@ -293,7 +827,4 @@ listGlossaries(request: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, callback: PaginationCallback<protos.google.cloud.translation.v3beta1.IListGlossariesRequest, protos.google.cloud.translation.v3beta1.IListGlossariesResponse | null | undefined, protos.google.cloud.translation.v3beta1.IGlossary>): void;

* for more details and examples.
* @example
* const iterable = client.listGlossariesAsync(request);
* for await (const response of iterable) {
* // process response
* }
* @example <caption>include:samples/generated/v3beta1/translation_service.list_glossaries.js</caption>
* region_tag:translate_v3beta1_generated_TranslationService_ListGlossaries_async
*/

@@ -300,0 +831,0 @@ listGlossariesAsync(request?: protos.google.cloud.translation.v3beta1.IListGlossariesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.translation.v3beta1.IGlossary>;

@@ -7,2 +7,24 @@ # Changelog

## [7.0.0](https://github.com/googleapis/nodejs-translate/compare/v6.3.1...v7.0.0) (2022-06-30)
### ⚠ BREAKING CHANGES
* update library to use Node 12 (#789)
### Features
* support regapic LRO ([#798](https://github.com/googleapis/nodejs-translate/issues/798)) ([9f1ddc1](https://github.com/googleapis/nodejs-translate/commit/9f1ddc167b20e1b5c3eeadf68867ba2294f2bb12))
### Bug Fixes
* **deps:** update dependency @google-cloud/common to v4 ([#793](https://github.com/googleapis/nodejs-translate/issues/793)) ([a2d079b](https://github.com/googleapis/nodejs-translate/commit/a2d079b6b36c67a21d2c3860c1c1fb497f56c499))
* **test:** fix language detection test ([#779](https://github.com/googleapis/nodejs-translate/issues/779)) ([b6df5e2](https://github.com/googleapis/nodejs-translate/commit/b6df5e27ce37bab53f654bcfdfabf40b8db3e8a0))
### Build System
* update library to use Node 12 ([#789](https://github.com/googleapis/nodejs-translate/issues/789)) ([3060301](https://github.com/googleapis/nodejs-translate/commit/30603014cecb2da9cc73c561bd1fb127a158d84d))
### [6.3.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.3.0...v6.3.1) (2021-10-18)

@@ -9,0 +31,0 @@

{
"name": "@google-cloud/translate",
"description": "Cloud Translation API Client Library for Node.js",
"version": "6.3.1",
"version": "7.0.0",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
"node": ">=10"
"node": ">=12.0.0"
},

@@ -50,7 +50,7 @@ "repository": "googleapis/nodejs-translate",

"dependencies": {
"@google-cloud/common": "^3.0.0",
"@google-cloud/common": "^4.0.0",
"@google-cloud/promisify": "^2.0.0",
"arrify": "^2.0.0",
"extend": "^3.0.2",
"google-gax": "^2.24.1",
"google-gax": "^3.0.1",
"is-html": "^2.0.0",

@@ -61,4 +61,4 @@ "protobufjs": "^6.8.8"

"@types/extend": "^3.0.0",
"@types/mocha": "^8.0.0",
"@types/node": "^14.0.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.0.0",
"@types/proxyquire": "^1.3.28",

@@ -70,14 +70,14 @@ "@types/request": "^2.47.1",

"google-auth-library": "^6.0.0",
"gts": "^2.0.0",
"gts": "^3.1.0",
"http2spy": "^2.0.0",
"jsdoc": "^3.6.2",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"jsdoc-fresh": "^2.0.0",
"jsdoc-region-tag": "^2.0.0",
"linkinator": "^2.0.0",
"mocha": "^8.0.0",
"mocha": "^9.2.2",
"pack-n-play": "^1.0.0-2",
"proxyquire": "^2.0.1",
"sinon": "^11.0.0",
"typescript": "^3.8.3"
"sinon": "^14.0.0",
"typescript": "^4.6.4"
}
}

@@ -7,5 +7,4 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-translate/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-translate)

@@ -116,18 +115,18 @@

Node.js.
If you are using an end-of-life version of Node.js, we recommend that you update
as soon as possible to an actively supported LTS version.
Google's client libraries support legacy versions of Node.js runtimes on a
best-efforts basis with the following warnings:
* Legacy versions are not tested in continuous integration.
* Some security patches and features cannot be backported.
* Dependencies cannot be kept up-to-date.
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
The dist-tags follow the naming convention `legacy-(version)`.
For example, `npm install @google-cloud/translate@legacy-8` installs client libraries
for versions compatible with Node.js 8.
_Legacy Node.js versions are supported as a best effort:_
* Legacy versions will not be tested in continuous integration.
* Some security patches may not be able to be backported.
* Dependencies will not be kept up-to-date, and features will not be backported.
#### Legacy tags available
* `legacy-8`: install client libraries from this dist-tag for versions
compatible with Node.js 8.
## Versioning

@@ -138,6 +137,6 @@

This library is considered to be **General Availability (GA)**. This means it
is stable; the code surface will not change in backwards-incompatible ways
This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways
unless absolutely necessary (e.g. because of critical security issues) or with
an extensive deprecation period. Issues and requests against **GA** libraries
an extensive deprecation period. Issues and requests against **stable** libraries
are addressed with the highest priority.

@@ -149,2 +148,3 @@

More Information: [Google Cloud Platform Launch Stages][launch_stages]

@@ -151,0 +151,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc