public static class TranslateOptions.Builder extends com.google.cloud.ServiceOptions.Builder<Translate,TranslateOptions,TranslateOptions.Builder>
Modifier and Type | Method and Description |
---|---|
TranslateOptions |
build() |
Credentials |
getCredentials()
Returns the authentication credentials.
|
TranslateOptions.Builder |
setApiKey(String apiKey)
Deprecated.
|
TranslateOptions.Builder |
setProjectId(String projectId)
Sets the project ID.
|
TranslateOptions.Builder |
setTargetLanguage(String targetLanguage)
Sets the code for the default target language.
|
TranslateOptions.Builder |
setTransportOptions(com.google.cloud.TransportOptions transportOptions) |
public Credentials getCredentials()
public TranslateOptions.Builder setTransportOptions(com.google.cloud.TransportOptions transportOptions)
setTransportOptions
in class com.google.cloud.ServiceOptions.Builder<Translate,TranslateOptions,TranslateOptions.Builder>
public TranslateOptions.Builder setProjectId(String projectId)
Translate
service.setProjectId
in class com.google.cloud.ServiceOptions.Builder<Translate,TranslateOptions,TranslateOptions.Builder>
@Deprecated public TranslateOptions.Builder setApiKey(String apiKey)
setCredentials
. If neither are set,
and no Application Default Credentials are available, an API key is looked for in the GOOGLE_API_KEY
environment variable. For instructions on how to get an API key, see the Translate Quickstart.public TranslateOptions.Builder setTargetLanguage(String targetLanguage)
en
) is used.
Calls to Translate.translate(List, TranslateOption...)
and Translate.translate(String, TranslateOption...)
will use this value unless an option from
Translate.TranslateOption.targetLanguage(String)
is explicitly provided.public TranslateOptions build()
build
in class com.google.cloud.ServiceOptions.Builder<Translate,TranslateOptions,TranslateOptions.Builder>
Copyright © 2022 Google LLC. All rights reserved.