Skip to content

Commit 8fa42e7

Browse files
authored
chore(codegen): update smithy to 1.53.0 (#6906)
1 parent 09a5225 commit 8fa42e7

40 files changed

+2331
-92
lines changed

codegen/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
smithyVersion=1.52.0
1+
smithyVersion=1.53.0
22
smithyGradleVersion=0.6.0

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java

+5
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,11 @@ private static boolean filterMalformedRequestTests(
400400
return true;
401401
}
402402

403+
// ToDo: https://github.com/aws/aws-sdk-js-v3/issues/6907
404+
if (testCase.getId().equals("RestJsonWithoutBodyEmptyInputExpectsEmptyContentType")) {
405+
return true;
406+
}
407+
403408
return false;
404409
}
405410
}

private/aws-protocoltests-json-10/src/JSONRPC10.ts

+24
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ import {
5858
OperationWithRequiredMembersCommandInput,
5959
OperationWithRequiredMembersCommandOutput,
6060
} from "./commands/OperationWithRequiredMembersCommand";
61+
import {
62+
OperationWithRequiredMembersWithDefaultsCommand,
63+
OperationWithRequiredMembersWithDefaultsCommandInput,
64+
OperationWithRequiredMembersWithDefaultsCommandOutput,
65+
} from "./commands/OperationWithRequiredMembersWithDefaultsCommand";
6166
import {
6267
PutWithContentEncodingCommand,
6368
PutWithContentEncodingCommandInput,
@@ -83,6 +88,7 @@ const commands = {
8388
OperationWithDefaultsCommand,
8489
OperationWithNestedStructureCommand,
8590
OperationWithRequiredMembersCommand,
91+
OperationWithRequiredMembersWithDefaultsCommand,
8692
PutWithContentEncodingCommand,
8793
SimpleScalarPropertiesCommand,
8894
};
@@ -296,6 +302,24 @@ export interface JSONRPC10 {
296302
cb: (err: any, data?: OperationWithRequiredMembersCommandOutput) => void
297303
): void;
298304

305+
/**
306+
* @see {@link OperationWithRequiredMembersWithDefaultsCommand}
307+
*/
308+
operationWithRequiredMembersWithDefaults(): Promise<OperationWithRequiredMembersWithDefaultsCommandOutput>;
309+
operationWithRequiredMembersWithDefaults(
310+
args: OperationWithRequiredMembersWithDefaultsCommandInput,
311+
options?: __HttpHandlerOptions
312+
): Promise<OperationWithRequiredMembersWithDefaultsCommandOutput>;
313+
operationWithRequiredMembersWithDefaults(
314+
args: OperationWithRequiredMembersWithDefaultsCommandInput,
315+
cb: (err: any, data?: OperationWithRequiredMembersWithDefaultsCommandOutput) => void
316+
): void;
317+
operationWithRequiredMembersWithDefaults(
318+
args: OperationWithRequiredMembersWithDefaultsCommandInput,
319+
options: __HttpHandlerOptions,
320+
cb: (err: any, data?: OperationWithRequiredMembersWithDefaultsCommandOutput) => void
321+
): void;
322+
299323
/**
300324
* @see {@link PutWithContentEncodingCommand}
301325
*/

private/aws-protocoltests-json-10/src/JSONRPC10Client.ts

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ import {
9393
OperationWithRequiredMembersCommandInput,
9494
OperationWithRequiredMembersCommandOutput,
9595
} from "./commands/OperationWithRequiredMembersCommand";
96+
import {
97+
OperationWithRequiredMembersWithDefaultsCommandInput,
98+
OperationWithRequiredMembersWithDefaultsCommandOutput,
99+
} from "./commands/OperationWithRequiredMembersWithDefaultsCommand";
96100
import {
97101
PutWithContentEncodingCommandInput,
98102
PutWithContentEncodingCommandOutput,
@@ -122,6 +126,7 @@ export type ServiceInputTypes =
122126
| OperationWithDefaultsCommandInput
123127
| OperationWithNestedStructureCommandInput
124128
| OperationWithRequiredMembersCommandInput
129+
| OperationWithRequiredMembersWithDefaultsCommandInput
125130
| PutWithContentEncodingCommandInput
126131
| SimpleScalarPropertiesCommandInput;
127132

@@ -141,6 +146,7 @@ export type ServiceOutputTypes =
141146
| OperationWithDefaultsCommandOutput
142147
| OperationWithNestedStructureCommandOutput
143148
| OperationWithRequiredMembersCommandOutput
149+
| OperationWithRequiredMembersWithDefaultsCommandOutput
144150
| PutWithContentEncodingCommandOutput
145151
| SimpleScalarPropertiesCommandOutput;
146152

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@smithy/middleware-serde";
3+
import { Command as $Command } from "@smithy/smithy-client";
4+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
5+
6+
import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client";
7+
import { OperationWithRequiredMembersWithDefaultsOutput } from "../models/models_0";
8+
import {
9+
de_OperationWithRequiredMembersWithDefaultsCommand,
10+
se_OperationWithRequiredMembersWithDefaultsCommand,
11+
} from "../protocols/Aws_json1_0";
12+
13+
/**
14+
* @public
15+
*/
16+
export type { __MetadataBearer };
17+
export { $Command };
18+
/**
19+
* @public
20+
*
21+
* The input for {@link OperationWithRequiredMembersWithDefaultsCommand}.
22+
*/
23+
export interface OperationWithRequiredMembersWithDefaultsCommandInput {}
24+
/**
25+
* @public
26+
*
27+
* The output of {@link OperationWithRequiredMembersWithDefaultsCommand}.
28+
*/
29+
export interface OperationWithRequiredMembersWithDefaultsCommandOutput
30+
extends OperationWithRequiredMembersWithDefaultsOutput,
31+
__MetadataBearer {}
32+
33+
/**
34+
* @public
35+
*
36+
* @example
37+
* Use a bare-bones client and the command you need to make an API call.
38+
* ```javascript
39+
* import { JSONRPC10Client, OperationWithRequiredMembersWithDefaultsCommand } from "@aws-sdk/aws-protocoltests-json-10"; // ES Modules import
40+
* // const { JSONRPC10Client, OperationWithRequiredMembersWithDefaultsCommand } = require("@aws-sdk/aws-protocoltests-json-10"); // CommonJS import
41+
* const client = new JSONRPC10Client(config);
42+
* const input = {};
43+
* const command = new OperationWithRequiredMembersWithDefaultsCommand(input);
44+
* const response = await client.send(command);
45+
* // { // OperationWithRequiredMembersWithDefaultsOutput
46+
* // requiredString: "STRING_VALUE", // required
47+
* // requiredBoolean: true || false, // required
48+
* // requiredList: [ // RequiredStringList // required
49+
* // "STRING_VALUE",
50+
* // ],
51+
* // requiredTimestamp: new Date("TIMESTAMP"), // required
52+
* // requiredBlob: new Uint8Array(), // required
53+
* // requiredByte: 0, // BYTE_VALUE // required
54+
* // requiredShort: Number("short"), // required
55+
* // requiredInteger: Number("int"), // required
56+
* // requiredLong: Number("long"), // required
57+
* // requiredFloat: Number("float"), // required
58+
* // requiredDouble: Number("double"), // required
59+
* // requiredMap: { // RequiredStringMap // required
60+
* // "<keys>": "STRING_VALUE",
61+
* // },
62+
* // requiredEnum: "FOO" || "BAR" || "BAZ", // required
63+
* // requiredIntEnum: 1 || 2, // required
64+
* // };
65+
*
66+
* ```
67+
*
68+
* @param OperationWithRequiredMembersWithDefaultsCommandInput - {@link OperationWithRequiredMembersWithDefaultsCommandInput}
69+
* @returns {@link OperationWithRequiredMembersWithDefaultsCommandOutput}
70+
* @see {@link OperationWithRequiredMembersWithDefaultsCommandInput} for command's `input` shape.
71+
* @see {@link OperationWithRequiredMembersWithDefaultsCommandOutput} for command's `response` shape.
72+
* @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape.
73+
*
74+
* @throws {@link JSONRPC10ServiceException}
75+
* <p>Base exception class for all service exceptions from JSONRPC10 service.</p>
76+
*
77+
*/
78+
export class OperationWithRequiredMembersWithDefaultsCommand extends $Command
79+
.classBuilder<
80+
OperationWithRequiredMembersWithDefaultsCommandInput,
81+
OperationWithRequiredMembersWithDefaultsCommandOutput,
82+
JSONRPC10ClientResolvedConfig,
83+
ServiceInputTypes,
84+
ServiceOutputTypes
85+
>()
86+
.m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) {
87+
return [getSerdePlugin(config, this.serialize, this.deserialize)];
88+
})
89+
.s("JsonRpc10", "OperationWithRequiredMembersWithDefaults", {})
90+
.n("JSONRPC10Client", "OperationWithRequiredMembersWithDefaultsCommand")
91+
.f(void 0, void 0)
92+
.ser(se_OperationWithRequiredMembersWithDefaultsCommand)
93+
.de(de_OperationWithRequiredMembersWithDefaultsCommand)
94+
.build() {
95+
/** @internal type navigation helper, not in runtime. */
96+
protected declare static __types: {
97+
api: {
98+
input: {};
99+
output: OperationWithRequiredMembersWithDefaultsOutput;
100+
};
101+
sdk: {
102+
input: OperationWithRequiredMembersWithDefaultsCommandInput;
103+
output: OperationWithRequiredMembersWithDefaultsCommandOutput;
104+
};
105+
};
106+
}

