public static class TranslateOptions.Builder extends ServiceOptions.Builder<Translate,TranslateOptions,TranslateOptions.Builder>
credentials
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(TransportOptions transportOptions)
Sets the transport options.
|
self, setClock, setCredentials, setHeaderProvider, setHost, setRetrySettings, setServiceFactory, setServiceRpcFactory
public Credentials getCredentials()
public TranslateOptions.Builder setTransportOptions(TransportOptions transportOptions)
ServiceOptions.Builder
setTransportOptions
in class ServiceOptions.Builder<Translate,TranslateOptions,TranslateOptions.Builder>
public TranslateOptions.Builder setProjectId(String projectId)
Translate
service.setProjectId
in class 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 ServiceOptions.Builder<Translate,TranslateOptions,TranslateOptions.Builder>
Copyright © 2019 Google LLC. All rights reserved.