-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-b2bi): This release adds a GenerateMapping API to allow g…
…eneration of JSONata or XSLT transformer code based on input and output samples.
- Loading branch information
awstools
committed
Nov 13, 2024
1 parent
b46415d
commit 79297bb
Showing
8 changed files
with
374 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
clients/client-b2bi/src/commands/GenerateMappingCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
// smithy-typescript generated code | ||
import { getEndpointPlugin } from "@smithy/middleware-endpoint"; | ||
import { getSerdePlugin } from "@smithy/middleware-serde"; | ||
import { Command as $Command } from "@smithy/smithy-client"; | ||
import { MetadataBearer as __MetadataBearer } from "@smithy/types"; | ||
|
||
import { B2biClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../B2biClient"; | ||
import { commonParams } from "../endpoint/EndpointParameters"; | ||
import { GenerateMappingRequest, GenerateMappingResponse } from "../models/models_0"; | ||
import { de_GenerateMappingCommand, se_GenerateMappingCommand } from "../protocols/Aws_json1_0"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export type { __MetadataBearer }; | ||
export { $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link GenerateMappingCommand}. | ||
*/ | ||
export interface GenerateMappingCommandInput extends GenerateMappingRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link GenerateMappingCommand}. | ||
*/ | ||
export interface GenerateMappingCommandOutput extends GenerateMappingResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Takes sample input and output documents and uses Amazon Bedrock to generate a mapping automatically. Depending on the accuracy and other factors, you can then edit the mapping for your needs.</p> | ||
* <note> | ||
* <p>Before you can use the AI-assisted feature for Amazon Web Services B2B Data Interchange you must enable models in Amazon Bedrock. For details, see <a href="https://docs.aws.amazon.com/b2bi/latest/userguide/ai-assisted-mapping.html#ai-assist-prereq">AI-assisted template mapping prerequisites</a> in | ||
* the <i>Amazon Web Services B2B Data Interchange User guide</i>.</p> | ||
* </note> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { B2biClient, GenerateMappingCommand } from "@aws-sdk/client-b2bi"; // ES Modules import | ||
* // const { B2biClient, GenerateMappingCommand } = require("@aws-sdk/client-b2bi"); // CommonJS import | ||
* const client = new B2biClient(config); | ||
* const input = { // GenerateMappingRequest | ||
* inputFileContent: "STRING_VALUE", // required | ||
* outputFileContent: "STRING_VALUE", // required | ||
* mappingType: "JSONATA" || "XSLT", // required | ||
* }; | ||
* const command = new GenerateMappingCommand(input); | ||
* const response = await client.send(command); | ||
* // { // GenerateMappingResponse | ||
* // mappingTemplate: "STRING_VALUE", // required | ||
* // mappingAccuracy: Number("float"), | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param GenerateMappingCommandInput - {@link GenerateMappingCommandInput} | ||
* @returns {@link GenerateMappingCommandOutput} | ||
* @see {@link GenerateMappingCommandInput} for command's `input` shape. | ||
* @see {@link GenerateMappingCommandOutput} for command's `response` shape. | ||
* @see {@link B2biClientResolvedConfig | config} for B2biClient's `config` shape. | ||
* | ||
* @throws {@link AccessDeniedException} (client fault) | ||
* <p>You do not have sufficient access to perform this action.</p> | ||
* | ||
* @throws {@link InternalServerException} (server fault) | ||
* <p>This exception is thrown when an error occurs in the Amazon Web Services B2B Data Interchange service.</p> | ||
* | ||
* @throws {@link ThrottlingException} (client fault) | ||
* <p>The request was denied due to throttling: the data speed and rendering may be limited depending on various parameters and conditions.</p> | ||
* | ||
* @throws {@link ValidationException} (client fault) | ||
* <p>Occurs when a B2BI object cannot be validated against a request from another object.</p> | ||
* | ||
* @throws {@link B2biServiceException} | ||
* <p>Base exception class for all service exceptions from B2bi service.</p> | ||
* | ||
* @public | ||
* @example Sample GenerateMapping call | ||
* ```javascript | ||
* // | ||
* const input = { | ||
* "inputFileContent": "Sample input file content", | ||
* "mappingType": "JSONATA", | ||
* "outputFileContent": "Sample output file content" | ||
* }; | ||
* const command = new GenerateMappingCommand(input); | ||
* const response = await client.send(command); | ||
* /* response == | ||
* { | ||
* "mappingAccuracy": 0.95, | ||
* "mappingTemplate": "Sample mapping content" | ||
* } | ||
* *\/ | ||
* // example id: example-1 | ||
* ``` | ||
* | ||
*/ | ||
export class GenerateMappingCommand extends $Command | ||
.classBuilder< | ||
GenerateMappingCommandInput, | ||
GenerateMappingCommandOutput, | ||
B2biClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
>() | ||
.ep(commonParams) | ||
.m(function (this: any, Command: any, cs: any, config: B2biClientResolvedConfig, o: any) { | ||
return [ | ||
getSerdePlugin(config, this.serialize, this.deserialize), | ||
getEndpointPlugin(config, Command.getEndpointParameterInstructions()), | ||
]; | ||
}) | ||
.s("B2BI", "GenerateMapping", {}) | ||
.n("B2biClient", "GenerateMappingCommand") | ||
.f(void 0, void 0) | ||
.ser(se_GenerateMappingCommand) | ||
.de(de_GenerateMappingCommand) | ||
.build() { | ||
/** @internal type navigation helper, not in runtime. */ | ||
protected declare static __types: { | ||
api: { | ||
input: GenerateMappingRequest; | ||
output: GenerateMappingResponse; | ||
}; | ||
sdk: { | ||
input: GenerateMappingCommandInput; | ||
output: GenerateMappingCommandOutput; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.