use of com.google.cloud.translate.TranslateOptions in project google-cloud-java by GoogleCloudPlatform.
the class RemoteTranslateHelper method create.
/**
* Creates a {@code RemoteStorageHelper} object.
*/
public static RemoteTranslateHelper create() {
HttpTransportOptions transportOptions = TranslateOptions.getDefaultHttpTransportOptions();
transportOptions = transportOptions.toBuilder().setConnectTimeout(60000).setReadTimeout(60000).build();
TranslateOptions translateOption = TranslateOptions.newBuilder().setRetrySettings(retryParams()).setTransportOptions(transportOptions).build();
return new RemoteTranslateHelper(translateOption);
}
use of com.google.cloud.translate.TranslateOptions in project google-cloud-java by GoogleCloudPlatform.
the class RemoteTranslateHelper method create.
/**
* Creates a {@code RemoteTranslateHelper} object for the given API key.
*
* @param apiKey API key used to issue requests to Google Translation.
*/
public static RemoteTranslateHelper create(String apiKey) {
HttpTransportOptions transportOptions = TranslateOptions.getDefaultHttpTransportOptions();
transportOptions = transportOptions.toBuilder().setConnectTimeout(60000).setReadTimeout(60000).build();
TranslateOptions translateOptions = TranslateOptions.newBuilder().setApiKey(apiKey).setRetrySettings(retryParams()).setTransportOptions(transportOptions).build();
return new RemoteTranslateHelper(translateOptions);
}
Aggregations