UNPKG

@google-cloud/translate

Version:
750 lines 183 kB
import type * as gax from 'google-gax'; import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, IamClient, IamProtos, LocationsClient, LocationProtos } from 'google-gax'; import { Transform } from 'stream'; import * as protos from '../../protos/protos'; /** * Provides natural language translation operations. * @class * @memberof v3 */ export declare class TranslationServiceClient { private _terminated; private _opts; private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; private _universeDomain; private _servicePath; private _log; auth: gax.GoogleAuth; descriptors: Descriptors; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; iamClient: IamClient; locationsClient: LocationsClient; pathTemplates: { [name: string]: gax.PathTemplate; }; operationsClient: gax.OperationsClient; translationServiceStub?: Promise<{ [name: string]: Function; }>; /** * Construct an instance of TranslationServiceClient. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you * need to avoid loading the default gRPC version and want to use the fallback * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC * const client = new TranslationServiceClient({fallback: true}, gax); * ``` */ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize(): Promise<{ [name: string]: Function; }>; /** * The DNS address for this API service. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get servicePath(): string; /** * The DNS address for this API service - same as servicePath. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get apiEndpoint(): string; /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ get apiEndpoint(): string; get universeDomain(): string; /** * The port for this API service. * @returns {number} The default port for this service. */ static get port(): number; /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes(): string[]; getProjectId(): Promise<string>; getProjectId(callback: Callback<string, undefined, undefined>): void; /** * 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 30,000 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 ISO-639 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 ISO-639 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`, * * - Translation LLM models: * `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, * * 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 {google.cloud.translation.v3.TransliterationConfig} [request.transliterationConfig] * Optional. Transliteration to be applied. * @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 {@link protos.google.cloud.translation.v3.TranslateTextResponse|TranslateTextResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * 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; /** * Romanize input text written in non-Latin scripts to Latin text. * * @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}`. * @param {string[]} request.contents * Required. The content of the input in string format. * @param {string} [request.sourceLanguageCode] * Optional. The ISO-639 language code of the input text if * known, for example, "hi" or "zh". If the source language isn't specified, * the API attempts to identify the source language automatically and returns * the source language for each content in the response. * @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 {@link protos.google.cloud.translation.v3.RomanizeTextResponse|RomanizeTextResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.romanize_text.js</caption> * region_tag:translate_v3_generated_TranslationService_RomanizeText_async */ romanizeText(request?: protos.google.cloud.translation.v3.IRomanizeTextRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IRomanizeTextResponse, protos.google.cloud.translation.v3.IRomanizeTextRequest | undefined, {} | undefined ]>; romanizeText(request: protos.google.cloud.translation.v3.IRomanizeTextRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IRomanizeTextResponse, protos.google.cloud.translation.v3.IRomanizeTextRequest | null | undefined, {} | null | undefined>): void; romanizeText(request: protos.google.cloud.translation.v3.IRomanizeTextRequest, callback: Callback<protos.google.cloud.translation.v3.IRomanizeTextResponse, protos.google.cloud.translation.v3.IRomanizeTextRequest | null | undefined, {} | null | undefined>): void; /** * 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 {@link protos.google.cloud.translation.v3.DetectLanguageResponse|DetectLanguageResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * 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; /** * 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 {@link protos.google.cloud.translation.v3.SupportedLanguages|SupportedLanguages}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * 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; /** * 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 ISO-639 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 ISO-639 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 {string} [request.customizedAttribution] * Optional. This flag is to support user customized attribution. * If not provided, the default is `Machine Translated by Google`. * Customized attribution should follow rules in * https://cloud.google.com/translate/attribution#attribution_and_logos * @param {boolean} [request.isTranslateNativePdfOnly] * Optional. is_translate_native_pdf_only field for external customers. * If true, the page limit of online native pdf translation is 300 and only * native pdf pages will be translated. * @param {boolean} [request.enableShadowRemovalNativePdf] * Optional. If true, use the text removal server to remove the shadow text on * background image for native pdf translation. * Shadow removal feature can only be enabled when * is_translate_native_pdf_only: false && pdf_native_only: false * @param {boolean} [request.enableRotationCorrection] * Optional. If true, enable auto rotation correction in DVS. * @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 {@link protos.google.cloud.translation.v3.TranslateDocumentResponse|TranslateDocumentResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * 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; /** * 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 {@link protos.google.cloud.translation.v3.Glossary|Glossary}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * 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; /** * Gets a single glossary entry by the given id. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The resource name of the glossary entry to get * @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 {@link protos.google.cloud.translation.v3.GlossaryEntry|GlossaryEntry}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.get_glossary_entry.js</caption> * region_tag:translate_v3_generated_TranslationService_GetGlossaryEntry_async */ getGlossaryEntry(request?: protos.google.cloud.translation.v3.IGetGlossaryEntryRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IGlossaryEntry, protos.google.cloud.translation.v3.IGetGlossaryEntryRequest | undefined, {} | undefined ]>; getGlossaryEntry(request: protos.google.cloud.translation.v3.IGetGlossaryEntryRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IGlossaryEntry, protos.google.cloud.translation.v3.IGetGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; getGlossaryEntry(request: protos.google.cloud.translation.v3.IGetGlossaryEntryRequest, callback: Callback<protos.google.cloud.translation.v3.IGlossaryEntry, protos.google.cloud.translation.v3.IGetGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; /** * Creates a glossary entry. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The resource name of the glossary to create the entry under. * @param {google.cloud.translation.v3.GlossaryEntry} request.glossaryEntry * Required. The glossary entry 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 {@link protos.google.cloud.translation.v3.GlossaryEntry|GlossaryEntry}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.create_glossary_entry.js</caption> * region_tag:translate_v3_generated_TranslationService_CreateGlossaryEntry_async */ createGlossaryEntry(request?: protos.google.cloud.translation.v3.ICreateGlossaryEntryRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IGlossaryEntry, (protos.google.cloud.translation.v3.ICreateGlossaryEntryRequest | undefined), {} | undefined ]>; createGlossaryEntry(request: protos.google.cloud.translation.v3.ICreateGlossaryEntryRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IGlossaryEntry, protos.google.cloud.translation.v3.ICreateGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; createGlossaryEntry(request: protos.google.cloud.translation.v3.ICreateGlossaryEntryRequest, callback: Callback<protos.google.cloud.translation.v3.IGlossaryEntry, protos.google.cloud.translation.v3.ICreateGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; /** * Updates a glossary entry. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.translation.v3.GlossaryEntry} request.glossaryEntry * Required. The glossary entry to update. * @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 {@link protos.google.cloud.translation.v3.GlossaryEntry|GlossaryEntry}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.update_glossary_entry.js</caption> * region_tag:translate_v3_generated_TranslationService_UpdateGlossaryEntry_async */ updateGlossaryEntry(request?: protos.google.cloud.translation.v3.IUpdateGlossaryEntryRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IGlossaryEntry, (protos.google.cloud.translation.v3.IUpdateGlossaryEntryRequest | undefined), {} | undefined ]>; updateGlossaryEntry(request: protos.google.cloud.translation.v3.IUpdateGlossaryEntryRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IGlossaryEntry, protos.google.cloud.translation.v3.IUpdateGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; updateGlossaryEntry(request: protos.google.cloud.translation.v3.IUpdateGlossaryEntryRequest, callback: Callback<protos.google.cloud.translation.v3.IGlossaryEntry, protos.google.cloud.translation.v3.IUpdateGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; /** * Deletes a single entry from the glossary * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The resource name of the glossary entry 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 {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.delete_glossary_entry.js</caption> * region_tag:translate_v3_generated_TranslationService_DeleteGlossaryEntry_async */ deleteGlossaryEntry(request?: protos.google.cloud.translation.v3.IDeleteGlossaryEntryRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.translation.v3.IDeleteGlossaryEntryRequest | undefined), {} | undefined ]>; deleteGlossaryEntry(request: protos.google.cloud.translation.v3.IDeleteGlossaryEntryRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.translation.v3.IDeleteGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; deleteGlossaryEntry(request: protos.google.cloud.translation.v3.IDeleteGlossaryEntryRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.translation.v3.IDeleteGlossaryEntryRequest | null | undefined, {} | null | undefined>): void; /** * Gets a Dataset. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The resource name of the dataset 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 {@link protos.google.cloud.translation.v3.Dataset|Dataset}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.get_dataset.js</caption> * region_tag:translate_v3_generated_TranslationService_GetDataset_async */ getDataset(request?: protos.google.cloud.translation.v3.IGetDatasetRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IDataset, protos.google.cloud.translation.v3.IGetDatasetRequest | undefined, {} | undefined ]>; getDataset(request: protos.google.cloud.translation.v3.IGetDatasetRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IDataset, protos.google.cloud.translation.v3.IGetDatasetRequest | null | undefined, {} | null | undefined>): void; getDataset(request: protos.google.cloud.translation.v3.IGetDatasetRequest, callback: Callback<protos.google.cloud.translation.v3.IDataset, protos.google.cloud.translation.v3.IGetDatasetRequest | null | undefined, {} | null | undefined>): void; /** * Creates an Adaptive MT dataset. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Name of the parent project. In form of * `projects/{project-number-or-id}/locations/{location-id}` * @param {google.cloud.translation.v3.AdaptiveMtDataset} request.adaptiveMtDataset * Required. The AdaptiveMtDataset to be created. * @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 {@link protos.google.cloud.translation.v3.AdaptiveMtDataset|AdaptiveMtDataset}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.create_adaptive_mt_dataset.js</caption> * region_tag:translate_v3_generated_TranslationService_CreateAdaptiveMtDataset_async */ createAdaptiveMtDataset(request?: protos.google.cloud.translation.v3.ICreateAdaptiveMtDatasetRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IAdaptiveMtDataset, (protos.google.cloud.translation.v3.ICreateAdaptiveMtDatasetRequest | undefined), {} | undefined ]>; createAdaptiveMtDataset(request: protos.google.cloud.translation.v3.ICreateAdaptiveMtDatasetRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtDataset, protos.google.cloud.translation.v3.ICreateAdaptiveMtDatasetRequest | null | undefined, {} | null | undefined>): void; createAdaptiveMtDataset(request: protos.google.cloud.translation.v3.ICreateAdaptiveMtDatasetRequest, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtDataset, protos.google.cloud.translation.v3.ICreateAdaptiveMtDatasetRequest | null | undefined, {} | null | undefined>): void; /** * Deletes an Adaptive MT dataset, including all its entries and associated * metadata. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. Name of the dataset. In the form of * `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` * @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 {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.delete_adaptive_mt_dataset.js</caption> * region_tag:translate_v3_generated_TranslationService_DeleteAdaptiveMtDataset_async */ deleteAdaptiveMtDataset(request?: protos.google.cloud.translation.v3.IDeleteAdaptiveMtDatasetRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.translation.v3.IDeleteAdaptiveMtDatasetRequest | undefined), {} | undefined ]>; deleteAdaptiveMtDataset(request: protos.google.cloud.translation.v3.IDeleteAdaptiveMtDatasetRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.translation.v3.IDeleteAdaptiveMtDatasetRequest | null | undefined, {} | null | undefined>): void; deleteAdaptiveMtDataset(request: protos.google.cloud.translation.v3.IDeleteAdaptiveMtDatasetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.translation.v3.IDeleteAdaptiveMtDatasetRequest | null | undefined, {} | null | undefined>): void; /** * Gets the Adaptive MT dataset. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. Name of the dataset. In the form of * `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` * @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 {@link protos.google.cloud.translation.v3.AdaptiveMtDataset|AdaptiveMtDataset}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.get_adaptive_mt_dataset.js</caption> * region_tag:translate_v3_generated_TranslationService_GetAdaptiveMtDataset_async */ getAdaptiveMtDataset(request?: protos.google.cloud.translation.v3.IGetAdaptiveMtDatasetRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IAdaptiveMtDataset, (protos.google.cloud.translation.v3.IGetAdaptiveMtDatasetRequest | undefined), {} | undefined ]>; getAdaptiveMtDataset(request: protos.google.cloud.translation.v3.IGetAdaptiveMtDatasetRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtDataset, protos.google.cloud.translation.v3.IGetAdaptiveMtDatasetRequest | null | undefined, {} | null | undefined>): void; getAdaptiveMtDataset(request: protos.google.cloud.translation.v3.IGetAdaptiveMtDatasetRequest, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtDataset, protos.google.cloud.translation.v3.IGetAdaptiveMtDatasetRequest | null | undefined, {} | null | undefined>): void; /** * Translate text using Adaptive MT. * * @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}`. * @param {string} request.dataset * Required. The resource name for the dataset to use for adaptive MT. * `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` * @param {string[]} request.content * Required. The content of the input in string format. * @param {google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentenceConfig} request.referenceSentenceConfig * Configuration for caller provided reference sentences. * @param {google.cloud.translation.v3.AdaptiveMtTranslateRequest.GlossaryConfig} [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 {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 {@link protos.google.cloud.translation.v3.AdaptiveMtTranslateResponse|AdaptiveMtTranslateResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.adaptive_mt_translate.js</caption> * region_tag:translate_v3_generated_TranslationService_AdaptiveMtTranslate_async */ adaptiveMtTranslate(request?: protos.google.cloud.translation.v3.IAdaptiveMtTranslateRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IAdaptiveMtTranslateResponse, (protos.google.cloud.translation.v3.IAdaptiveMtTranslateRequest | undefined), {} | undefined ]>; adaptiveMtTranslate(request: protos.google.cloud.translation.v3.IAdaptiveMtTranslateRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtTranslateResponse, protos.google.cloud.translation.v3.IAdaptiveMtTranslateRequest | null | undefined, {} | null | undefined>): void; adaptiveMtTranslate(request: protos.google.cloud.translation.v3.IAdaptiveMtTranslateRequest, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtTranslateResponse, protos.google.cloud.translation.v3.IAdaptiveMtTranslateRequest | null | undefined, {} | null | undefined>): void; /** * Gets and AdaptiveMtFile * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The resource name of the file, in form of * `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{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 {@link protos.google.cloud.translation.v3.AdaptiveMtFile|AdaptiveMtFile}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.get_adaptive_mt_file.js</caption> * region_tag:translate_v3_generated_TranslationService_GetAdaptiveMtFile_async */ getAdaptiveMtFile(request?: protos.google.cloud.translation.v3.IGetAdaptiveMtFileRequest, options?: CallOptions): Promise<[ protos.google.cloud.translation.v3.IAdaptiveMtFile, protos.google.cloud.translation.v3.IGetAdaptiveMtFileRequest | undefined, {} | undefined ]>; getAdaptiveMtFile(request: protos.google.cloud.translation.v3.IGetAdaptiveMtFileRequest, options: CallOptions, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtFile, protos.google.cloud.translation.v3.IGetAdaptiveMtFileRequest | null | undefined, {} | null | undefined>): void; getAdaptiveMtFile(request: protos.google.cloud.translation.v3.IGetAdaptiveMtFileRequest, callback: Callback<protos.google.cloud.translation.v3.IAdaptiveMtFile, protos.google.cloud.translation.v3.IGetAdaptiveMtFileRequest | null | undefined, {} | null | undefined>): void; /** * Deletes an AdaptiveMtFile along with its sentences. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The resource name of the file to delete, in form of * `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{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 {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/translation_service.delete_adaptive_mt_file.js</caption> * region_tag:translate_v3_generated_TranslationService_DeleteAdaptiveMtFile_async */ deleteAdaptiveMtFile(request?: protos.google.cloud.translation.v3.IDeleteAdaptiveMtFileRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.translation.v3.IDeleteAdaptiveMtFileRequest | undefined), {} | undefined ]>; deleteA