Skip to content

Commit 8c32c69

Browse files
author
awstools
committed
feat(client-supplychain): This release includes API SendDataIntegrationEvent for AWS Supply Chain
1 parent 8061bcc commit 8c32c69

File tree

8 files changed

+753
-3
lines changed

8 files changed

+753
-3
lines changed

clients/client-supplychain/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,11 @@ GetBillOfMaterialsImportJob
225225
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/GetBillOfMaterialsImportJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/GetBillOfMaterialsImportJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/GetBillOfMaterialsImportJobCommandOutput/)
226226

227227
</details>
228+
<details>
229+
<summary>
230+
SendDataIntegrationEvent
231+
</summary>
232+
233+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/supplychain/command/SendDataIntegrationEventCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/SendDataIntegrationEventCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-supplychain/Interface/SendDataIntegrationEventCommandOutput/)
234+
235+
</details>

clients/client-supplychain/src/SupplyChain.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ import {
1212
GetBillOfMaterialsImportJobCommandInput,
1313
GetBillOfMaterialsImportJobCommandOutput,
1414
} from "./commands/GetBillOfMaterialsImportJobCommand";
15+
import {
16+
SendDataIntegrationEventCommand,
17+
SendDataIntegrationEventCommandInput,
18+
SendDataIntegrationEventCommandOutput,
19+
} from "./commands/SendDataIntegrationEventCommand";
1520
import { SupplyChainClient, SupplyChainClientConfig } from "./SupplyChainClient";
1621

1722
const commands = {
1823
CreateBillOfMaterialsImportJobCommand,
1924
GetBillOfMaterialsImportJobCommand,
25+
SendDataIntegrationEventCommand,
2026
};
2127

2228
export interface SupplyChain {
@@ -53,6 +59,23 @@ export interface SupplyChain {
5359
options: __HttpHandlerOptions,
5460
cb: (err: any, data?: GetBillOfMaterialsImportJobCommandOutput) => void
5561
): void;
62+
63+
/**
64+
* @see {@link SendDataIntegrationEventCommand}
65+
*/
66+
sendDataIntegrationEvent(
67+
args: SendDataIntegrationEventCommandInput,
68+
options?: __HttpHandlerOptions
69+
): Promise<SendDataIntegrationEventCommandOutput>;
70+
sendDataIntegrationEvent(
71+
args: SendDataIntegrationEventCommandInput,
72+
cb: (err: any, data?: SendDataIntegrationEventCommandOutput) => void
73+
): void;
74+
sendDataIntegrationEvent(
75+
args: SendDataIntegrationEventCommandInput,
76+
options: __HttpHandlerOptions,
77+
cb: (err: any, data?: SendDataIntegrationEventCommandOutput) => void
78+
): void;
5679
}
5780

5881
/**

clients/client-supplychain/src/SupplyChainClient.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ import {
6161
GetBillOfMaterialsImportJobCommandInput,
6262
GetBillOfMaterialsImportJobCommandOutput,
6363
} from "./commands/GetBillOfMaterialsImportJobCommand";
64+
import {
65+
SendDataIntegrationEventCommandInput,
66+
SendDataIntegrationEventCommandOutput,
67+
} from "./commands/SendDataIntegrationEventCommand";
6468
import {
6569
ClientInputEndpointParameters,
6670
ClientResolvedEndpointParameters,
@@ -75,12 +79,18 @@ export { __Client };
7579
/**
7680
* @public
7781
*/
78-
export type ServiceInputTypes = CreateBillOfMaterialsImportJobCommandInput | GetBillOfMaterialsImportJobCommandInput;
82+
export type ServiceInputTypes =
83+
| CreateBillOfMaterialsImportJobCommandInput
84+
| GetBillOfMaterialsImportJobCommandInput
85+
| SendDataIntegrationEventCommandInput;
7986

8087
/**
8188
* @public
8289
*/
83-
export type ServiceOutputTypes = CreateBillOfMaterialsImportJobCommandOutput | GetBillOfMaterialsImportJobCommandOutput;
90+
export type ServiceOutputTypes =
91+
| CreateBillOfMaterialsImportJobCommandOutput
92+
| GetBillOfMaterialsImportJobCommandOutput
93+
| SendDataIntegrationEventCommandOutput;
8494

