createStarterMappingTemplate
Amazon Web Services B2B Data Interchange uses a mapping template in JSONata or XSLT format to transform a customer input file into a JSON or XML file that can be converted to EDI.
If you provide a sample EDI file with the same structure as the EDI files that you wish to generate, then the service can generate a mapping template. The starter template contains placeholder values which you can replace with JSONata or XSLT expressions to take data from your input file and insert it into the JSON or XML file that is used to generate the EDI.
If you do not provide a sample EDI file, then the service can generate a mapping template based on the EDI settings in the templateDetails
parameter.
Currently, we only support generating a template that can generate the input to produce an Outbound X12 EDI file.
Samples
import aws.sdk.kotlin.services.b2bi.model.MappingType
import aws.sdk.kotlin.services.b2bi.model.S3Location
import aws.sdk.kotlin.services.b2bi.model.TemplateDetails
import aws.sdk.kotlin.services.b2bi.model.X12Details
import aws.sdk.kotlin.services.b2bi.model.X12TransactionSet
import aws.sdk.kotlin.services.b2bi.model.X12Version
fun main() {
//sampleStart
// Sample CreateStarterMappingTemplate call
val resp = b2BiClient.createStarterMappingTemplate {
mappingType = MappingType.fromValue("JSONATA")
templateDetails = TemplateDetails.X12(X12Details {
transactionSet = X12TransactionSet.fromValue("X12_110")
version = X12Version.fromValue("VERSION_4010")
}
)
outputSampleLocation = S3Location {
bucketName = "output-sample-bucket"
key = "output-sample-key"
}
}
//sampleEnd
}