|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { B2biClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../B2biClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { CreateStarterMappingTemplateRequest, CreateStarterMappingTemplateResponse } from "../models/models_0"; |
| 10 | +import { |
| 11 | + de_CreateStarterMappingTemplateCommand, |
| 12 | + se_CreateStarterMappingTemplateCommand, |
| 13 | +} from "../protocols/Aws_json1_0"; |
| 14 | + |
| 15 | +/** |
| 16 | + * @public |
| 17 | + */ |
| 18 | +export type { __MetadataBearer }; |
| 19 | +export { $Command }; |
| 20 | +/** |
| 21 | + * @public |
| 22 | + * |
| 23 | + * The input for {@link CreateStarterMappingTemplateCommand}. |
| 24 | + */ |
| 25 | +export interface CreateStarterMappingTemplateCommandInput extends CreateStarterMappingTemplateRequest {} |
| 26 | +/** |
| 27 | + * @public |
| 28 | + * |
| 29 | + * The output of {@link CreateStarterMappingTemplateCommand}. |
| 30 | + */ |
| 31 | +export interface CreateStarterMappingTemplateCommandOutput |
| 32 | + extends CreateStarterMappingTemplateResponse, |
| 33 | + __MetadataBearer {} |
| 34 | + |
| 35 | +/** |
| 36 | + * <p>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.</p> |
| 37 | + * <p>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. |
| 38 | + * 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 |
| 39 | + * into the JSON or XML file that is used to generate the EDI.</p> |
| 40 | + * <p>If you do not provide a sample EDI file, then the service can generate a mapping template based on the EDI settings in the <code>templateDetails</code> parameter. |
| 41 | + * </p> |
| 42 | + * <p> Currently, we only support generating a template that can generate the input to produce an Outbound X12 EDI file.</p> |
| 43 | + * @example |
| 44 | + * Use a bare-bones client and the command you need to make an API call. |
| 45 | + * ```javascript |
| 46 | + * import { B2biClient, CreateStarterMappingTemplateCommand } from "@aws-sdk/client-b2bi"; // ES Modules import |
| 47 | + * // const { B2biClient, CreateStarterMappingTemplateCommand } = require("@aws-sdk/client-b2bi"); // CommonJS import |
| 48 | + * const client = new B2biClient(config); |
| 49 | + * const input = { // CreateStarterMappingTemplateRequest |
| 50 | + * outputSampleLocation: { // S3Location |
| 51 | + * bucketName: "STRING_VALUE", |
| 52 | + * key: "STRING_VALUE", |
| 53 | + * }, |
| 54 | + * mappingType: "JSONATA" || "XSLT", // required |
| 55 | + * templateDetails: { // TemplateDetails Union: only one key present |
| 56 | + * x12: { // X12Details |
| 57 | + * transactionSet: "X12_110" || "X12_180" || "X12_204" || "X12_210" || "X12_211" || "X12_214" || "X12_215" || "X12_259" || "X12_260" || "X12_266" || "X12_269" || "X12_270" || "X12_271" || "X12_274" || "X12_275" || "X12_276" || "X12_277" || "X12_278" || "X12_310" || "X12_315" || "X12_322" || "X12_404" || "X12_410" || "X12_417" || "X12_421" || "X12_426" || "X12_810" || "X12_820" || "X12_824" || "X12_830" || "X12_832" || "X12_834" || "X12_835" || "X12_837" || "X12_844" || "X12_846" || "X12_849" || "X12_850" || "X12_852" || "X12_855" || "X12_856" || "X12_860" || "X12_861" || "X12_864" || "X12_865" || "X12_869" || "X12_870" || "X12_940" || "X12_945" || "X12_990" || "X12_997" || "X12_999" || "X12_270_X279" || "X12_271_X279" || "X12_275_X210" || "X12_275_X211" || "X12_276_X212" || "X12_277_X212" || "X12_277_X214" || "X12_277_X364" || "X12_278_X217" || "X12_820_X218" || "X12_820_X306" || "X12_824_X186" || "X12_834_X220" || "X12_834_X307" || "X12_834_X318" || "X12_835_X221" || "X12_837_X222" || "X12_837_X223" || "X12_837_X224" || "X12_837_X291" || "X12_837_X292" || "X12_837_X298" || "X12_999_X231", |
| 58 | + * version: "VERSION_4010" || "VERSION_4030" || "VERSION_5010" || "VERSION_5010_HIPAA", |
| 59 | + * }, |
| 60 | + * }, |
| 61 | + * }; |
| 62 | + * const command = new CreateStarterMappingTemplateCommand(input); |
| 63 | + * const response = await client.send(command); |
| 64 | + * // { // CreateStarterMappingTemplateResponse |
| 65 | + * // mappingTemplate: "STRING_VALUE", // required |
| 66 | + * // }; |
| 67 | + * |
| 68 | + * ``` |
| 69 | + * |
| 70 | + * @param CreateStarterMappingTemplateCommandInput - {@link CreateStarterMappingTemplateCommandInput} |
| 71 | + * @returns {@link CreateStarterMappingTemplateCommandOutput} |
| 72 | + * @see {@link CreateStarterMappingTemplateCommandInput} for command's `input` shape. |
| 73 | + * @see {@link CreateStarterMappingTemplateCommandOutput} for command's `response` shape. |
| 74 | + * @see {@link B2biClientResolvedConfig | config} for B2biClient's `config` shape. |
| 75 | + * |
| 76 | + * @throws {@link AccessDeniedException} (client fault) |
| 77 | + * <p>You do not have sufficient access to perform this action.</p> |
| 78 | + * |
| 79 | + * @throws {@link InternalServerException} (server fault) |
| 80 | + * <p>This exception is thrown when an error occurs in the Amazon Web Services B2B Data Interchange service.</p> |
| 81 | + * |
| 82 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 83 | + * <p>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.</p> |
| 84 | + * |
| 85 | + * @throws {@link ValidationException} (client fault) |
| 86 | + * <p>Occurs when a B2BI object cannot be validated against a request from another object.</p> |
| 87 | + * |
| 88 | + * @throws {@link B2biServiceException} |
| 89 | + * <p>Base exception class for all service exceptions from B2bi service.</p> |
| 90 | + * |
| 91 | + * @public |
| 92 | + */ |
| 93 | +export class CreateStarterMappingTemplateCommand extends $Command |
| 94 | + .classBuilder< |
| 95 | + CreateStarterMappingTemplateCommandInput, |
| 96 | + CreateStarterMappingTemplateCommandOutput, |
| 97 | + B2biClientResolvedConfig, |
| 98 | + ServiceInputTypes, |
| 99 | + ServiceOutputTypes |
| 100 | + >() |
| 101 | + .ep(commonParams) |
| 102 | + .m(function (this: any, Command: any, cs: any, config: B2biClientResolvedConfig, o: any) { |
| 103 | + return [ |
| 104 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 105 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 106 | + ]; |
| 107 | + }) |
| 108 | + .s("B2BI", "CreateStarterMappingTemplate", {}) |
| 109 | + .n("B2biClient", "CreateStarterMappingTemplateCommand") |
| 110 | + .f(void 0, void 0) |
| 111 | + .ser(se_CreateStarterMappingTemplateCommand) |
| 112 | + .de(de_CreateStarterMappingTemplateCommand) |
| 113 | + .build() { |
| 114 | + /** @internal type navigation helper, not in runtime. */ |
| 115 | + protected declare static __types: { |
| 116 | + api: { |
| 117 | + input: CreateStarterMappingTemplateRequest; |
| 118 | + output: CreateStarterMappingTemplateResponse; |
| 119 | + }; |
| 120 | + sdk: { |
| 121 | + input: CreateStarterMappingTemplateCommandInput; |
| 122 | + output: CreateStarterMappingTemplateCommandOutput; |
| 123 | + }; |
| 124 | + }; |
| 125 | +} |
0 commit comments