8595
/**
8696
* @public
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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 { commonParams } from "../endpoint/EndpointParameters";
8+
import {
9+
SendDataIntegrationEventRequest,
10+
SendDataIntegrationEventRequestFilterSensitiveLog,
11+
SendDataIntegrationEventResponse,
12+
} from "../models/models_0";
13+
import { de_SendDataIntegrationEventCommand, se_SendDataIntegrationEventCommand } from "../protocols/Aws_restJson1";
14+
import { ServiceInputTypes, ServiceOutputTypes, SupplyChainClientResolvedConfig } from "../SupplyChainClient";
15+
16+
/**
17+
* @public
18+
*/
19+
export { __MetadataBearer, $Command };
20+
/**
21+
* @public
22+
*
23+
* The input for {@link SendDataIntegrationEventCommand}.
24+
*/
25+
export interface SendDataIntegrationEventCommandInput extends SendDataIntegrationEventRequest {}
26+
/**
27+
* @public
28+
*
29+
* The output of {@link SendDataIntegrationEventCommand}.
30+
*/
31+
export interface SendDataIntegrationEventCommandOutput extends SendDataIntegrationEventResponse, __MetadataBearer {}
32+
33+
/**
34+
* <p>Send transactional data events with real-time data for analysis or monitoring.</p>
35+
* @example
36+
* Use a bare-bones client and the command you need to make an API call.
37+
* ```javascript
38+
* import { SupplyChainClient, SendDataIntegrationEventCommand } from "@aws-sdk/client-supplychain"; // ES Modules import
39+
* // const { SupplyChainClient, SendDataIntegrationEventCommand } = require("@aws-sdk/client-supplychain"); // CommonJS import
40+
* const client = new SupplyChainClient(config);
41+
* const input = { // SendDataIntegrationEventRequest
42+
* instanceId: "STRING_VALUE", // required
43+
* eventType: "scn.data.forecast" || "scn.data.inventorylevel" || "scn.data.inboundorder" || "scn.data.inboundorderline" || "scn.data.inboundorderlineschedule" || "scn.data.outboundorderline" || "scn.data.outboundshipment" || "scn.data.processheader" || "scn.data.processoperation" || "scn.data.processproduct" || "scn.data.reservation" || "scn.data.shipment" || "scn.data.shipmentstop" || "scn.data.shipmentstoporder" || "scn.data.supplyplan", // required
44+
* data: "STRING_VALUE", // required
45+
* eventGroupId: "STRING_VALUE", // required
46+
* eventTimestamp: new Date("TIMESTAMP"),
47+
* clientToken: "STRING_VALUE",
48+
* };
49+
* const command = new SendDataIntegrationEventCommand(input);
50+
* const response = await client.send(command);
51+
* // { // SendDataIntegrationEventResponse
52+
* // eventId: "STRING_VALUE", // required
53+
* // };
54+
*
55+
* ```
56+
*
57+
* @param SendDataIntegrationEventCommandInput - {@link SendDataIntegrationEventCommandInput}
58+
* @returns {@link SendDataIntegrationEventCommandOutput}
59+
* @see {@link SendDataIntegrationEventCommandInput} for command's `input` shape.
60+
* @see {@link SendDataIntegrationEventCommandOutput} for command's `response` shape.
61+
* @see {@link SupplyChainClientResolvedConfig | config} for SupplyChainClient's `config` shape.
62+
*
63+
* @throws {@link AccessDeniedException} (client fault)
64+
* <p>You do not have the required privileges to perform this action.</p>
65+
*
66+
* @throws {@link ConflictException} (client fault)
67+
* <p>Updating or deleting a resource can cause an inconsistent state.</p>
68+
*
69+
* @throws {@link InternalServerException} (server fault)
70+
* <p>Unexpected error during processing of request.</p>
71+
*
72+
* @throws {@link ResourceNotFoundException} (client fault)
73+
* <p>Request references a resource which does not exist.</p>
74+
*
75+
* @throws {@link ServiceQuotaExceededException} (client fault)
76+
* <p>Request would cause a service quota to be exceeded.</p>
77+
*
78+
* @throws {@link ThrottlingException} (client fault)
79+
* <p>Request was denied due to request throttling.</p>
80+
*
81+
* @throws {@link ValidationException} (client fault)
82+
* <p>The input does not satisfy the constraints specified by an AWS service.</p>
83+
*
84+
* @throws {@link SupplyChainServiceException}
85+
* <p>Base exception class for all service exceptions from SupplyChain service.</p>
86+
*
87+
* @public
88+
*/
89+
export class SendDataIntegrationEventCommand extends $Command
90+
.classBuilder<
91+
SendDataIntegrationEventCommandInput,
92+
SendDataIntegrationEventCommandOutput,
93+
SupplyChainClientResolvedConfig,
94+
ServiceInputTypes,
95+
ServiceOutputTypes
96+
>()
97+
.ep({
98+
...commonParams,
99+
})
100+
.m(function (this: any, Command: any, cs: any, config: SupplyChainClientResolvedConfig, o: any) {
101+
return [
102+
getSerdePlugin(config, this.serialize, this.deserialize),
103+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
104+
];
105+
})
106+
.s("GalaxyPublicAPIGateway", "SendDataIntegrationEvent", {})
107+
.n("SupplyChainClient", "SendDataIntegrationEventCommand")
108+
.f(SendDataIntegrationEventRequestFilterSensitiveLog, void 0)
109+
.ser(se_SendDataIntegrationEventCommand)
110+
.de(de_SendDataIntegrationEventCommand)
111+
.build() {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
// smithy-typescript generated code
22
export * from "./CreateBillOfMaterialsImportJobCommand";
33
export * from "./GetBillOfMaterialsImportJobCommand";
4+
export * from "./SendDataIntegrationEventCommand";

clients/client-supplychain/src/models/models_0.ts

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// smithy-typescript generated code
2-
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
2+
import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client";
33

44
import { SupplyChainServiceException as __BaseException } from "./SupplyChainServiceException";
55

@@ -265,3 +265,92 @@ export interface GetBillOfMaterialsImportJobResponse {
265265
*/
266266
job: BillOfMaterialsImportJob | undefined;
267267
}
268+
269+
/**
270+
* @public
271+
* @enum
272+
*/
273+
export const DataIntegrationEventType = {
274+
FORECAST: "scn.data.forecast",
275+
INBOUND_ORDER: "scn.data.inboundorder",
276+
INBOUND_ORDER_LINE: "scn.data.inboundorderline",
277+
INBOUND_ORDER_LINE_SCHEDULE: "scn.data.inboundorderlineschedule",
278+
INVENTORY_LEVEL: "scn.data.inventorylevel",
279+
OUTBOUND_ORDER_LINE: "scn.data.outboundorderline",
280+
OUTBOUND_SHIPMENT: "scn.data.outboundshipment",
281+
PROCESS_HEADER: "scn.data.processheader",
282+
PROCESS_OPERATION: "scn.data.processoperation",
283+
PROCESS_PRODUCT: "scn.data.processproduct",
284+
RESERVATION: "scn.data.reservation",
285+
SHIPMENT: "scn.data.shipment",
286+
SHIPMENT_STOP: "scn.data.shipmentstop",
287+
SHIPMENT_STOP_ORDER: "scn.data.shipmentstoporder",
288+
SUPPLY_PLAN: "scn.data.supplyplan",
289+
} as const;
290+
291+
/**
292+
* @public
293+
*/
294+
export type DataIntegrationEventType = (typeof DataIntegrationEventType)[keyof typeof DataIntegrationEventType];
295+
296+
/**
297+
* <p>The request parameters for SendDataIntegrationEvent.</p>
298+
* @public
299+
*/
300+
export interface SendDataIntegrationEventRequest {
301+
/**
302+
* <p>The AWS Supply Chain instance identifier.</p>
303+
* @public
304+
*/
305+
instanceId: string | undefined;
306+
307+
/**
308+
* <p>The data event type.</p>
309+
* @public
310+
*/
311+
eventType: DataIntegrationEventType | undefined;
312+
313+
/**
314+
* <p>The data payload of the event.</p>
315+
* @public
316+
*/
317+
data: string | undefined;
318+
319+
/**
320+
* <p>Event identifier (for example, orderId for InboundOrder) used for data sharing or partitioning.</p>
321+
* @public
322+
*/
323+
eventGroupId: string | undefined;
324+
325+
/**
326+
* <p>The event timestamp (in epoch seconds).</p>
327+
* @public
328+
*/
329+
eventTimestamp?: Date;
330+
331+
/**
332+
* <p>The idempotent client token.</p>
333+
* @public
334+
*/
335+
clientToken?: string;
336+
}
337+
338+
/**
339+
* <p>The response parameters for SendDataIntegrationEvent.</p>
340+
* @public
341+
*/
342+
export interface SendDataIntegrationEventResponse {
343+
/**
344+
* <p>The unique event identifier.</p>
345+
* @public
346+
*/
347+
eventId: string | undefined;
348+
}
349+
350+
/**
351+
* @internal
352+
*/
353+
export const SendDataIntegrationEventRequestFilterSensitiveLog = (obj: SendDataIntegrationEventRequest): any => ({
354+
...obj,
355+
...(obj.data && { data: SENSITIVE_STRING }),
356+
});

clients/client-supplychain/src/protocols/Aws_restJson1.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ import {
2929
GetBillOfMaterialsImportJobCommandInput,
3030
GetBillOfMaterialsImportJobCommandOutput,
3131
} from "../commands/GetBillOfMaterialsImportJobCommand";
32+
import {
33+
SendDataIntegrationEventCommandInput,
34+
SendDataIntegrationEventCommandOutput,
35+
} from "../commands/SendDataIntegrationEventCommand";
3236
import {
3337
AccessDeniedException,
3438
ConflictException,
@@ -81,6 +85,33 @@ export const se_GetBillOfMaterialsImportJobCommand = async (
8185
return b.build();
8286
};
8387

88+
/**
89+
* serializeAws_restJson1SendDataIntegrationEventCommand
90+
*/
91+
export const se_SendDataIntegrationEventCommand = async (
92+
input: SendDataIntegrationEventCommandInput,
93+
context: __SerdeContext
94+
): Promise<__HttpRequest> => {
95+
const b = rb(input, context);
96+
const headers: any = {
97+
"content-type": "application/json",
98+
};
99+
b.bp("/api-data/data-integration/instance/{instanceId}/data-integration-events");
100+
b.p("instanceId", () => input.instanceId!, "{instanceId}", false);
101+
let body: any;
102+
body = JSON.stringify(
103+
take(input, {
104+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
105+
data: [],
106+
eventGroupId: [],
107+
eventTimestamp: (_) => Math.round(_.getTime() / 1000),
108+
eventType: [],
109+
})
110+
);
111+
b.m("POST").h(headers).b(body);
112+
return b.build();
113+
};
114+
84115
/**
85116
* deserializeAws_restJson1CreateBillOfMaterialsImportJobCommand
86117
*/
@@ -123,6 +154,27 @@ export const de_GetBillOfMaterialsImportJobCommand = async (
123154
return contents;
124155
};
125156

157+
/**
158+
* deserializeAws_restJson1SendDataIntegrationEventCommand
159+
*/
160+
export const de_SendDataIntegrationEventCommand = async (
161+
output: __HttpResponse,
162+
context: __SerdeContext
163+
): Promise<SendDataIntegrationEventCommandOutput> => {
164+
if (output.statusCode !== 200 && output.statusCode >= 300) {
165+
return de_CommandError(output, context);
166+
}
167+
const contents: any = map({
168+
$metadata: deserializeMetadata(output),
169+
});
170+
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
171+
const doc = take(data, {
172+
eventId: __expectString,
173+
});
174+
Object.assign(contents, doc);
175+
return contents;
176+
};
177+
126178
/**
127179
* deserialize_Aws_restJson1CommandError
128180
*/

0 commit comments

Comments
 (0)