private/aws-protocoltests-json-10/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ export * from "./NoInputAndOutputCommand";
1111
export * from "./OperationWithDefaultsCommand";
1212
export * from "./OperationWithNestedStructureCommand";
1313
export * from "./OperationWithRequiredMembersCommand";
14+
export * from "./OperationWithRequiredMembersWithDefaultsCommand";
1415
export * from "./PutWithContentEncodingCommand";
1516
export * from "./SimpleScalarPropertiesCommand";

private/aws-protocoltests-json-10/src/models/models_0.ts

+39
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,45 @@ export interface OperationWithRequiredMembersOutput {
547547
requiredMap: Record<string, string> | undefined;
548548
}
549549

550+
/**
551+
* @public
552+
* @enum
553+
*/
554+
export const RequiredEnum = {
555+
BAR: "BAR",
556+
BAZ: "BAZ",
557+
FOO: "FOO",
558+
} as const;
559+
/**
560+
* @public
561+
*/
562+
export type RequiredEnum = (typeof RequiredEnum)[keyof typeof RequiredEnum];
563+
564+
export enum RequiredIntEnum {
565+
ONE = 1,
566+
TWO = 2,
567+
}
568+
569+
/**
570+
* @public
571+
*/
572+
export interface OperationWithRequiredMembersWithDefaultsOutput {
573+
requiredString: string | undefined;
574+
requiredBoolean: boolean | undefined;
575+
requiredList: string[] | undefined;
576+
requiredTimestamp: Date | undefined;
577+
requiredBlob: Uint8Array | undefined;
578+
requiredByte: number | undefined;
579+
requiredShort: number | undefined;
580+
requiredInteger: number | undefined;
581+
requiredLong: number | undefined;
582+
requiredFloat: number | undefined;
583+
requiredDouble: number | undefined;
584+
requiredMap: Record<string, string> | undefined;
585+
requiredEnum: RequiredEnum | undefined;
586+
requiredIntEnum: RequiredIntEnum | undefined;
587+
}
588+
550589
/**
551590
* @public
552591
*/

