Class v3.TranslationServiceClient (6.1.0)

Provides natural language translation operations. v3

Package

@google-cloud/translate!

Constructors

(constructor)(opts)

  constructor 
 ( 
 opts 
 ?: 
  
 ClientOptions 
 ); 
 

Construct an instance of TranslationServiceClient.

Parameter
Name Description
opts ClientOptions

Properties

apiEndpoint

  static 
  
 get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Property Value
Type Description
string

auth

  auth 
 : 
  
 gax 
 . 
 GoogleAuth 
 ; 
 
Property Value
Type Description
gax. GoogleAuth

descriptors

  descriptors 
 : 
  
 Descriptors 
 ; 
 
Property Value
Type Description
Descriptors

innerApiCalls

  innerApiCalls 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }; 
 
Property Value
Type Description
{ [name: string]: Function ; }

operationsClient

  operationsClient 
 : 
  
 gax 
 . 
 OperationsClient 
 ; 
 
Property Value
Type Description
gax. OperationsClient

pathTemplates

  pathTemplates 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 gax 
 . 
 PathTemplate 
 ; 
  
 }; 
 
Property Value
Type Description
{ [name: string]: gax. PathTemplate ; }

port

  static 
  
 get 
  
 port 
 () 
 : 
  
 number 
 ; 
 

The port for this API service.

Property Value
Type Description
number

scopes

  static 
  
 get 
  
 scopes 
 () 
 : 
  
 string 
 []; 
 

The scopes needed to make gRPC calls for every method defined in this service.

Property Value
Type Description
string[]

servicePath

  static 
  
 get 
  
 servicePath 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

Property Value
Type Description
string

translationServiceStub

  translationServiceStub 
 ?: 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 
Property Value
Type Description
Promise <{ [name: string]: Function ; }>

Methods

