create_transformer
async
¶
create_transformer(
name: TransformerName,
*,
config_overrides: Optional[Asyncb2biClientConfig] = None,
client_token: Optional[str] = None,
tags: Optional[TagList] = None,
file_format: Optional[FileFormat] = None,
mapping_template: Optional[MappingTemplate] = None,
edi_type: Optional[EdiType] = None,
sample_document: Optional[FileLocation] = None,
input_conversion: Optional[InputConversion] = None,
mapping: Optional[Mapping] = None,
output_conversion: Optional[OutputConversion] = None,
sample_documents: Optional[SampleDocuments] = None,
) -> CreateTransformerResponse
Creates a transformer. Amazon Web Services B2B Data Interchange currently supports two scenarios:
-
Inbound EDI: the Amazon Web Services customer receives an EDI file from their trading partner. Amazon Web Services B2B Data Interchange converts this EDI file into a JSON or XML file with a service-defined structure. A mapping template provided by the customer, in JSONata or XSLT format, is optionally applied to this file to produce a JSON or XML file with the structure the customer requires.
-
Outbound EDI: the Amazon Web Services customer has a JSON or XML file containing data that they wish to use in an EDI file. A mapping template, provided by the customer (in either JSONata or XSLT format) is applied to this file to generate a JSON or XML file in the service-defined structure. This file is then converted to an EDI file.
The following fields are provided for backwards compatibility only: fileFormat, mappingTemplate, ediType, and sampleDocument.
-
Use the
mappingdata type in place ofmappingTemplateandfileFormat -
Use the
sampleDocumentsdata type in place ofsampleDocument -
Use either the
inputConversionoroutputConversionin place ofediType
Parameters:
-
name(TransformerName) –Specifies the name of the transformer, used to identify it.
-
client_token(Optional[str], default:None) –Reserved for future use.
-
tags(Optional[TagList], default:None) –Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.
-
file_format(Optional[FileFormat], default:None) –Specifies that the currently supported file formats for EDI transformations are
JSONandXML. -
mapping_template(Optional[MappingTemplate], default:None) –Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.
This parameter is available for backwards compatibility. Use the Mapping data type instead.
-
edi_type(Optional[EdiType], default:None) –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.
-
sample_document(Optional[FileLocation], default:None) –Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.
-
input_conversion(Optional[InputConversion], default:None) –Specify the
InputConversionobject, which contains the format options for the inbound transformation. -
mapping(Optional[Mapping], default:None) –Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).
-
output_conversion(Optional[OutputConversion], default:None) –A structure that contains the
OutputConversionobject, which contains the format options for the outbound transformation. -
sample_documents(Optional[SampleDocuments], default:None) –Specify a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
ConflictException–A conflict exception is thrown when you attempt to delete a resource (such as a profile or a capability) that is being used by other resources.
-
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.
-
ServiceQuotaExceededException–Occurs when the calling command attempts to exceed one of the service quotas, for example trying to create a capability when you already have the maximum number of capabilities allowed.
-
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 CreateTransformer call
>>> await client.create_transformer(client_token='foo', name='transformX12', input_conversion={'fromFormat': 'X12', 'formatOptions': {'x12': {'transactionSet': 'X12_110', 'version': 'VERSION_4010'}}, 'advancedOptions': {'x12': {'splitOptions': {'splitBy': 'NONE'}, 'validationOptions': {'validationRules': [{'codeListValidationRule': {'elementId': '1234', 'codesToAdd': ['A', 'B', 'C'], 'codesToRemove': ['X', 'Y', 'Z']}}, {'elementRequirementValidationRule': {'elementPosition': 'NM1-01', 'requirement': 'MANDATORY'}}, {'elementLengthValidationRule': {'elementId': '5678', 'maxLength': 10, 'minLength': 2}}]}}}}, mapping={'templateLanguage': 'JSONATA', 'template': '{}'}, sample_documents={'bucketName': 'test-bucket', 'keys': [{'input': 'sampleDoc.txt'}]}, tags=[{'Key': 'sampleKey', 'Value': 'sampleValue'}])
Source code in docs_src/capo_b2bi/_services/async_b2bi.py
1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 | |