Skip to content

Commit 480a1fe

Browse files
authored
chore(protocoltests): upgrade to Smithy 1.26.4 (#4365)
1 parent dac8a92 commit 480a1fe

File tree

40 files changed

+4470
-343
lines changed

40 files changed

+4470
-343
lines changed

codegen/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
smithyVersion=1.26.1
1+
smithyVersion=1.26.4
22
smithyGradleVersion=0.6.0

private/aws-protocoltests-ec2/src/EC2Protocol.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ import {
7979
XmlEmptyListsCommandOutput,
8080
} from "./commands/XmlEmptyListsCommand";
8181
import { XmlEnumsCommand, XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand";
82+
import { XmlIntEnumsCommand, XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand";
8283
import { XmlListsCommand, XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand";
8384
import {
8485
XmlNamespacesCommand,
@@ -652,6 +653,32 @@ export class EC2Protocol extends EC2ProtocolClient {
652653
}
653654
}
654655

656+
/**
657+
* This example serializes intEnums as top level properties, in lists, sets, and maps.
658+
*/
659+
public xmlIntEnums(args: XmlIntEnumsCommandInput, options?: __HttpHandlerOptions): Promise<XmlIntEnumsCommandOutput>;
660+
public xmlIntEnums(args: XmlIntEnumsCommandInput, cb: (err: any, data?: XmlIntEnumsCommandOutput) => void): void;
661+
public xmlIntEnums(
662+
args: XmlIntEnumsCommandInput,
663+
options: __HttpHandlerOptions,
664+
cb: (err: any, data?: XmlIntEnumsCommandOutput) => void
665+
): void;
666+
public xmlIntEnums(
667+
args: XmlIntEnumsCommandInput,
668+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: XmlIntEnumsCommandOutput) => void),
669+
cb?: (err: any, data?: XmlIntEnumsCommandOutput) => void
670+
): Promise<XmlIntEnumsCommandOutput> | void {
671+
const command = new XmlIntEnumsCommand(args);
672+
if (typeof optionsOrCb === "function") {
673+
this.send(command, optionsOrCb);
674+
} else if (typeof cb === "function") {
675+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
676+
this.send(command, optionsOrCb || {}, cb);
677+
} else {
678+
return this.send(command, optionsOrCb);
679+
}
680+
}
681+
655682
/**
656683
* This test case serializes XML lists for the following cases for both
657684
* input and output:

private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ import { XmlBlobsCommandInput, XmlBlobsCommandOutput } from "./commands/XmlBlobs
8484
import { XmlEmptyBlobsCommandInput, XmlEmptyBlobsCommandOutput } from "./commands/XmlEmptyBlobsCommand";
8585
import { XmlEmptyListsCommandInput, XmlEmptyListsCommandOutput } from "./commands/XmlEmptyListsCommand";
8686
import { XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand";
87+
import { XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand";
8788
import { XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand";
8889
import { XmlNamespacesCommandInput, XmlNamespacesCommandOutput } from "./commands/XmlNamespacesCommand";
8990
import { XmlTimestampsCommandInput, XmlTimestampsCommandOutput } from "./commands/XmlTimestampsCommand";
@@ -108,6 +109,7 @@ export type ServiceInputTypes =
108109
| XmlEmptyBlobsCommandInput
109110
| XmlEmptyListsCommandInput
110111
| XmlEnumsCommandInput
112+
| XmlIntEnumsCommandInput
111113
| XmlListsCommandInput
112114
| XmlNamespacesCommandInput
113115
| XmlTimestampsCommandInput;
@@ -131,6 +133,7 @@ export type ServiceOutputTypes =
131133
| XmlEmptyBlobsCommandOutput
132134
| XmlEmptyListsCommandOutput
133135
| XmlEnumsCommandOutput
136+
| XmlIntEnumsCommandOutput
134137
| XmlListsCommandOutput
135138
| XmlNamespacesCommandOutput
136139
| XmlTimestampsCommandOutput;
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient";
16+
import { XmlIntEnumsOutput, XmlIntEnumsOutputFilterSensitiveLog } from "../models/models_0";
17+
import { deserializeAws_ec2XmlIntEnumsCommand, serializeAws_ec2XmlIntEnumsCommand } from "../protocols/Aws_ec2";
18+
19+
export interface XmlIntEnumsCommandInput {}
20+
export interface XmlIntEnumsCommandOutput extends XmlIntEnumsOutput, __MetadataBearer {}
21+
22+
/**
23+
* This example serializes intEnums as top level properties, in lists, sets, and maps.
24+
* @example
25+
* Use a bare-bones client and the command you need to make an API call.
26+
* ```javascript
27+
* import { EC2ProtocolClient, XmlIntEnumsCommand } from "@aws-sdk/aws-protocoltests-ec2"; // ES Modules import
28+
* // const { EC2ProtocolClient, XmlIntEnumsCommand } = require("@aws-sdk/aws-protocoltests-ec2"); // CommonJS import
29+
* const client = new EC2ProtocolClient(config);
30+
* const command = new XmlIntEnumsCommand(input);
31+
* const response = await client.send(command);
32+
* ```
33+
*
34+
* @see {@link XmlIntEnumsCommandInput} for command's `input` shape.
35+
* @see {@link XmlIntEnumsCommandOutput} for command's `response` shape.
36+
* @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape.
37+
*
38+
*/
39+
export class XmlIntEnumsCommand extends $Command<
40+
XmlIntEnumsCommandInput,
41+
XmlIntEnumsCommandOutput,
42+
EC2ProtocolClientResolvedConfig
43+
> {
44+
// Start section: command_properties
45+
// End section: command_properties
46+
47+
constructor(readonly input: XmlIntEnumsCommandInput) {
48+
// Start section: command_constructor
49+
super();
50+
// End section: command_constructor
51+
}
52+
53+
/**
54+
* @internal
55+
*/
56+
resolveMiddleware(
57+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
58+
configuration: EC2ProtocolClientResolvedConfig,
59+
options?: __HttpHandlerOptions
60+
): Handler<XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput> {
61+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
62+
63+
const stack = clientStack.concat(this.middlewareStack);
64+
65+
const { logger } = configuration;
66+
const clientName = "EC2ProtocolClient";
67+
const commandName = "XmlIntEnumsCommand";
68+
const handlerExecutionContext: HandlerExecutionContext = {
69+
logger,
70+
clientName,
71+
commandName,
72+
inputFilterSensitiveLog: (input: any) => input,
73+
outputFilterSensitiveLog: XmlIntEnumsOutputFilterSensitiveLog,
74+
};
75+
const { requestHandler } = configuration;
76+
return stack.resolve(
77+
(request: FinalizeHandlerArguments<any>) =>
78+
requestHandler.handle(request.request as __HttpRequest, options || {}),
79+
handlerExecutionContext
80+
);
81+
}
82+
83+
private serialize(input: XmlIntEnumsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
84+
return serializeAws_ec2XmlIntEnumsCommand(input, context);
85+
}
86+
87+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<XmlIntEnumsCommandOutput> {
88+
return deserializeAws_ec2XmlIntEnumsCommand(output, context);
89+
}
90+
91+
// Start section: command_body_extra
92+
// End section: command_body_extra
93+
}

private/aws-protocoltests-ec2/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export * from "./XmlBlobsCommand";
1717
export * from "./XmlEmptyBlobsCommand";
1818
export * from "./XmlEmptyListsCommand";
1919
export * from "./XmlEnumsCommand";
20+
export * from "./XmlIntEnumsCommand";
2021
export * from "./XmlListsCommand";
2122
export * from "./XmlNamespacesCommand";
2223
export * from "./XmlTimestampsCommand";

private/aws-protocoltests-ec2/src/models/models_0.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ export const XmlBlobsOutputFilterSensitiveLog = (obj: XmlBlobsOutput): any => ({
239239
...obj,
240240
});
241241

242+
export enum IntegerEnum {
243+
A = 1,
244+
B = 2,
245+
C = 3,
246+
}
247+
242248
export interface StructureListMember {
243249
a?: string;
244250
b?: string;
@@ -258,6 +264,7 @@ export interface XmlListsOutput {
258264
booleanList?: boolean[];
259265
timestampList?: Date[];
260266
enumList?: (FooEnum | string)[];
267+
intEnumList?: (IntegerEnum | number)[];
261268
/**
262269
* A list of lists of strings.
263270
*/
@@ -294,6 +301,22 @@ export const XmlEnumsOutputFilterSensitiveLog = (obj: XmlEnumsOutput): any => ({
294301
...obj,
295302
});
296303

304+
export interface XmlIntEnumsOutput {
305+
intEnum1?: IntegerEnum | number;
306+
intEnum2?: IntegerEnum | number;
307+
intEnum3?: IntegerEnum | number;
308+
intEnumList?: (IntegerEnum | number)[];
309+
intEnumSet?: (IntegerEnum | number)[];
310+
intEnumMap?: Record<string, IntegerEnum | number>;
311+
}
312+
313+
/**
314+
* @internal
315+
*/
316+
export const XmlIntEnumsOutputFilterSensitiveLog = (obj: XmlIntEnumsOutput): any => ({
317+
...obj,
318+
});
319+
297320
export interface XmlNamespaceNested {
298321
foo?: string;
299322
values?: string[];
@@ -320,8 +343,11 @@ export const XmlNamespacesOutputFilterSensitiveLog = (obj: XmlNamespacesOutput):
320343
export interface XmlTimestampsOutput {
321344
normal?: Date;
322345
dateTime?: Date;
346+
dateTimeOnTarget?: Date;
323347
epochSeconds?: Date;
348+
epochSecondsOnTarget?: Date;
324349
httpDate?: Date;
350+
httpDateOnTarget?: Date;
325351
}
326352

327353
/**

0 commit comments

Comments
 (0)