": {
+ * // language: "STRING_VALUE",
+ * // greeting: "STRING_VALUE",
+ * // farewell: {
+ * // phrase: "STRING_VALUE",
+ * // },
+ * // },
+ * // },
+ * // };
+ *
+ * ```
+ *
+ * @param OperationWithNestedStructureCommandInput - {@link OperationWithNestedStructureCommandInput}
+ * @returns {@link OperationWithNestedStructureCommandOutput}
+ * @see {@link OperationWithNestedStructureCommandInput} for command's `input` shape.
+ * @see {@link OperationWithNestedStructureCommandOutput} for command's `response` shape.
+ * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape.
+ *
+ * @throws {@link RestJsonProtocolServiceException}
+ * Base exception class for all service exceptions from RestJsonProtocol service.
+ *
+ */
+export class OperationWithNestedStructureCommand extends $Command
+ .classBuilder<
+ OperationWithNestedStructureCommandInput,
+ OperationWithNestedStructureCommandOutput,
+ RestJsonProtocolClientResolvedConfig,
+ ServiceInputTypes,
+ ServiceOutputTypes
+ >()
+ .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) {
+ return [getSerdePlugin(config, this.serialize, this.deserialize)];
+ })
+ .s("RestJson", "OperationWithNestedStructure", {})
+ .n("RestJsonProtocolClient", "OperationWithNestedStructureCommand")
+ .f(void 0, void 0)
+ .ser(se_OperationWithNestedStructureCommand)
+ .de(de_OperationWithNestedStructureCommand)
+ .build() {}
diff --git a/private/aws-protocoltests-restjson/src/commands/TestNoInputNoPayloadCommand.ts b/private/aws-protocoltests-restjson/src/commands/TestNoInputNoPayloadCommand.ts
new file mode 100644
index 000000000000..e97d085aab78
--- /dev/null
+++ b/private/aws-protocoltests-restjson/src/commands/TestNoInputNoPayloadCommand.ts
@@ -0,0 +1,77 @@
+// smithy-typescript generated code
+import { getSerdePlugin } from "@smithy/middleware-serde";
+import { Command as $Command } from "@smithy/smithy-client";
+import { MetadataBearer as __MetadataBearer } from "@smithy/types";
+
+import { TestNoPayloadInputOutput } from "../models/models_0";
+import { de_TestNoInputNoPayloadCommand, se_TestNoInputNoPayloadCommand } from "../protocols/Aws_restJson1";
+import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient";
+
+/**
+ * @public
+ */
+export type { __MetadataBearer };
+export { $Command };
+/**
+ * @public
+ *
+ * The input for {@link TestNoInputNoPayloadCommand}.
+ */
+export interface TestNoInputNoPayloadCommandInput {}
+/**
+ * @public
+ *
+ * The output of {@link TestNoInputNoPayloadCommand}.
+ */
+export interface TestNoInputNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {}
+
+/**
+ * This example operation has no input and serializes a request without an HTTP body.
+ *
+ * These tests are to ensure we do not attach a body or related headers
+ * (Content-Length, Content-Type) to operations that semantically
+ * cannot produce an HTTP body.
+ *
+ * @example
+ * Use a bare-bones client and the command you need to make an API call.
+ * ```javascript
+ * import { RestJsonProtocolClient, TestNoInputNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import
+ * // const { RestJsonProtocolClient, TestNoInputNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import
+ * const client = new RestJsonProtocolClient(config);
+ * const input = {};
+ * const command = new TestNoInputNoPayloadCommand(input);
+ * const response = await client.send(command);
+ * // { // TestNoPayloadInputOutput
+ * // testId: "STRING_VALUE",
+ * // };
+ *
+ * ```
+ *
+ * @param TestNoInputNoPayloadCommandInput - {@link TestNoInputNoPayloadCommandInput}
+ * @returns {@link TestNoInputNoPayloadCommandOutput}
+ * @see {@link TestNoInputNoPayloadCommandInput} for command's `input` shape.
+ * @see {@link TestNoInputNoPayloadCommandOutput} for command's `response` shape.
+ * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape.
+ *
+ * @throws {@link RestJsonProtocolServiceException}
+ * Base exception class for all service exceptions from RestJsonProtocol service.
+ *
+ * @public
+ */
+export class TestNoInputNoPayloadCommand extends $Command
+ .classBuilder<
+ TestNoInputNoPayloadCommandInput,
+ TestNoInputNoPayloadCommandOutput,
+ RestJsonProtocolClientResolvedConfig,
+ ServiceInputTypes,
+ ServiceOutputTypes
+ >()
+ .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) {
+ return [getSerdePlugin(config, this.serialize, this.deserialize)];
+ })
+ .s("RestJson", "TestNoInputNoPayload", {})
+ .n("RestJsonProtocolClient", "TestNoInputNoPayloadCommand")
+ .f(void 0, void 0)
+ .ser(se_TestNoInputNoPayloadCommand)
+ .de(de_TestNoInputNoPayloadCommand)
+ .build() {}
diff --git a/private/aws-protocoltests-restjson/src/commands/index.ts b/private/aws-protocoltests-restjson/src/commands/index.ts
index 2f5033393326..e75203cd3311 100644
--- a/private/aws-protocoltests-restjson/src/commands/index.ts
+++ b/private/aws-protocoltests-restjson/src/commands/index.ts
@@ -2,6 +2,7 @@
export * from "./AllQueryStringTypesCommand";
export * from "./ConstantAndVariableQueryStringCommand";
export * from "./ConstantQueryStringCommand";
+export * from "./ContentTypeParametersCommand";
export * from "./DatetimeOffsetsCommand";
export * from "./DocumentTypeAsMapValueCommand";
export * from "./DocumentTypeAsPayloadCommand";
@@ -75,6 +76,8 @@ export * from "./NullAndEmptyHeadersClientCommand";
export * from "./NullAndEmptyHeadersServerCommand";
export * from "./OmitsNullSerializesEmptyStringCommand";
export * from "./OmitsSerializingEmptyListsCommand";
+export * from "./OperationWithDefaultsCommand";
+export * from "./OperationWithNestedStructureCommand";
export * from "./PostPlayerActionCommand";
export * from "./PostUnionWithJsonNameCommand";
export * from "./PutWithContentEncodingCommand";
@@ -89,6 +92,7 @@ export * from "./StreamingTraitsCommand";
export * from "./StreamingTraitsRequireLengthCommand";
export * from "./StreamingTraitsWithMediaTypeCommand";
export * from "./TestBodyStructureCommand";
+export * from "./TestNoInputNoPayloadCommand";
export * from "./TestNoPayloadCommand";
export * from "./TestPayloadBlobCommand";
export * from "./TestPayloadStructureCommand";
diff --git a/private/aws-protocoltests-restjson/src/models/models_0.ts b/private/aws-protocoltests-restjson/src/models/models_0.ts
index 4e10af5f727d..83894c0aa7e4 100644
--- a/private/aws-protocoltests-restjson/src/models/models_0.ts
+++ b/private/aws-protocoltests-restjson/src/models/models_0.ts
@@ -63,6 +63,13 @@ export interface AllQueryStringTypesInput {
queryParamsMapOfStringList?: Record;
}
+/**
+ * @public
+ */
+export interface ClientOptionalDefaults {
+ member?: number;
+}
+
/**
* @public
*/
@@ -111,6 +118,18 @@ export interface ConstantQueryStringInput {
hello: string | undefined;
}
+/**
+ * @public
+ */
+export interface ContentTypeParametersInput {
+ value?: number;
+}
+
+/**
+ * @public
+ */
+export interface ContentTypeParametersOutput {}
+
/**
* @public
*/
@@ -118,6 +137,75 @@ export interface DatetimeOffsetsOutput {
datetime?: Date;
}
+/**
+ * @public
+ * @enum
+ */
+export const TestEnum = {
+ BAR: "BAR",
+ BAZ: "BAZ",
+ FOO: "FOO",
+} as const;
+/**
+ * @public
+ */
+export type TestEnum = (typeof TestEnum)[keyof typeof TestEnum];
+
+export enum TestIntEnum {
+ ONE = 1,
+ TWO = 2,
+}
+
+/**
+ * @public
+ */
+export interface Defaults {
+ defaultString?: string;
+ defaultBoolean?: boolean;
+ defaultList?: string[];
+ defaultDocumentMap?: __DocumentType;
+ defaultDocumentString?: __DocumentType;
+ defaultDocumentBoolean?: __DocumentType;
+ defaultDocumentList?: __DocumentType;
+ defaultNullDocument?: __DocumentType;
+ defaultTimestamp?: Date;
+ defaultBlob?: Uint8Array;
+ defaultByte?: number;
+ defaultShort?: number;
+ defaultInteger?: number;
+ defaultLong?: number;
+ defaultFloat?: number;
+ defaultDouble?: number;
+ defaultMap?: Record;
+ defaultEnum?: TestEnum;
+ defaultIntEnum?: TestIntEnum;
+ emptyString?: string;
+ falseBoolean?: boolean;
+ emptyBlob?: Uint8Array;
+ zeroByte?: number;
+ zeroShort?: number;
+ zeroInteger?: number;
+ zeroLong?: number;
+ zeroFloat?: number;
+ zeroDouble?: number;
+}
+
+/**
+ * @public
+ */
+export interface Farewell {
+ phrase?: string;
+}
+
+/**
+ * @public
+ */
+export interface Dialog {
+ language?: string;
+ greeting?: string;
+ farewell?: Farewell;
+}
+
/**
* @public
*/
@@ -1069,6 +1157,75 @@ export interface OmitsSerializingEmptyListsInput {
queryIntegerEnumList?: IntegerEnum[];
}
+/**
+ * @public
+ */
+export interface OperationWithDefaultsInput {
+ defaults?: Defaults;
+ clientOptionalDefaults?: ClientOptionalDefaults;
+ topLevelDefault?: string;
+ otherTopLevelDefault?: number;
+}
+
+/**
+ * @public
+ */
+export interface OperationWithDefaultsOutput {
+ defaultString?: string;
+ defaultBoolean?: boolean;
+ defaultList?: string[];
+ defaultDocumentMap?: __DocumentType;
+ defaultDocumentString?: __DocumentType;
+ defaultDocumentBoolean?: __DocumentType;
+ defaultDocumentList?: __DocumentType;
+ defaultNullDocument?: __DocumentType;
+ defaultTimestamp?: Date;
+ defaultBlob?: Uint8Array;
+ defaultByte?: number;
+ defaultShort?: number;
+ defaultInteger?: number;
+ defaultLong?: number;
+ defaultFloat?: number;
+ defaultDouble?: number;
+ defaultMap?: Record;
+ defaultEnum?: TestEnum;
+ defaultIntEnum?: TestIntEnum;
+ emptyString?: string;
+ falseBoolean?: boolean;
+ emptyBlob?: Uint8Array;
+ zeroByte?: number;
+ zeroShort?: number;
+ zeroInteger?: number;
+ zeroLong?: number;
+ zeroFloat?: number;
+ zeroDouble?: number;
+}
+
+/**
+ * @public
+ */
+export interface TopLevel {
+ dialog: Dialog | undefined;
+ dialogList?: Dialog[];
+ dialogMap?: Record;
+}
+
+/**
+ * @public
+ */
+export interface OperationWithNestedStructureInput {
+ topLevel: TopLevel | undefined;
+}
+
+/**
+ * @public
+ */
+export interface OperationWithNestedStructureOutput {
+ dialog: Dialog | undefined;
+ dialogList?: Dialog[];
+ dialogMap?: Record;
+}
+
/**
* @public
*/
diff --git a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts
index 6856fa584b9e..92dad884b5cf 100644
--- a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts
+++ b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts
@@ -69,6 +69,10 @@ import {
ConstantQueryStringCommandInput,
ConstantQueryStringCommandOutput,
} from "../commands/ConstantQueryStringCommand";
+import {
+ ContentTypeParametersCommandInput,
+ ContentTypeParametersCommandOutput,
+} from "../commands/ContentTypeParametersCommand";
import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "../commands/DatetimeOffsetsCommand";
import {
DocumentTypeAsMapValueCommandInput,
@@ -265,6 +269,14 @@ import {
OmitsSerializingEmptyListsCommandInput,
OmitsSerializingEmptyListsCommandOutput,
} from "../commands/OmitsSerializingEmptyListsCommand";
+import {
+ OperationWithDefaultsCommandInput,
+ OperationWithDefaultsCommandOutput,
+} from "../commands/OperationWithDefaultsCommand";
+import {
+ OperationWithNestedStructureCommandInput,
+ OperationWithNestedStructureCommandOutput,
+} from "../commands/OperationWithNestedStructureCommand";
import { PostPlayerActionCommandInput, PostPlayerActionCommandOutput } from "../commands/PostPlayerActionCommand";
import {
PostUnionWithJsonNameCommandInput,
@@ -300,6 +312,10 @@ import {
StreamingTraitsWithMediaTypeCommandOutput,
} from "../commands/StreamingTraitsWithMediaTypeCommand";
import { TestBodyStructureCommandInput, TestBodyStructureCommandOutput } from "../commands/TestBodyStructureCommand";
+import {
+ TestNoInputNoPayloadCommandInput,
+ TestNoInputNoPayloadCommandOutput,
+} from "../commands/TestNoInputNoPayloadCommand";
import { TestNoPayloadCommandInput, TestNoPayloadCommandOutput } from "../commands/TestNoPayloadCommand";
import { TestPayloadBlobCommandInput, TestPayloadBlobCommandOutput } from "../commands/TestPayloadBlobCommand";
import {
@@ -312,8 +328,12 @@ import {
} from "../commands/TimestampFormatHeadersCommand";
import { UnitInputAndOutputCommandInput, UnitInputAndOutputCommandOutput } from "../commands/UnitInputAndOutputCommand";
import {
+ ClientOptionalDefaults,
ComplexError,
ComplexNestedErrorData,
+ Defaults,
+ Dialog,
+ Farewell,
FooEnum,
FooError,
GreetingStruct,
@@ -329,6 +349,7 @@ import {
SimpleUnion,
StructureListMember,
TestConfig,
+ TopLevel,
UnionPayload,
UnionWithJsonName,
Unit,
@@ -437,6 +458,28 @@ export const se_ConstantQueryStringCommand = async (
return b.build();
};
+/**
+ * serializeAws_restJson1ContentTypeParametersCommand
+ */
+export const se_ContentTypeParametersCommand = async (
+ input: ContentTypeParametersCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const b = rb(input, context);
+ const headers: any = {
+ "content-type": "application/json",
+ };
+ b.bp("/ContentTypeParameters");
+ let body: any;
+ body = JSON.stringify(
+ take(input, {
+ value: [],
+ })
+ );
+ b.m("POST").h(headers).b(body);
+ return b.build();
+};
+
/**
* serializeAws_restJson1DatetimeOffsetsCommand
*/
@@ -2043,6 +2086,53 @@ export const se_OmitsSerializingEmptyListsCommand = async (
return b.build();
};
+/**
+ * serializeAws_restJson1OperationWithDefaultsCommand
+ */
+export const se_OperationWithDefaultsCommand = async (
+ input: OperationWithDefaultsCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const b = rb(input, context);
+ const headers: any = {
+ "content-type": "application/json",
+ };
+ b.bp("/OperationWithDefaults");
+ let body: any;
+ body = JSON.stringify(
+ take(input, {
+ clientOptionalDefaults: (_) => _json(_),
+ defaults: (_) => se_Defaults(_, context),
+ otherTopLevelDefault: [],
+ topLevelDefault: [],
+ })
+ );
+ b.m("POST").h(headers).b(body);
+ return b.build();
+};
+
+/**
+ * serializeAws_restJson1OperationWithNestedStructureCommand
+ */
+export const se_OperationWithNestedStructureCommand = async (
+ input: OperationWithNestedStructureCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const b = rb(input, context);
+ const headers: any = {
+ "content-type": "application/json",
+ };
+ b.bp("/OperationWithNestedStructure");
+ let body: any;
+ body = JSON.stringify(
+ take(input, {
+ topLevel: (_) => _json(_),
+ })
+ );
+ b.m("POST").h(headers).b(body);
+ return b.build();
+};
+
/**
* serializeAws_restJson1PostPlayerActionCommand
*/
@@ -2353,6 +2443,21 @@ export const se_TestBodyStructureCommand = async (
return b.build();
};
+/**
+ * serializeAws_restJson1TestNoInputNoPayloadCommand
+ */
+export const se_TestNoInputNoPayloadCommand = async (
+ input: TestNoInputNoPayloadCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const b = rb(input, context);
+ const headers: any = {};
+ b.bp("/no_input_no_payload");
+ let body: any;
+ b.m("GET").h(headers).b(body);
+ return b.build();
+};
+
/**
* serializeAws_restJson1TestNoPayloadCommand
*/
@@ -2504,6 +2609,23 @@ export const de_ConstantQueryStringCommand = async (
return contents;
};
+/**
+ * deserializeAws_restJson1ContentTypeParametersCommand
+ */
+export const de_ContentTypeParametersCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ });
+ await collectBody(output.body, context);
+ return contents;
+};
+
/**
* deserializeAws_restJson1DatetimeOffsetsCommand
*/
@@ -3923,6 +4045,77 @@ export const de_OmitsSerializingEmptyListsCommand = async (
return contents;
};
+/**
+ * deserializeAws_restJson1OperationWithDefaultsCommand
+ */
+export const de_OperationWithDefaultsCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ });
+ const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
+ const doc = take(data, {
+ defaultBlob: context.base64Decoder,
+ defaultBoolean: __expectBoolean,
+ defaultByte: __expectByte,
+ defaultDocumentBoolean: (_) => de_Document(_, context),
+ defaultDocumentList: (_) => de_Document(_, context),
+ defaultDocumentMap: (_) => de_Document(_, context),
+ defaultDocumentString: (_) => de_Document(_, context),
+ defaultDouble: __limitedParseDouble,
+ defaultEnum: __expectString,
+ defaultFloat: __limitedParseFloat32,
+ defaultIntEnum: __expectInt32,
+ defaultInteger: __expectInt32,
+ defaultList: _json,
+ defaultLong: __expectLong,
+ defaultMap: _json,
+ defaultNullDocument: (_) => de_Document(_, context),
+ defaultShort: __expectShort,
+ defaultString: __expectString,
+ defaultTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
+ emptyBlob: context.base64Decoder,
+ emptyString: __expectString,
+ falseBoolean: __expectBoolean,
+ zeroByte: __expectByte,
+ zeroDouble: __limitedParseDouble,
+ zeroFloat: __limitedParseFloat32,
+ zeroInteger: __expectInt32,
+ zeroLong: __expectLong,
+ zeroShort: __expectShort,
+ });
+ Object.assign(contents, doc);
+ return contents;
+};
+
+/**
+ * deserializeAws_restJson1OperationWithNestedStructureCommand
+ */
+export const de_OperationWithNestedStructureCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ });
+ const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
+ const doc = take(data, {
+ dialog: _json,
+ dialogList: _json,
+ dialogMap: _json,
+ });
+ Object.assign(contents, doc);
+ return contents;
+};
+
/**
* deserializeAws_restJson1PostPlayerActionCommand
*/
@@ -4209,6 +4402,24 @@ export const de_TestBodyStructureCommand = async (
return contents;
};
+/**
+ * deserializeAws_restJson1TestNoInputNoPayloadCommand
+ */
+export const de_TestNoInputNoPayloadCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ [_tI]: [, output.headers[_xati]],
+ });
+ await collectBody(output.body, context);
+ return contents;
+};
+
/**
* deserializeAws_restJson1TestNoPayloadCommand
*/
@@ -4400,6 +4611,44 @@ const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext)
return __decorateServiceException(exception, parsedOutput.body);
};
+// se_ClientOptionalDefaults omitted.
+
+/**
+ * serializeAws_restJson1Defaults
+ */
+const se_Defaults = (input: Defaults, context: __SerdeContext): any => {
+ return take(input, {
+ defaultBlob: context.base64Encoder,
+ defaultBoolean: [],
+ defaultByte: [],
+ defaultDocumentBoolean: (_) => se_Document(_, context),
+ defaultDocumentList: (_) => se_Document(_, context),
+ defaultDocumentMap: (_) => se_Document(_, context),
+ defaultDocumentString: (_) => se_Document(_, context),
+ defaultDouble: __serializeFloat,
+ defaultEnum: [],
+ defaultFloat: __serializeFloat,
+ defaultIntEnum: [],
+ defaultInteger: [],
+ defaultList: _json,
+ defaultLong: [],
+ defaultMap: _json,
+ defaultNullDocument: (_) => se_Document(_, context),
+ defaultShort: [],
+ defaultString: [],
+ defaultTimestamp: (_) => _.getTime() / 1_000,
+ emptyBlob: context.base64Encoder,
+ emptyString: [],
+ falseBoolean: [],
+ zeroByte: [],
+ zeroDouble: __serializeFloat,
+ zeroFloat: __serializeFloat,
+ zeroInteger: [],
+ zeroLong: [],
+ zeroShort: [],
+ });
+};
+
// se_DenseBooleanMap omitted.
// se_DenseNumberMap omitted.
@@ -4410,6 +4659,12 @@ const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext)
// se_DenseStructMap omitted.
+// se_Dialog omitted.
+
+// se_DialogList omitted.
+
+// se_DialogMap omitted.
+
/**
* serializeAws_restJson1Document
*/
@@ -4430,6 +4685,8 @@ const se_DocumentValuedMap = (input: Record, context: __
}, {});
};
+// se_Farewell omitted.
+
/**
* serializeAws_restJson1MyUnion
*/
@@ -4566,6 +4823,12 @@ const se_StructureListMember = (input: StructureListMember, context: __SerdeCont
// se_TestConfig omitted.
+// se_TestStringList omitted.
+
+// se_TestStringMap omitted.
+
+// se_TopLevel omitted.
+
// se_UnionPayload omitted.
/**
@@ -4661,6 +4924,12 @@ const de_ComplexNestedErrorData = (output: any, context: __SerdeContext): Comple
// de_DenseStructMap omitted.
+// de_Dialog omitted.
+
+// de_DialogList omitted.
+
+// de_DialogMap omitted.
+
/**
* deserializeAws_restJson1Document
*/
@@ -4681,6 +4950,8 @@ const de_DocumentValuedMap = (output: any, context: __SerdeContext): Record);
};
+// de_Farewell omitted.
+
/**
* deserializeAws_restJson1MyUnion
*/
@@ -4842,6 +5113,10 @@ const de_StructureListMember = (output: any, context: __SerdeContext): Structure
// de_TestConfig omitted.
+// de_TestStringList omitted.
+
+// de_TestStringMap omitted.
+
// de_UnionPayload omitted.
/**
diff --git a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts
index ee1840bcb94e..ee18d2ce4656 100644
--- a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts
+++ b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts
@@ -48,6 +48,8 @@ import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputComm
import { NullAndEmptyHeadersClientCommand } from "../../src/commands/NullAndEmptyHeadersClientCommand";
import { OmitsNullSerializesEmptyStringCommand } from "../../src/commands/OmitsNullSerializesEmptyStringCommand";
import { OmitsSerializingEmptyListsCommand } from "../../src/commands/OmitsSerializingEmptyListsCommand";
+import { OperationWithDefaultsCommand } from "../../src/commands/OperationWithDefaultsCommand";
+import { OperationWithNestedStructureCommand } from "../../src/commands/OperationWithNestedStructureCommand";
import { PostPlayerActionCommand } from "../../src/commands/PostPlayerActionCommand";
import { PostUnionWithJsonNameCommand } from "../../src/commands/PostUnionWithJsonNameCommand";
import { PutWithContentEncodingCommand } from "../../src/commands/PutWithContentEncodingCommand";
@@ -62,6 +64,7 @@ import { StreamingTraitsCommand } from "../../src/commands/StreamingTraitsComman
import { StreamingTraitsRequireLengthCommand } from "../../src/commands/StreamingTraitsRequireLengthCommand";
import { StreamingTraitsWithMediaTypeCommand } from "../../src/commands/StreamingTraitsWithMediaTypeCommand";
import { TestBodyStructureCommand } from "../../src/commands/TestBodyStructureCommand";
+import { TestNoInputNoPayloadCommand } from "../../src/commands/TestNoInputNoPayloadCommand";
import { TestNoPayloadCommand } from "../../src/commands/TestNoPayloadCommand";
import { TestPayloadBlobCommand } from "../../src/commands/TestPayloadBlobCommand";
import { TestPayloadStructureCommand } from "../../src/commands/TestPayloadStructureCommand";
@@ -2335,6 +2338,9 @@ it("RestJsonEnumPayloadRequest:Request", async () => {
expect(r.method).toBe("POST");
expect(r.path).toBe("/EnumPayload");
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("text/plain");
+
expect(r.body).toBeDefined();
const utf8Encoder = client.config.utf8Encoder;
const bodyString = `enumvalue`;
@@ -2346,7 +2352,14 @@ it("RestJsonEnumPayloadRequest:Request", async () => {
it("RestJsonEnumPayloadResponse:Response", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
- requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, `enumvalue`),
+ requestHandler: new ResponseDeserializationTestHandler(
+ true,
+ 200,
+ {
+ "content-type": "text/plain",
+ },
+ `enumvalue`
+ ),
});
const params: any = {};
@@ -3367,11 +3380,15 @@ it("RestJsonStringPayloadRequest:Request", async () => {
const r = err.request;
expect(r.method).toBe("POST");
expect(r.path).toBe("/StringPayload");
+ expect(r.headers["content-length"]).toBeDefined();
+
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("text/plain");
expect(r.body).toBeDefined();
const utf8Encoder = client.config.utf8Encoder;
const bodyString = `rawstring`;
- const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body);
+ const unequalParts: any = compareEquivalentTextBodies(bodyString, r.body);
expect(unequalParts).toBeUndefined();
}
});
@@ -3379,7 +3396,14 @@ it("RestJsonStringPayloadRequest:Request", async () => {
it("RestJsonStringPayloadResponse:Response", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
- requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, `rawstring`),
+ requestHandler: new ResponseDeserializationTestHandler(
+ true,
+ 200,
+ {
+ "content-type": "text/plain",
+ },
+ `rawstring`
+ ),
});
const params: any = {};
@@ -7064,18 +7088,16 @@ it("RestJsonOmitsEmptyListQueryValues:Request", async () => {
});
/**
- * Unit types in unions are serialized like normal structures in requests.
+ * Client populates default values in input.
*/
-it("RestJsonInputUnionWithUnitMember:Request", async () => {
+it.skip("RestJsonClientPopulatesDefaultValuesInInput:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new PostPlayerActionCommand({
- action: {
- quit: {} as any,
- } as any,
+ const command = new OperationWithDefaultsCommand({
+ defaults: {} as any,
} as any);
try {
await client.send(command);
@@ -7088,7 +7110,7 @@ it("RestJsonInputUnionWithUnitMember:Request", async () => {
}
const r = err.request;
expect(r.method).toBe("POST");
- expect(r.path).toBe("/PostPlayerAction");
+ expect(r.path).toBe("/OperationWithDefaults");
expect(r.headers["content-type"]).toBeDefined();
expect(r.headers["content-type"]).toBe("application/json");
@@ -7096,8 +7118,34 @@ it("RestJsonInputUnionWithUnitMember:Request", async () => {
expect(r.body).toBeDefined();
const utf8Encoder = client.config.utf8Encoder;
const bodyString = `{
- \"action\": {
- \"quit\": {}
+ \"defaults\": {
+ \"defaultString\": \"hi\",
+ \"defaultBoolean\": true,
+ \"defaultList\": [],
+ \"defaultDocumentMap\": {},
+ \"defaultDocumentString\": \"hi\",
+ \"defaultDocumentBoolean\": true,
+ \"defaultDocumentList\": [],
+ \"defaultTimestamp\": 0,
+ \"defaultBlob\": \"YWJj\",
+ \"defaultByte\": 1,
+ \"defaultShort\": 1,
+ \"defaultInteger\": 10,
+ \"defaultLong\": 100,
+ \"defaultFloat\": 1.0,
+ \"defaultDouble\": 1.0,
+ \"defaultMap\": {},
+ \"defaultEnum\": \"FOO\",
+ \"defaultIntEnum\": 1,
+ \"emptyString\": \"\",
+ \"falseBoolean\": false,
+ \"emptyBlob\": \"\",
+ \"zeroByte\": 0,
+ \"zeroShort\": 0,
+ \"zeroInteger\": 0,
+ \"zeroLong\": 0,
+ \"zeroFloat\": 0.0,
+ \"zeroDouble\": 0.0
}
}`;
const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
@@ -7106,61 +7154,110 @@ it("RestJsonInputUnionWithUnitMember:Request", async () => {
});
/**
- * Unit types in unions are serialized like normal structures in responses.
+ * Client skips top level default values in input.
*/
-it("RestJsonOutputUnionWithUnitMember:Response", async () => {
+it.skip("RestJsonClientSkipsTopLevelDefaultValuesInInput:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
- requestHandler: new ResponseDeserializationTestHandler(
- true,
- 200,
- {
- "content-type": "application/json",
- },
- `{
- "action": {
- "quit": {}
- }
- }`
- ),
+ requestHandler: new RequestSerializationTestHandler(),
});
- const params: any = {};
- const command = new PostPlayerActionCommand(params);
-
- let r: any;
+ const command = new OperationWithDefaultsCommand({} as any);
try {
- r = await client.send(command);
- } catch (err) {
- fail("Expected a valid response to be returned, got " + err);
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/OperationWithDefaults");
+
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("application/json");
+
+ expect(r.body).toBeDefined();
+ const utf8Encoder = client.config.utf8Encoder;
+ const bodyString = `{
+ }`;
+ const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
+ expect(unequalParts).toBeUndefined();
}
- expect(r["$metadata"].httpStatusCode).toBe(200);
- const paramsToValidate: any = [
- {
- action: {
- quit: {},
- },
- },
- ][0];
- Object.keys(paramsToValidate).forEach((param) => {
- expect(r[param]).toBeDefined();
- expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
- });
});
/**
- * Tests that jsonName works with union members.
+ * Client uses explicitly provided member values over defaults
*/
-it("PostUnionWithJsonNameRequest1:Request", async () => {
+it.skip("RestJsonClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new PostUnionWithJsonNameCommand({
- value: {
- foo: "hi",
+ const command = new OperationWithDefaultsCommand({
+ defaults: {
+ defaultString: "bye",
+
+ defaultBoolean: true,
+
+ defaultList: ["a"],
+
+ defaultDocumentMap: {
+ name: "Jack",
+ },
+
+ defaultDocumentString: "bye",
+
+ defaultDocumentBoolean: true,
+
+ defaultDocumentList: ["b"],
+
+ defaultNullDocument: "notNull",
+
+ defaultTimestamp: new Date(1000),
+
+ defaultBlob: Uint8Array.from("hi", (c) => c.charCodeAt(0)),
+
+ defaultByte: 2,
+
+ defaultShort: 2,
+
+ defaultInteger: 20,
+
+ defaultLong: 200,
+
+ defaultFloat: 2.0,
+
+ defaultDouble: 2.0,
+
+ defaultMap: {
+ name: "Jack",
+ } as any,
+
+ defaultEnum: "BAR",
+
+ defaultIntEnum: 2,
+
+ emptyString: "foo",
+
+ falseBoolean: true,
+
+ emptyBlob: Uint8Array.from("hi", (c) => c.charCodeAt(0)),
+
+ zeroByte: 1,
+
+ zeroShort: 1,
+
+ zeroInteger: 1,
+
+ zeroLong: 1,
+
+ zeroFloat: 1.0,
+
+ zeroDouble: 1.0,
} as any,
} as any);
try {
@@ -7174,7 +7271,7 @@ it("PostUnionWithJsonNameRequest1:Request", async () => {
}
const r = err.request;
expect(r.method).toBe("POST");
- expect(r.path).toBe("/PostUnionWithJsonName");
+ expect(r.path).toBe("/OperationWithDefaults");
expect(r.headers["content-type"]).toBeDefined();
expect(r.headers["content-type"]).toBe("application/json");
@@ -7182,8 +7279,35 @@ it("PostUnionWithJsonNameRequest1:Request", async () => {
expect(r.body).toBeDefined();
const utf8Encoder = client.config.utf8Encoder;
const bodyString = `{
- \"value\": {
- \"FOO\": \"hi\"
+ \"defaults\": {
+ \"defaultString\": \"bye\",
+ \"defaultBoolean\": true,
+ \"defaultList\": [\"a\"],
+ \"defaultDocumentMap\": {\"name\": \"Jack\"},
+ \"defaultDocumentString\": \"bye\",
+ \"defaultDocumentBoolean\": true,
+ \"defaultDocumentList\": [\"b\"],
+ \"defaultNullDocument\": \"notNull\",
+ \"defaultTimestamp\": 1,
+ \"defaultBlob\": \"aGk=\",
+ \"defaultByte\": 2,
+ \"defaultShort\": 2,
+ \"defaultInteger\": 20,
+ \"defaultLong\": 200,
+ \"defaultFloat\": 2.0,
+ \"defaultDouble\": 2.0,
+ \"defaultMap\": {\"name\": \"Jack\"},
+ \"defaultEnum\": \"BAR\",
+ \"defaultIntEnum\": 2,
+ \"emptyString\": \"foo\",
+ \"falseBoolean\": true,
+ \"emptyBlob\": \"aGk=\",
+ \"zeroByte\": 1,
+ \"zeroShort\": 1,
+ \"zeroInteger\": 1,
+ \"zeroLong\": 1,
+ \"zeroFloat\": 1.0,
+ \"zeroDouble\": 1.0
}
}`;
const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
@@ -7192,18 +7316,18 @@ it("PostUnionWithJsonNameRequest1:Request", async () => {
});
/**
- * Tests that jsonName works with union members.
+ * Any time a value is provided for a member in the top level of input, it is used, regardless of if its the default.
*/
-it("PostUnionWithJsonNameRequest2:Request", async () => {
+it.skip("RestJsonClientUsesExplicitlyProvidedValuesInTopLevel:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new PostUnionWithJsonNameCommand({
- value: {
- baz: "hi",
- } as any,
+ const command = new OperationWithDefaultsCommand({
+ topLevelDefault: "hi",
+
+ otherTopLevelDefault: 0,
} as any);
try {
await client.send(command);
@@ -7216,7 +7340,7 @@ it("PostUnionWithJsonNameRequest2:Request", async () => {
}
const r = err.request;
expect(r.method).toBe("POST");
- expect(r.path).toBe("/PostUnionWithJsonName");
+ expect(r.path).toBe("/OperationWithDefaults");
expect(r.headers["content-type"]).toBeDefined();
expect(r.headers["content-type"]).toBe("application/json");
@@ -7224,9 +7348,8 @@ it("PostUnionWithJsonNameRequest2:Request", async () => {
expect(r.body).toBeDefined();
const utf8Encoder = client.config.utf8Encoder;
const bodyString = `{
- \"value\": {
- \"_baz\": \"hi\"
- }
+ \"topLevelDefault\": \"hi\",
+ \"otherTopLevelDefault\": 0
}`;
const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
expect(unequalParts).toBeUndefined();
@@ -7234,18 +7357,16 @@ it("PostUnionWithJsonNameRequest2:Request", async () => {
});
/**
- * Tests that jsonName works with union members.
+ * Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored.
*/
-it("PostUnionWithJsonNameRequest3:Request", async () => {
+it.skip("RestJsonClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new PostUnionWithJsonNameCommand({
- value: {
- bar: "hi",
- } as any,
+ const command = new OperationWithDefaultsCommand({
+ clientOptionalDefaults: {} as any,
} as any);
try {
await client.send(command);
@@ -7258,7 +7379,7 @@ it("PostUnionWithJsonNameRequest3:Request", async () => {
}
const r = err.request;
expect(r.method).toBe("POST");
- expect(r.path).toBe("/PostUnionWithJsonName");
+ expect(r.path).toBe("/OperationWithDefaults");
expect(r.headers["content-type"]).toBeDefined();
expect(r.headers["content-type"]).toBe("application/json");
@@ -7266,9 +7387,7 @@ it("PostUnionWithJsonNameRequest3:Request", async () => {
expect(r.body).toBeDefined();
const utf8Encoder = client.config.utf8Encoder;
const bodyString = `{
- \"value\": {
- \"bar\": \"hi\"
- }
+ \"clientOptionalDefaults\": {}
}`;
const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
expect(unequalParts).toBeUndefined();
@@ -7276,9 +7395,9 @@ it("PostUnionWithJsonNameRequest3:Request", async () => {
});
/**
- * Tests that jsonName works with union members.
+ * Client populates default values when missing in response.
*/
-it("PostUnionWithJsonNameResponse1:Response", async () => {
+it.skip("RestJsonClientPopulatesDefaultsValuesWhenMissingInResponse:Response", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new ResponseDeserializationTestHandler(
@@ -7287,16 +7406,12 @@ it("PostUnionWithJsonNameResponse1:Response", async () => {
{
"content-type": "application/json",
},
- `{
- "value": {
- "FOO": "hi"
- }
- }`
+ `{}`
),
});
const params: any = {};
- const command = new PostUnionWithJsonNameCommand(params);
+ const command = new OperationWithDefaultsCommand(params);
let r: any;
try {
@@ -7308,9 +7423,59 @@ it("PostUnionWithJsonNameResponse1:Response", async () => {
expect(r["$metadata"].httpStatusCode).toBe(200);
const paramsToValidate: any = [
{
- value: {
- foo: "hi",
- },
+ defaultString: "hi",
+
+ defaultBoolean: true,
+
+ defaultList: [],
+
+ defaultDocumentMap: {},
+
+ defaultDocumentString: "hi",
+
+ defaultDocumentBoolean: true,
+
+ defaultDocumentList: [],
+
+ defaultTimestamp: new Date(0 * 1000),
+
+ defaultBlob: Uint8Array.from("abc", (c) => c.charCodeAt(0)),
+
+ defaultByte: 1,
+
+ defaultShort: 1,
+
+ defaultInteger: 10,
+
+ defaultLong: 100,
+
+ defaultFloat: 1.0,
+
+ defaultDouble: 1.0,
+
+ defaultMap: {},
+
+ defaultEnum: "FOO",
+
+ defaultIntEnum: 1,
+
+ emptyString: "",
+
+ falseBoolean: false,
+
+ emptyBlob: Uint8Array.from("", (c) => c.charCodeAt(0)),
+
+ zeroByte: 0,
+
+ zeroShort: 0,
+
+ zeroInteger: 0,
+
+ zeroLong: 0,
+
+ zeroFloat: 0.0,
+
+ zeroDouble: 0.0,
},
][0];
Object.keys(paramsToValidate).forEach((param) => {
@@ -7320,9 +7485,9 @@ it("PostUnionWithJsonNameResponse1:Response", async () => {
});
/**
- * Tests that jsonName works with union members.
+ * Client ignores default values if member values are present in the response.
*/
-it("PostUnionWithJsonNameResponse2:Response", async () => {
+it.skip("RestJsonClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Response", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new ResponseDeserializationTestHandler(
@@ -7332,15 +7497,40 @@ it("PostUnionWithJsonNameResponse2:Response", async () => {
"content-type": "application/json",
},
`{
- "value": {
- "_baz": "hi"
- }
+ "defaultString": "bye",
+ "defaultBoolean": false,
+ "defaultList": ["a"],
+ "defaultDocumentMap": {"name": "Jack"},
+ "defaultDocumentString": "bye",
+ "defaultDocumentBoolean": false,
+ "defaultDocumentList": ["b"],
+ "defaultNullDocument": "notNull",
+ "defaultTimestamp": 2,
+ "defaultBlob": "aGk=",
+ "defaultByte": 2,
+ "defaultShort": 2,
+ "defaultInteger": 20,
+ "defaultLong": 200,
+ "defaultFloat": 2.0,
+ "defaultDouble": 2.0,
+ "defaultMap": {"name": "Jack"},
+ "defaultEnum": "BAR",
+ "defaultIntEnum": 2,
+ "emptyString": "foo",
+ "falseBoolean": true,
+ "emptyBlob": "aGk=",
+ "zeroByte": 1,
+ "zeroShort": 1,
+ "zeroInteger": 1,
+ "zeroLong": 1,
+ "zeroFloat": 1.0,
+ "zeroDouble": 1.0
}`
),
});
const params: any = {};
- const command = new PostUnionWithJsonNameCommand(params);
+ const command = new OperationWithDefaultsCommand(params);
let r: any;
try {
@@ -7352,53 +7542,65 @@ it("PostUnionWithJsonNameResponse2:Response", async () => {
expect(r["$metadata"].httpStatusCode).toBe(200);
const paramsToValidate: any = [
{
- value: {
- baz: "hi",
- },
- },
- ][0];
- Object.keys(paramsToValidate).forEach((param) => {
- expect(r[param]).toBeDefined();
- expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
- });
-});
+ defaultString: "bye",
-/**
- * Tests that jsonName works with union members.
- */
-it("PostUnionWithJsonNameResponse3:Response", async () => {
- const client = new RestJsonProtocolClient({
- ...clientParams,
- requestHandler: new ResponseDeserializationTestHandler(
- true,
- 200,
- {
- "content-type": "application/json",
+ defaultBoolean: false,
+
+ defaultList: ["a"],
+
+ defaultDocumentMap: {
+ name: "Jack",
},
- `{
- "value": {
- "bar": "hi"
- }
- }`
- ),
- });
- const params: any = {};
- const command = new PostUnionWithJsonNameCommand(params);
+ defaultDocumentString: "bye",
- let r: any;
- try {
- r = await client.send(command);
- } catch (err) {
- fail("Expected a valid response to be returned, got " + err);
- return;
- }
- expect(r["$metadata"].httpStatusCode).toBe(200);
- const paramsToValidate: any = [
- {
- value: {
- bar: "hi",
+ defaultDocumentBoolean: false,
+
+ defaultDocumentList: ["b"],
+
+ defaultNullDocument: "notNull",
+
+ defaultTimestamp: new Date(1 * 1000),
+
+ defaultBlob: Uint8Array.from("hi", (c) => c.charCodeAt(0)),
+
+ defaultByte: 2,
+
+ defaultShort: 2,
+
+ defaultInteger: 20,
+
+ defaultLong: 200,
+
+ defaultFloat: 2.0,
+
+ defaultDouble: 2.0,
+
+ defaultMap: {
+ name: "Jack",
},
+
+ defaultEnum: "BAR",
+
+ defaultIntEnum: 2,
+
+ emptyString: "foo",
+
+ falseBoolean: true,
+
+ emptyBlob: Uint8Array.from("hi", (c) => c.charCodeAt(0)),
+
+ zeroByte: 1,
+
+ zeroShort: 1,
+
+ zeroInteger: 1,
+
+ zeroLong: 1,
+
+ zeroFloat: 1.0,
+
+ zeroDouble: 1.0,
},
][0];
Object.keys(paramsToValidate).forEach((param) => {
@@ -7408,16 +7610,601 @@ it("PostUnionWithJsonNameResponse3:Response", async () => {
});
/**
- * Compression algorithm encoding is appended to the Content-Encoding header.
+ * Client populates nested default values when missing.
*/
-it.skip("SDKAppliedContentEncoding_restJson1:Request", async () => {
+it.skip("RestJsonClientPopulatesNestedDefaultValuesWhenMissing:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new PutWithContentEncodingCommand({
- data: "RjCEL3kBwqPivZ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4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n",
+ const command = new OperationWithNestedStructureCommand({
+ topLevel: {
+ dialog: {
+ language: "en",
+ } as any,
+
+ dialogList: [
+ {} as any,
+
+ {
+ farewell: {} as any,
+ } as any,
+
+ {
+ language: "it",
+
+ greeting: "ciao",
+
+ farewell: {
+ phrase: "arrivederci",
+ } as any,
+ } as any,
+ ],
+
+ dialogMap: {
+ emptyDialog: {} as any,
+
+ partialEmptyDialog: {
+ language: "en",
+
+ farewell: {} as any,
+ } as any,
+
+ nonEmptyDialog: {
+ greeting: "konnichiwa",
+
+ farewell: {
+ phrase: "sayonara",
+ } as any,
+ } as any,
+ } as any,
+ } as any,
+ } as any);
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/OperationWithNestedStructure");
+
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("application/json");
+
+ expect(r.body).toBeDefined();
+ const utf8Encoder = client.config.utf8Encoder;
+ const bodyString = `{
+ \"topLevel\": {
+ \"dialog\": {
+ \"language\": \"en\",
+ \"greeting\": \"hi\"
+ },
+ \"dialogList\": [
+ {
+ \"greeting\": \"hi\"
+ },
+ {
+ \"greeting\": \"hi\",
+ \"farewell\": {
+ \"phrase\": \"bye\"
+ }
+ },
+ {
+ \"language\": \"it\",
+ \"greeting\": \"ciao\",
+ \"farewell\": {
+ \"phrase\": \"arrivederci\"
+ }
+ }
+ ],
+ \"dialogMap\": {
+ \"emptyDialog\": {
+ \"greeting\": \"hi\"
+ },
+ \"partialEmptyDialog\": {
+ \"language\": \"en\",
+ \"greeting\": \"hi\",
+ \"farewell\": {
+ \"phrase\": \"bye\"
+ }
+ },
+ \"nonEmptyDialog\": {
+ \"greeting\": \"konnichiwa\",
+ \"farewell\": {
+ \"phrase\": \"sayonara\"
+ }
+ }
+ }
+ }
+ }`;
+ const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
+ expect(unequalParts).toBeUndefined();
+ }
+});
+
+/**
+ * Client populates nested default values when missing in response body.
+ */
+it.skip("RestJsonClientPopulatesNestedDefaultsWhenMissingInResponseBody:Response", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new ResponseDeserializationTestHandler(
+ true,
+ 200,
+ {
+ "content-type": "application/json",
+ },
+ `{
+ "dialog": {
+ "language": "en"
+ },
+ "dialogList": [
+ {
+ },
+ {
+ "farewell": {}
+ },
+ {
+ "language": "it",
+ "greeting": "ciao",
+ "farewell": {
+ "phrase": "arrivederci"
+ }
+ }
+ ],
+ "dialogMap": {
+ "emptyDialog": {
+ },
+ "partialEmptyDialog": {
+ "language": "en",
+ "farewell": {}
+ },
+ "nonEmptyDialog": {
+ "greeting": "konnichiwa",
+ "farewell": {
+ "phrase": "sayonara"
+ }
+ }
+ }
+ }`
+ ),
+ });
+
+ const params: any = {};
+ const command = new OperationWithNestedStructureCommand(params);
+
+ let r: any;
+ try {
+ r = await client.send(command);
+ } catch (err) {
+ fail("Expected a valid response to be returned, got " + err);
+ return;
+ }
+ expect(r["$metadata"].httpStatusCode).toBe(200);
+ const paramsToValidate: any = [
+ {
+ dialog: {
+ language: "en",
+
+ greeting: "hi",
+ },
+
+ dialogList: [
+ {
+ greeting: "hi",
+ },
+
+ {
+ greeting: "hi",
+
+ farewell: {
+ phrase: "bye",
+ },
+ },
+
+ {
+ language: "it",
+
+ greeting: "ciao",
+
+ farewell: {
+ phrase: "arrivederci",
+ },
+ },
+ ],
+
+ dialogMap: {
+ emptyDialog: {
+ greeting: "hi",
+ },
+
+ partialEmptyDialog: {
+ language: "en",
+
+ greeting: "hi",
+
+ farewell: {
+ phrase: "bye",
+ },
+ },
+
+ nonEmptyDialog: {
+ greeting: "konnichiwa",
+
+ farewell: {
+ phrase: "sayonara",
+ },
+ },
+ },
+ },
+ ][0];
+ Object.keys(paramsToValidate).forEach((param) => {
+ expect(r[param]).toBeDefined();
+ expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
+ });
+});
+
+/**
+ * Unit types in unions are serialized like normal structures in requests.
+ */
+it("RestJsonInputUnionWithUnitMember:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new PostPlayerActionCommand({
+ action: {
+ quit: {} as any,
+ } as any,
+ } as any);
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/PostPlayerAction");
+
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("application/json");
+
+ expect(r.body).toBeDefined();
+ const utf8Encoder = client.config.utf8Encoder;
+ const bodyString = `{
+ \"action\": {
+ \"quit\": {}
+ }
+ }`;
+ const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
+ expect(unequalParts).toBeUndefined();
+ }
+});
+
+/**
+ * Unit types in unions are serialized like normal structures in responses.
+ */
+it("RestJsonOutputUnionWithUnitMember:Response", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new ResponseDeserializationTestHandler(
+ true,
+ 200,
+ {
+ "content-type": "application/json",
+ },
+ `{
+ "action": {
+ "quit": {}
+ }
+ }`
+ ),
+ });
+
+ const params: any = {};
+ const command = new PostPlayerActionCommand(params);
+
+ let r: any;
+ try {
+ r = await client.send(command);
+ } catch (err) {
+ fail("Expected a valid response to be returned, got " + err);
+ return;
+ }
+ expect(r["$metadata"].httpStatusCode).toBe(200);
+ const paramsToValidate: any = [
+ {
+ action: {
+ quit: {},
+ },
+ },
+ ][0];
+ Object.keys(paramsToValidate).forEach((param) => {
+ expect(r[param]).toBeDefined();
+ expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
+ });
+});
+
+/**
+ * Tests that jsonName works with union members.
+ */
+it("PostUnionWithJsonNameRequest1:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new PostUnionWithJsonNameCommand({
+ value: {
+ foo: "hi",
+ } as any,
+ } as any);
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/PostUnionWithJsonName");
+
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("application/json");
+
+ expect(r.body).toBeDefined();
+ const utf8Encoder = client.config.utf8Encoder;
+ const bodyString = `{
+ \"value\": {
+ \"FOO\": \"hi\"
+ }
+ }`;
+ const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
+ expect(unequalParts).toBeUndefined();
+ }
+});
+
+/**
+ * Tests that jsonName works with union members.
+ */
+it("PostUnionWithJsonNameRequest2:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new PostUnionWithJsonNameCommand({
+ value: {
+ baz: "hi",
+ } as any,
+ } as any);
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/PostUnionWithJsonName");
+
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("application/json");
+
+ expect(r.body).toBeDefined();
+ const utf8Encoder = client.config.utf8Encoder;
+ const bodyString = `{
+ \"value\": {
+ \"_baz\": \"hi\"
+ }
+ }`;
+ const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
+ expect(unequalParts).toBeUndefined();
+ }
+});
+
+/**
+ * Tests that jsonName works with union members.
+ */
+it("PostUnionWithJsonNameRequest3:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new PostUnionWithJsonNameCommand({
+ value: {
+ bar: "hi",
+ } as any,
+ } as any);
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/PostUnionWithJsonName");
+
+ expect(r.headers["content-type"]).toBeDefined();
+ expect(r.headers["content-type"]).toBe("application/json");
+
+ expect(r.body).toBeDefined();
+ const utf8Encoder = client.config.utf8Encoder;
+ const bodyString = `{
+ \"value\": {
+ \"bar\": \"hi\"
+ }
+ }`;
+ const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
+ expect(unequalParts).toBeUndefined();
+ }
+});
+
+/**
+ * Tests that jsonName works with union members.
+ */
+it("PostUnionWithJsonNameResponse1:Response", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new ResponseDeserializationTestHandler(
+ true,
+ 200,
+ {
+ "content-type": "application/json",
+ },
+ `{
+ "value": {
+ "FOO": "hi"
+ }
+ }`
+ ),
+ });
+
+ const params: any = {};
+ const command = new PostUnionWithJsonNameCommand(params);
+
+ let r: any;
+ try {
+ r = await client.send(command);
+ } catch (err) {
+ fail("Expected a valid response to be returned, got " + err);
+ return;
+ }
+ expect(r["$metadata"].httpStatusCode).toBe(200);
+ const paramsToValidate: any = [
+ {
+ value: {
+ foo: "hi",
+ },
+ },
+ ][0];
+ Object.keys(paramsToValidate).forEach((param) => {
+ expect(r[param]).toBeDefined();
+ expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
+ });
+});
+
+/**
+ * Tests that jsonName works with union members.
+ */
+it("PostUnionWithJsonNameResponse2:Response", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new ResponseDeserializationTestHandler(
+ true,
+ 200,
+ {
+ "content-type": "application/json",
+ },
+ `{
+ "value": {
+ "_baz": "hi"
+ }
+ }`
+ ),
+ });
+
+ const params: any = {};
+ const command = new PostUnionWithJsonNameCommand(params);
+
+ let r: any;
+ try {
+ r = await client.send(command);
+ } catch (err) {
+ fail("Expected a valid response to be returned, got " + err);
+ return;
+ }
+ expect(r["$metadata"].httpStatusCode).toBe(200);
+ const paramsToValidate: any = [
+ {
+ value: {
+ baz: "hi",
+ },
+ },
+ ][0];
+ Object.keys(paramsToValidate).forEach((param) => {
+ expect(r[param]).toBeDefined();
+ expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
+ });
+});
+
+/**
+ * Tests that jsonName works with union members.
+ */
+it("PostUnionWithJsonNameResponse3:Response", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new ResponseDeserializationTestHandler(
+ true,
+ 200,
+ {
+ "content-type": "application/json",
+ },
+ `{
+ "value": {
+ "bar": "hi"
+ }
+ }`
+ ),
+ });
+
+ const params: any = {};
+ const command = new PostUnionWithJsonNameCommand(params);
+
+ let r: any;
+ try {
+ r = await client.send(command);
+ } catch (err) {
+ fail("Expected a valid response to be returned, got " + err);
+ return;
+ }
+ expect(r["$metadata"].httpStatusCode).toBe(200);
+ const paramsToValidate: any = [
+ {
+ value: {
+ bar: "hi",
+ },
+ },
+ ][0];
+ Object.keys(paramsToValidate).forEach((param) => {
+ expect(r[param]).toBeDefined();
+ expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
+ });
+});
+
+/**
+ * Compression algorithm encoding is appended to the Content-Encoding header.
+ */
+it.skip("SDKAppliedContentEncoding_restJson1:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new PutWithContentEncodingCommand({
+ data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGme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qVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n",
} as any);
try {
await client.send(command);
@@ -9199,6 +9986,36 @@ it("RestJsonHttpWithEmptyBody:Request", async () => {
}
});
+/**
+ * Serializes a GET request for an operation with no input, and therefore no modeled body
+ */
+it("RestJsonHttpWithNoInput:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new TestNoInputNoPayloadCommand({});
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("GET");
+ expect(r.path).toBe("/no_input_no_payload");
+
+ expect(r.headers["content-length"]).toBeUndefined();
+ expect(r.headers["content-type"]).toBeUndefined();
+
+ expect(r.body).toBeFalsy();
+ }
+});
+
/**
* Serializes a GET request with no modeled body
*/
@@ -9633,6 +10450,17 @@ const compareEquivalentOctetStreamBodies = (
return compareParts(expectedParts, generatedParts);
};
+/**
+ * Returns a map of key names that were un-equal to value objects showing the
+ * discrepancies between the components.
+ */
+const compareEquivalentTextBodies = (expectedBody: string, generatedBody: string): Object => {
+ const expectedParts = { Value: expectedBody };
+ const generatedParts = { Value: generatedBody };
+
+ return compareParts(expectedParts, generatedParts);
+};
+
/**
* Returns a map of key names that were un-equal to value objects showing the
* discrepancies between the components.
diff --git a/private/aws-protocoltests-restxml/README.md b/private/aws-protocoltests-restxml/README.md
index 8aa18ce3a19a..999259370862 100644
--- a/private/aws-protocoltests-restxml/README.md
+++ b/private/aws-protocoltests-restxml/README.md
@@ -402,6 +402,14 @@ XmlTimestamps
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlTimestampsCommandOutput/)
+