batchTranslateText(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.IBatchTranslateTextRequest
options CallOptions
Returns
Type Description
Promise <[ LROperation <protos. google.cloud.translation.v3.IBatchTranslateResponse , protos. google.cloud.translation.v3.IBatchTranslateMetadata >, protos. google.longrunning.IOperation | undefined, {} | undefined]>

batchTranslateText(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

batchTranslateText(request, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

checkBatchTranslateTextProgress(name)

  checkBatchTranslateTextProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 BatchTranslateResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 BatchTranslateMetadata 
>> ; 
 

Check the status of the long running operation returned by batchTranslateText() .

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise < LROperation <protos. google.cloud.translation.v3.BatchTranslateResponse , protos. google.cloud.translation.v3.BatchTranslateMetadata >>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

checkCreateGlossaryProgress(name)

  checkCreateGlossaryProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 Glossary 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 CreateGlossaryMetadata 
>> ; 
 

Check the status of the long running operation returned by createGlossary() .

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise < LROperation <protos. google.cloud.translation.v3.Glossary , protos. google.cloud.translation.v3.CreateGlossaryMetadata >>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

checkDeleteGlossaryProgress(name)

  checkDeleteGlossaryProgress 
 ( 
 name 
 : 
  
 string 
 ) 
 : 
  
 Promise<LROperation<protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 DeleteGlossaryResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 DeleteGlossaryMetadata 
>> ; 
 

Check the status of the long running operation returned by deleteGlossary() .

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise < LROperation <protos. google.cloud.translation.v3.DeleteGlossaryResponse , protos. google.cloud.translation.v3.DeleteGlossaryMetadata >>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

close()

  close 
 () 
 : 
  
 Promise<void> 
 ; 
 

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type Description
Promise <void>

{Promise} A promise that resolves when the client is closed.

createGlossary(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.ICreateGlossaryRequest
options CallOptions
Returns
Type Description
Promise <[ LROperation <protos. google.cloud.translation.v3.IGlossary , protos. google.cloud.translation.v3.ICreateGlossaryMetadata >, protos. google.longrunning.IOperation | undefined, {} | undefined]>

createGlossary(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

createGlossary(request, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

deleteGlossary(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.IDeleteGlossaryRequest
options CallOptions
Returns
Type Description
Promise <[ LROperation <protos. google.cloud.translation.v3.IDeleteGlossaryResponse , protos. google.cloud.translation.v3.IDeleteGlossaryMetadata >, protos. google.longrunning.IOperation | undefined, {} | undefined]>

deleteGlossary(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

deleteGlossary(request, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

detectLanguage(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.IDetectLanguageRequest
options CallOptions
Returns
Type Description
Promise <[protos. google.cloud.translation.v3.IDetectLanguageResponse , protos. google.cloud.translation.v3.IDetectLanguageRequest | undefined, {} | undefined]>

detectLanguage(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

detectLanguage(request, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

getGlossary(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.IGetGlossaryRequest
options CallOptions
Returns
Type Description
Promise <[protos. google.cloud.translation.v3.IGlossary , protos. google.cloud.translation.v3.IGetGlossaryRequest | undefined, {} | undefined]>

getGlossary(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

getGlossary(request, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

getProjectId()

  getProjectId 
 () 
 : 
  
 Promise<string> 
 ; 
 
Returns
Type Description
Promise <string>

getProjectId(callback)

  getProjectId 
 ( 
 callback 
 : 
  
 Callback<string 
 , 
  
 undefined 
 , 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameter
Name Description
callback Callback <string, undefined, undefined>
Returns
Type Description
void

getSupportedLanguages(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.IGetSupportedLanguagesRequest
options CallOptions
Returns
Type Description
Promise <[protos. google.cloud.translation.v3.ISupportedLanguages , (protos. google.cloud.translation.v3.IGetSupportedLanguagesRequest | undefined), {} | undefined]>

getSupportedLanguages(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

getSupportedLanguages(request, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

glossaryPath(project, location, glossary)

  glossaryPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 glossary 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified glossary resource name string.

Parameters
Name Description
project string
location string
glossary string
Returns
Type Description
string

{string} Resource name string.

initialize()

  initialize 
 () 
 : 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 

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
Type Description
Promise <{ [name: string]: Function ; }>

{Promise} A promise that resolves to an authenticated service stub.

listGlossaries(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.IListGlossariesRequest
options CallOptions
Returns
Type Description
Promise <[protos. google.cloud.translation.v3.IGlossary [], protos. google.cloud.translation.v3.IListGlossariesRequest | null, protos. google.cloud.translation.v3.IListGlossariesResponse ]>

listGlossaries(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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 >
Returns
Type Description
void

listGlossaries(request, callback)

  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 
 ; 
 
Parameters
Name Description
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 >
Returns
Type Description
void

listGlossariesAsync(request, options)

  listGlossariesAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 IListGlossariesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 IGlossary 
> ; 
 

Equivalent to listGlossaries , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request protos. google.cloud.translation.v3.IListGlossariesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable <protos. google.cloud.translation.v3.IGlossary >

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Glossary]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listGlossariesStream(request, options)

  listGlossariesStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 translation 
 . 
 v3 
 . 
 IListGlossariesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to method.name.toCamelCase() , but returns a NodeJS Stream object.

Parameters
Name Description
request protos. google.cloud.translation.v3.IListGlossariesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing [Glossary] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. 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.

locationPath(project, location)

  locationPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified location resource name string.

Parameters
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

matchGlossaryFromGlossaryName(glossaryName)

  matchGlossaryFromGlossaryName 
 ( 
 glossaryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the glossary from Glossary resource.

Parameter
Name Description
glossaryName string

A fully-qualified path representing Glossary resource.

Returns
Type Description
string | number

{string} A string representing the glossary.

matchLocationFromGlossaryName(glossaryName)

  matchLocationFromGlossaryName 
 ( 
 glossaryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Glossary resource.

Parameter
Name Description
glossaryName string

A fully-qualified path representing Glossary resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

  matchLocationFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchProjectFromGlossaryName(glossaryName)

  matchProjectFromGlossaryName 
 ( 
 glossaryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Glossary resource.

Parameter
Name Description
glossaryName string

A fully-qualified path representing Glossary resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

  matchProjectFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the project.

translateText(request, options)

  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 
 ]>; 
 
Parameters
Name Description
request protos. google.cloud.translation.v3.ITranslateTextRequest
options CallOptions
Returns
Type Description
Promise <[protos. google.cloud.translation.v3.ITranslateTextResponse , protos. google.cloud.translation.v3.ITranslateTextRequest | undefined, {} | undefined]>

translateText(request, options, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void

translateText(request, callback)

  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 
 ; 
 
Parameters
Name Description
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>
Returns
Type Description
void
Design a Mobile Site
View Site in Mobile | Classic
Share by: