testParsing method
- required EdiType ediType,
- required FileFormat fileFormat,
- required S3Location inputFile,
- AdvancedOptions? advancedOptions,
Parses the input EDI (electronic data interchange) file. The input file has a file size limit of 250 KB.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter ediType :
Specifies the details for the EDI standard that is being used for the
transformer. Currently, only X12 is supported. X12 is a set of standards
and corresponding messages that define specific business documents.
Parameter fileFormat :
Specifies that the currently supported file formats for EDI
transformations are JSON and XML.
Parameter inputFile :
Specifies an S3Location object, which contains the Amazon S3
bucket and prefix for the location of the input file.
Parameter advancedOptions :
Specifies advanced options for parsing the input EDI file. These options
allow for more granular control over the parsing process, including split
options for X12 files.
Implementation
Future<TestParsingResponse> testParsing({
required EdiType ediType,
required FileFormat fileFormat,
required S3Location inputFile,
AdvancedOptions? advancedOptions,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'B2BI.TestParsing'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ediType': ediType,
'fileFormat': fileFormat.value,
'inputFile': inputFile,
if (advancedOptions != null) 'advancedOptions': advancedOptions,
},
);
return TestParsingResponse.fromJson(jsonResponse.body);
}