startTransformerJob method

Future<StartTransformerJobResponse> startTransformerJob({
  1. required S3Location inputFile,
  2. required S3Location outputLocation,
  3. required String transformerId,
  4. String? clientToken,
})

Runs a job, using a transformer, to parse input EDI (electronic data interchange) file into the output structures used by Amazon Web Services B2B Data Interchange.

If you only want to transform EDI (electronic data interchange) documents, you don't need to create profiles, partnerships or capabilities. Just create and configure a transformer, and then run the StartTransformerJob API to process your files.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter inputFile : Specifies the location of the input file for the transformation. The location consists of an Amazon S3 bucket and prefix.

Parameter outputLocation : Specifies the location of the output file for the transformation. The location consists of an Amazon S3 bucket and prefix.

Parameter transformerId : Specifies the system-assigned unique identifier for the transformer.

Parameter clientToken : Reserved for future use.

Implementation

Future<StartTransformerJobResponse> startTransformerJob({
  required S3Location inputFile,
  required S3Location outputLocation,
  required String transformerId,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'B2BI.StartTransformerJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'inputFile': inputFile,
      'outputLocation': outputLocation,
      'transformerId': transformerId,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );

  return StartTransformerJobResponse.fromJson(jsonResponse.body);
}