createParallelData method
Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3. Parallel data files contain examples that show how you want segments of text to be translated. By adding parallel data, you can influence the style, tone, and word choice in your translation output.
May throw ConcurrentModificationException.
May throw ConflictException.
May throw InternalServerException.
May throw InvalidParameterValueException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw TooManyRequestsException.
May throw TooManyTagsException.
Parameter name :
A custom name for the parallel data resource in Amazon Translate. You must
assign a name that is unique in the account and region.
Parameter parallelDataConfig :
Specifies the format and S3 location of the parallel data input file.
Parameter clientToken :
A unique identifier for the request. This token is automatically generated
when you use Amazon Translate through an AWS SDK.
Parameter description :
A custom description for the parallel data resource in Amazon Translate.
Parameter tags :
Tags to be associated with this resource. A tag is a key-value pair that
adds metadata to a resource. Each tag key for the resource must be unique.
For more information, see
Tagging your resources.
Implementation
Future<CreateParallelDataResponse> createParallelData({
required String name,
required ParallelDataConfig parallelDataConfig,
String? clientToken,
String? description,
EncryptionKey? encryptionKey,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSShineFrontendService_20170701.CreateParallelData'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Name': name,
'ParallelDataConfig': parallelDataConfig,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (encryptionKey != null) 'EncryptionKey': encryptionKey,
if (tags != null) 'Tags': tags,
},
);
return CreateParallelDataResponse.fromJson(jsonResponse.body);
}