updateParallelData method

Future<UpdateParallelDataResponse> updateParallelData({
  1. required String name,
  2. required ParallelDataConfig parallelDataConfig,
  3. String? clientToken,
  4. String? description,
})

Updates a previously created parallel data resource by importing a new input file from Amazon S3.

May throw ConcurrentModificationException. May throw InvalidParameterValueException. May throw InvalidRequestException. May throw LimitExceededException. May throw TooManyRequestsException. May throw ConflictException. May throw ResourceNotFoundException. May throw InternalServerException.

Parameter name : The name of the parallel data resource being updated.

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.

Implementation

Future<UpdateParallelDataResponse> updateParallelData({
  required String name,
  required ParallelDataConfig parallelDataConfig,
  String? clientToken,
  String? description,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(parallelDataConfig, 'parallelDataConfig');
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    64,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSShineFrontendService_20170701.UpdateParallelData'
  };
  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,
    },
  );

  return UpdateParallelDataResponse.fromJson(jsonResponse.body);
}