testConversion method
Future<TestConversionResponse>
testConversion({
- required ConversionSource source,
- required ConversionTarget target,
This operation mimics the latter half of a typical Outbound EDI request. It takes an input JSON/XML in the B2Bi shape as input, converts it to an X12 EDI string, and return that string.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter source :
Specify the source file for an outbound EDI request.
Parameter target :
Specify the format (X12 is the only currently supported format), and other
details for the conversion target.
Implementation
Future<TestConversionResponse> testConversion({
required ConversionSource source,
required ConversionTarget target,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'B2BI.TestConversion'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'source': source,
'target': target,
},
);
return TestConversionResponse.fromJson(jsonResponse.body);
}