Interface FileTranslationBatchRequest.Builder
- Enclosing interface:
FileTranslationBatchRequest
public static interface FileTranslationBatchRequest.Builder
Builder for constructing a
FileTranslationBatchRequest.
withFileTranslationInputs(List), withConnectionName(String),
and withEventHandlerApiName(String) are required before calling
build().
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns the completedFileTranslationBatchRequest.withConnectionName(String connectionName) Sets the translation provider to use for this batch, identified by theapi_name__sysof the provider connection record in Vault.withEventHandlerApiName(String eventHandlerApiName) Sets theFileTranslationEventHandlerthat the platform invokes when this batch finishes.withFileTranslationInputs(List<FileTranslationInput> translations) Sets the list of files to translate.withParameters(FileTranslationParameters parameters) Attaches batch-level parameters that are serialized across the async boundary and made available inFileTranslationEventHandlerContextwhen the event handler is invoked.
-
Method Details
-
withFileTranslationInputs
FileTranslationBatchRequest.Builder withFileTranslationInputs(List<FileTranslationInput> translations) Sets the list of files to translate. Each entry is oneFileTranslationInputdescribing a source file and its target language.- Parameters:
translations- a non-null, non-empty list ofFileTranslationInputobjects. Cannot be null.- Returns:
- this Builder
-
withConnectionName
Sets the translation provider to use for this batch, identified by theapi_name__sysof the provider connection record in Vault.- Parameters:
connectionName- the API name of the provider connection record. Cannot be null.- Returns:
- this Builder
-
withEventHandlerApiName
Sets theFileTranslationEventHandlerthat the platform invokes when this batch finishes. The value must match theapiNamedeclared on aFileTranslationEventHandlerInfoannotation.- Parameters:
eventHandlerApiName- the API name of the targetFileTranslationEventHandler. Cannot be null.- Returns:
- this Builder
-
withParameters
Attaches batch-level parameters that are serialized across the async boundary and made available inFileTranslationEventHandlerContextwhen the event handler is invoked. Optional.- Parameters:
parameters- theFileTranslationParametersto carry through the translation run, ornullif no parameters are needed- Returns:
- this Builder
-
build
FileTranslationBatchRequest build()Builds and returns the completedFileTranslationBatchRequest.- Returns:
- the completed
FileTranslationBatchRequest
-