TranslationService

google.cloud.translation.v3. TranslationService

Represents a TranslationService

Constructor

new TranslationService(rpcImpl, requestDelimitedopt, responseDelimitedopt)

Constructs a new TranslationService service.

Parameters:
Name Type Attributes Default Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean <optional>
false

Whether requests are length-delimited

responseDelimited boolean <optional>
false

Whether responses are length-delimited

Extends

  • $protobuf.rpc.Service

Methods

(static) create(rpcImpl, requestDelimitedopt, responseDelimitedopt) → {TranslationService}

Creates new TranslationService service using the specified rpc implementation.

Parameters:
Name Type Attributes Default Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean <optional>
false

Whether requests are length-delimited

responseDelimited boolean <optional>
false

Whether responses are length-delimited

batchTranslateText(request, callback) → {undefined}

Calls BatchTranslateText.

Parameters:
Name Type Description
request google.cloud.translation.v3.IBatchTranslateTextRequest

BatchTranslateTextRequest message or plain object

callback google.cloud.translation.v3.TranslationService.BatchTranslateTextCallback

Node-style callback called with the error, if any, and Operation

batchTranslateText(request) → {Promise.<google.longrunning.Operation>}

Calls BatchTranslateText.

Parameters:
Name Type Description
request google.cloud.translation.v3.IBatchTranslateTextRequest

BatchTranslateTextRequest message or plain object

createGlossary(request, callback) → {undefined}

Calls CreateGlossary.

Parameters:
Name Type Description
request google.cloud.translation.v3.ICreateGlossaryRequest

CreateGlossaryRequest message or plain object

callback google.cloud.translation.v3.TranslationService.CreateGlossaryCallback

Node-style callback called with the error, if any, and Operation

createGlossary(request) → {Promise.<google.longrunning.Operation>}

Calls CreateGlossary.

Parameters:
Name Type Description
request google.cloud.translation.v3.ICreateGlossaryRequest

CreateGlossaryRequest message or plain object

deleteGlossary(request, callback) → {undefined}

Calls DeleteGlossary.

Parameters:
Name Type Description
request google.cloud.translation.v3.IDeleteGlossaryRequest

DeleteGlossaryRequest message or plain object

callback google.cloud.translation.v3.TranslationService.DeleteGlossaryCallback

Node-style callback called with the error, if any, and Operation

deleteGlossary(request) → {Promise.<google.longrunning.Operation>}

Calls DeleteGlossary.

Parameters:
Name Type Description
request google.cloud.translation.v3.IDeleteGlossaryRequest

DeleteGlossaryRequest message or plain object

detectLanguage(request, callback) → {undefined}

Calls DetectLanguage.

Parameters:
Name Type Description
request google.cloud.translation.v3.IDetectLanguageRequest

DetectLanguageRequest message or plain object

callback google.cloud.translation.v3.TranslationService.DetectLanguageCallback

Node-style callback called with the error, if any, and DetectLanguageResponse

detectLanguage(request) → {Promise.<google.cloud.translation.v3.DetectLanguageResponse>}

Calls DetectLanguage.

Parameters:
Name Type Description
request google.cloud.translation.v3.IDetectLanguageRequest

DetectLanguageRequest message or plain object

getGlossary(request, callback) → {undefined}

Calls GetGlossary.

Parameters:
Name Type Description
request google.cloud.translation.v3.IGetGlossaryRequest

GetGlossaryRequest message or plain object

callback google.cloud.translation.v3.TranslationService.GetGlossaryCallback

Node-style callback called with the error, if any, and Glossary

getGlossary(request) → {Promise.<google.cloud.translation.v3.Glossary>}

Calls GetGlossary.

Parameters:
Name Type Description
request google.cloud.translation.v3.IGetGlossaryRequest

GetGlossaryRequest message or plain object

getSupportedLanguages(request, callback) → {undefined}

Calls GetSupportedLanguages.

Parameters:
Name Type Description
request google.cloud.translation.v3.IGetSupportedLanguagesRequest

GetSupportedLanguagesRequest message or plain object

callback google.cloud.translation.v3.TranslationService.GetSupportedLanguagesCallback

Node-style callback called with the error, if any, and SupportedLanguages

getSupportedLanguages(request) → {Promise.<google.cloud.translation.v3.SupportedLanguages>}

Calls GetSupportedLanguages.

Parameters:
Name Type Description
request google.cloud.translation.v3.IGetSupportedLanguagesRequest

GetSupportedLanguagesRequest message or plain object

listGlossaries(request, callback) → {undefined}

Calls ListGlossaries.

Parameters:
Name Type Description
request google.cloud.translation.v3.IListGlossariesRequest

ListGlossariesRequest message or plain object

callback google.cloud.translation.v3.TranslationService.ListGlossariesCallback

Node-style callback called with the error, if any, and ListGlossariesResponse

listGlossaries(request) → {Promise.<google.cloud.translation.v3.ListGlossariesResponse>}

Calls ListGlossaries.

Parameters:
Name Type Description
request google.cloud.translation.v3.IListGlossariesRequest

ListGlossariesRequest message or plain object

translateText(request, callback) → {undefined}

Calls TranslateText.

Parameters:
Name Type Description
request google.cloud.translation.v3.ITranslateTextRequest

TranslateTextRequest message or plain object

callback google.cloud.translation.v3.TranslationService.TranslateTextCallback

Node-style callback called with the error, if any, and TranslateTextResponse

translateText(request) → {Promise.<google.cloud.translation.v3.TranslateTextResponse>}

Calls TranslateText.

Parameters:
Name Type Description
request google.cloud.translation.v3.ITranslateTextRequest

TranslateTextRequest message or plain object

Type Definitions

BatchTranslateTextCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#batchTranslateText.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

CreateGlossaryCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#createGlossary.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

DeleteGlossaryCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#deleteGlossary.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.longrunning.Operation <optional>

Operation

DetectLanguageCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#detectLanguage.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.translation.v3.DetectLanguageResponse <optional>

DetectLanguageResponse

GetGlossaryCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#getGlossary.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.translation.v3.Glossary <optional>

Glossary

GetSupportedLanguagesCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#getSupportedLanguages.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.translation.v3.SupportedLanguages <optional>

SupportedLanguages

ListGlossariesCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#listGlossaries.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.translation.v3.ListGlossariesResponse <optional>

ListGlossariesResponse

TranslateTextCallback(error, responseopt)

Callback as used by google.cloud.translation.v3.TranslationService#translateText.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.cloud.translation.v3.TranslateTextResponse <optional>

TranslateTextResponse