private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts

+62
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ import {
7171
OperationWithRequiredMembersCommandInput,
7272
OperationWithRequiredMembersCommandOutput,
7373
} from "../commands/OperationWithRequiredMembersCommand";
74+
import {
75+
OperationWithRequiredMembersWithDefaultsCommandInput,
76+
OperationWithRequiredMembersWithDefaultsCommandOutput,
77+
} from "../commands/OperationWithRequiredMembersWithDefaultsCommand";
7478
import {
7579
PutWithContentEncodingCommandInput,
7680
PutWithContentEncodingCommandOutput,
@@ -101,6 +105,7 @@ import {
101105
OperationWithDefaultsOutput,
102106
OperationWithNestedStructureInput,
103107
OperationWithRequiredMembersOutput,
108+
OperationWithRequiredMembersWithDefaultsOutput,
104109
PutWithContentEncodingInput,
105110
SimpleScalarPropertiesInput,
106111
SimpleScalarPropertiesOutput,
@@ -276,6 +281,18 @@ export const se_OperationWithRequiredMembersCommand = async (
276281
return buildHttpRpcRequest(context, headers, "/", undefined, body);
277282
};
278283

284+
/**
285+
* serializeAws_json1_0OperationWithRequiredMembersWithDefaultsCommand
286+
*/
287+
export const se_OperationWithRequiredMembersWithDefaultsCommand = async (
288+
input: OperationWithRequiredMembersWithDefaultsCommandInput,
289+
context: __SerdeContext
290+
): Promise<__HttpRequest> => {
291+
const headers: __HeaderBag = sharedHeaders("OperationWithRequiredMembersWithDefaults");
292+
const body = "{}";
293+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
294+
};
295+
279296
/**
280297
* serializeAws_json1_0PutWithContentEncodingCommand
281298
*/
@@ -530,6 +547,26 @@ export const de_OperationWithRequiredMembersCommand = async (
530547
return response;
531548
};
532549

550+
/**
551+
* deserializeAws_json1_0OperationWithRequiredMembersWithDefaultsCommand
552+
*/
553+
export const de_OperationWithRequiredMembersWithDefaultsCommand = async (
554+
output: __HttpResponse,
555+
context: __SerdeContext
556+
): Promise<OperationWithRequiredMembersWithDefaultsCommandOutput> => {
557+
if (output.statusCode >= 300) {
558+
return de_CommandError(output, context);
559+
}
560+
const data: any = await parseBody(output.body, context);
561+
let contents: any = {};
562+
contents = de_OperationWithRequiredMembersWithDefaultsOutput(data, context);
563+
const response: OperationWithRequiredMembersWithDefaultsCommandOutput = {
564+
$metadata: deserializeMetadata(output),
565+
...contents,
566+
};
567+
return response;
568+
};
569+
533570
/**
534571
* deserializeAws_json1_0PutWithContentEncodingCommand
535572
*/
@@ -918,6 +955,31 @@ const de_OperationWithRequiredMembersOutput = (
918955
}) as any;
919956
};
920957

958+
/**
959+
* deserializeAws_json1_0OperationWithRequiredMembersWithDefaultsOutput
960+
*/
961+
const de_OperationWithRequiredMembersWithDefaultsOutput = (
962+
output: any,
963+
context: __SerdeContext
964+
): OperationWithRequiredMembersWithDefaultsOutput => {
965+
return take(output, {
966+
requiredBlob: context.base64Decoder,
967+
requiredBoolean: __expectBoolean,
968+
requiredByte: __expectByte,
969+
requiredDouble: __limitedParseDouble,
970+
requiredEnum: __expectString,
971+
requiredFloat: __limitedParseFloat32,
972+
requiredIntEnum: __expectInt32,
973+
requiredInteger: __expectInt32,
974+
requiredList: _json,
975+
requiredLong: __expectLong,
976+
requiredMap: _json,
977+
requiredShort: __expectShort,
978+
requiredString: __expectString,
979+
requiredTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
980+
}) as any;
981+
};
982+
921983
// de_RequiredStringList omitted.
922984

923985
// de_RequiredStringMap omitted.

0 commit comments

Comments
 (0)