test_conversion
¶
test_conversion(
source: ConversionSource,
target: ConversionTarget,
*,
config_overrides: Optional[b2biClientConfig] = None,
) -> TestConversionResponse
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.
Parameters:
-
source(ConversionSource) –Specify the source file for an outbound EDI request.
-
target(ConversionTarget) –Specify the format (X12 is the only currently supported format), and other details for the conversion target.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–This exception is thrown when an error occurs in the Amazon Web Services B2B Data Interchange service.
-
ResourceNotFoundException–Occurs when the requested resource does not exist, or cannot be found. In some cases, the resource exists in a region other than the region specified in the API call.
-
ThrottlingException–The request was denied due to throttling: the data speed and rendering may be limited depending on various parameters and conditions.
-
ValidationException–Occurs when a B2BI object cannot be validated against a request from another object. This exception can be thrown during standard EDI validation or when custom validation rules fail, such as when element length constraints are violated, invalid codes are used in code list validations, or required elements are missing based on configured element requirement rules.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Sample TestConversion call
>>> client.test_conversion(source={'fileFormat': 'JSON', 'inputFile': {'fileContent': 'Sample file content'}}, target={'fileFormat': 'X12', 'formatDetails': {'x12': {'transactionSet': 'X12_110', 'version': 'VERSION_4010'}}, 'advancedOptions': {'x12': {'validationOptions': {'validationRules': [{'codeListValidationRule': {'elementId': '1280', 'codesToAdd': ['X', 'Y', 'Z'], 'codesToRemove': ['A', 'B', 'C']}}, {'elementRequirementValidationRule': {'elementPosition': 'NM1-01', 'requirement': 'OPTIONAL'}}, {'elementLengthValidationRule': {'elementId': '0803', 'maxLength': 30, 'minLength': 5}}]}}}})