diff --git a/Makefile b/Makefile index 5cc6c5d8d95a5..d81b50bd666be 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,9 @@ test-types: test-protocols: bundles yarn g:vitest run -c vitest.config.protocols.integ.ts +test-schema: bundles + yarn g:vitest run -c vitest.config.protocols-schema.integ.ts + test-integration: bundles rm -rf ./clients/client-sso/node_modules/\@smithy # todo(yarn) incompatible redundant nesting. yarn g:vitest run -c vitest.config.integ.ts diff --git a/codegen/protocol-test-codegen/smithy-build.json b/codegen/protocol-test-codegen/smithy-build.json index 1724299555316..192c99dd631b9 100644 --- a/codegen/protocol-test-codegen/smithy-build.json +++ b/codegen/protocol-test-codegen/smithy-build.json @@ -263,6 +263,181 @@ "private": true } } + }, + "aws-protocoltests-ec2-schema": { + "transforms": [ + { + "name": "includeServices", + "args": { + "services": ["aws.protocoltests.ec2#AwsEc2"] + } + } + ], + "plugins": { + "typescript-codegen": { + "package": "@aws-sdk/aws-protocoltests-ec2-schema", + "generateSchemas": true, + "packageVersion": "1.0.0-alpha.1", + "packageJson": { + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" + }, + "private": true + } + } + }, + "aws-protocoltests-json-schema": { + "transforms": [ + { + "name": "includeServices", + "args": { + "services": ["aws.protocoltests.json#JsonProtocol"] + } + } + ], + "plugins": { + "typescript-codegen": { + "package": "@aws-sdk/aws-protocoltests-json-schema", + "generateSchemas": true, + "packageVersion": "1.0.0-alpha.1", + "packageJson": { + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" + }, + "private": true + } + } + }, + "aws-protocoltests-json-10-schema": { + "transforms": [ + { + "name": "includeServices", + "args": { + "services": ["aws.protocoltests.json10#JsonRpc10"] + } + } + ], + "plugins": { + "typescript-codegen": { + "package": "@aws-sdk/aws-protocoltests-json-10-schema", + "generateSchemas": true, + "packageVersion": "1.0.0-alpha.1", + "packageJson": { + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" + }, + "private": true + } + } + }, + "aws-protocoltests-query-schema": { + "transforms": [ + { + "name": "includeServices", + "args": { + "services": ["aws.protocoltests.query#AwsQuery"] + } + } + ], + "plugins": { + "typescript-codegen": { + "package": "@aws-sdk/aws-protocoltests-query-schema", + "generateSchemas": true, + "packageVersion": "1.0.0-alpha.1", + "packageJson": { + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" + }, + "private": true + } + } + }, + "aws-protocoltests-restjson-schema": { + "transforms": [ + { + "name": "includeServices", + "args": { + "services": ["aws.protocoltests.restjson#RestJson"] + } + } + ], + "plugins": { + "typescript-codegen": { + "package": "@aws-sdk/aws-protocoltests-restjson-schema", + "generateSchemas": true, + "packageVersion": "1.0.0-alpha.1", + "packageJson": { + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" + }, + "private": true + } + } + }, + "aws-protocoltests-restxml-schema": { + "transforms": [ + { + "name": "includeServices", + "args": { + "services": ["aws.protocoltests.restxml#RestXml"] + } + } + ], + "plugins": { + "typescript-codegen": { + "package": "@aws-sdk/aws-protocoltests-restxml-schema", + "generateSchemas": true, + "packageVersion": "1.0.0-alpha.1", + "packageJson": { + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" + }, + "private": true + } + } + }, + "aws-smithy-rpcv2-cbor-schema": { + "transforms": [ + { + "name": "includeServices", + "args": { + "services": ["smithy.protocoltests.rpcv2Cbor#RpcV2Protocol"] + } + } + ], + "plugins": { + "typescript-codegen": { + "package": "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema", + "generateSchemas": true, + "packageVersion": "1.0.0-alpha.1", + "packageJson": { + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" + }, + "private": true + } + } } } } diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddProtocolConfig.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddProtocolConfig.java new file mode 100644 index 0000000000000..c4c88923b0026 --- /dev/null +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddProtocolConfig.java @@ -0,0 +1,166 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.aws.typescript.codegen; + +import java.util.Collections; +import java.util.Map; +import java.util.Objects; +import java.util.function.Consumer; +import software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait; +import software.amazon.smithy.aws.traits.protocols.AwsJson1_1Trait; +import software.amazon.smithy.aws.traits.protocols.AwsQueryTrait; +import software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait; +import software.amazon.smithy.aws.traits.protocols.RestJson1Trait; +import software.amazon.smithy.aws.traits.protocols.RestXmlTrait; +import software.amazon.smithy.codegen.core.SymbolProvider; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.traits.XmlNamespaceTrait; +import software.amazon.smithy.typescript.codegen.LanguageTarget; +import software.amazon.smithy.typescript.codegen.TypeScriptSettings; +import software.amazon.smithy.typescript.codegen.TypeScriptWriter; +import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration; +import software.amazon.smithy.typescript.codegen.schema.SchemaGenerationAllowlist; +import software.amazon.smithy.utils.MapUtils; +import software.amazon.smithy.utils.SmithyInternalApi; + + +/** + * Adds a protocol implementation to the runtime config. + */ +@SmithyInternalApi +public final class AddProtocolConfig implements TypeScriptIntegration { + + public AddProtocolConfig() { + SchemaGenerationAllowlist.allow("com.amazonaws.s3#AmazonS3"); + SchemaGenerationAllowlist.allow("com.amazonaws.dynamodb#DynamoDB_20120810"); + SchemaGenerationAllowlist.allow("com.amazonaws.lambda#AWSGirApiService"); + + // protocol tests + SchemaGenerationAllowlist.allow("aws.protocoltests.json10#JsonRpc10"); + SchemaGenerationAllowlist.allow("aws.protocoltests.json#JsonProtocol"); + SchemaGenerationAllowlist.allow("aws.protocoltests.restjson#RestJson"); + SchemaGenerationAllowlist.allow("aws.protocoltests.restxml#RestXml"); + SchemaGenerationAllowlist.allow("aws.protocoltests.query#AwsQuery"); + SchemaGenerationAllowlist.allow("aws.protocoltests.ec2#AwsEc2"); + } + + @Override + public void addConfigInterfaceFields( + TypeScriptSettings settings, + Model model, + SymbolProvider symbolProvider, + TypeScriptWriter writer + ) { + // the {{ protocol?: Protocol }} type field is provided + // by the smithy client config interface. + } + + @Override + public Map> getRuntimeConfigWriters( + TypeScriptSettings settings, + Model model, + SymbolProvider symbolProvider, + LanguageTarget target + ) { + if (!SchemaGenerationAllowlist.allows(settings.getService(), settings)) { + return Collections.emptyMap(); + } + String namespace = settings.getService().getNamespace(); + String xmlns = settings.getService(model) + .getTrait(XmlNamespaceTrait.class) + .map(XmlNamespaceTrait::getUri) + .orElse(""); + + switch (target) { + case SHARED: + if (Objects.equals(settings.getProtocol(), RestXmlTrait.ID)) { + return MapUtils.of( + "protocol", writer -> { + writer.addImportSubmodule( + "AwsRestXmlProtocol", null, + AwsDependency.AWS_SDK_CORE, "/protocols"); + writer.write(""" + new AwsRestXmlProtocol({ + defaultNamespace: $S, xmlNamespace: $S, + })""", + namespace, + xmlns + ); + } + ); + } else if (Objects.equals(settings.getProtocol(), AwsQueryTrait.ID)) { + return MapUtils.of( + "protocol", writer -> { + writer.addImportSubmodule( + "AwsQueryProtocol", null, + AwsDependency.AWS_SDK_CORE, "/protocols"); + writer.write( + """ + new AwsQueryProtocol({ + defaultNamespace: $S, + xmlNamespace: $S, + version: $S + })""", + namespace, + xmlns, + settings.getService(model).getVersion() + ); + } + ); + } else if (Objects.equals(settings.getProtocol(), Ec2QueryTrait.ID)) { + return MapUtils.of( + "protocol", writer -> { + writer.addImportSubmodule( + "AwsEc2QueryProtocol", null, + AwsDependency.AWS_SDK_CORE, "/protocols"); + writer.write( + """ + new AwsEc2QueryProtocol({ + defaultNamespace: $S, + xmlNamespace: $S, + version: $S + })""", + namespace, + xmlns, + settings.getService(model).getVersion() + ); + } + ); + } else if (Objects.equals(settings.getProtocol(), RestJson1Trait.ID)) { + return MapUtils.of( + "protocol", writer -> { + writer.addImportSubmodule( + "AwsRestJsonProtocol", null, + AwsDependency.AWS_SDK_CORE, "/protocols"); + writer.write("new AwsRestJsonProtocol({ defaultNamespace: $S })", namespace); + } + ); + } else if (Objects.equals(settings.getProtocol(), AwsJson1_0Trait.ID)) { + return MapUtils.of( + "protocol", writer -> { + writer.addImportSubmodule( + "AwsJson1_0Protocol", null, + AwsDependency.AWS_SDK_CORE, "/protocols"); + writer.write("new AwsJson1_0Protocol({ defaultNamespace: $S })", namespace); + } + ); + } else if (Objects.equals(settings.getProtocol(), AwsJson1_1Trait.ID)) { + return MapUtils.of( + "protocol", writer -> { + writer.addImportSubmodule( + "AwsJson1_1Protocol", null, + AwsDependency.AWS_SDK_CORE, "/protocols"); + writer.write("new AwsJson1_1Protocol({ defaultNamespace: $S })", namespace); + } + ); + } + case BROWSER: + case NODE: + default: + return Collections.emptyMap(); + } + } +} diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java index dd3534205ec33..87c7e67754185 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java @@ -16,6 +16,7 @@ package software.amazon.smithy.aws.typescript.codegen; import java.util.Set; +import software.amazon.smithy.aws.traits.protocols.Ec2QueryNameTrait; import software.amazon.smithy.aws.traits.protocols.Ec2QueryTrait; import software.amazon.smithy.codegen.core.SymbolReference; import software.amazon.smithy.model.shapes.OperationShape; @@ -24,8 +25,10 @@ import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.traits.TimestampFormatTrait.Format; +import software.amazon.smithy.model.traits.Trait; import software.amazon.smithy.typescript.codegen.TypeScriptWriter; import software.amazon.smithy.typescript.codegen.integration.HttpRpcProtocolGenerator; +import software.amazon.smithy.typescript.codegen.schema.SchemaTraitExtension; import software.amazon.smithy.typescript.codegen.util.StringStore; import software.amazon.smithy.utils.SmithyInternalApi; @@ -47,6 +50,19 @@ */ @SmithyInternalApi final class AwsEc2 extends HttpRpcProtocolGenerator { + static { + SchemaTraitExtension.INSTANCE.add( + Ec2QueryNameTrait.ID, + (Trait trait) -> { + if (trait instanceof Ec2QueryNameTrait ec2QueryName) { + return """ + `%s` + """.formatted(ec2QueryName.getValue()); + } + return ""; + } + ); + } AwsEc2() { super(true); diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java index 5632010ae91bc..1d5b84dbd1cdc 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java @@ -28,8 +28,10 @@ import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.traits.TimestampFormatTrait.Format; +import software.amazon.smithy.model.traits.Trait; import software.amazon.smithy.typescript.codegen.TypeScriptWriter; import software.amazon.smithy.typescript.codegen.integration.HttpRpcProtocolGenerator; +import software.amazon.smithy.typescript.codegen.schema.SchemaTraitExtension; import software.amazon.smithy.typescript.codegen.util.StringStore; import software.amazon.smithy.utils.SmithyInternalApi; @@ -50,6 +52,21 @@ */ @SmithyInternalApi final class AwsQuery extends HttpRpcProtocolGenerator { + static { + SchemaTraitExtension.INSTANCE.add( + AwsQueryErrorTrait.ID, + (Trait trait) -> { + if (trait instanceof AwsQueryErrorTrait awsQueryError) { + return """ + [`%s`, %s]""".formatted( + awsQueryError.getCode(), + awsQueryError.getHttpResponseCode() + ); + } + return ""; + } + ); + } AwsQuery() { // AWS Query protocols will attempt to parse error codes from response bodies. diff --git a/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration b/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration index 55b9da53abf1d..3d66c3fc046b3 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration +++ b/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration @@ -12,6 +12,7 @@ software.amazon.smithy.aws.typescript.codegen.AwsServiceIdIntegration software.amazon.smithy.aws.typescript.codegen.AwsPackageFixturesGeneratorIntegration software.amazon.smithy.aws.typescript.codegen.AddSqsDependency software.amazon.smithy.aws.typescript.codegen.AddBodyChecksumGeneratorDependency +software.amazon.smithy.aws.typescript.codegen.AddProtocolConfig software.amazon.smithy.aws.typescript.codegen.AddS3Config software.amazon.smithy.aws.typescript.codegen.AddS3ControlDependency software.amazon.smithy.aws.typescript.codegen.AddEventStreamHandlingDependency diff --git a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/endpoints.json b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/endpoints.json index c312e279ce478..6401e779a5e89 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/endpoints.json +++ b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/endpoints.json @@ -43753,11 +43753,6 @@ "us-isob-east-1": {} } }, - "athena": { - "endpoints": { - "us-isob-east-1": {} - } - }, "autoscaling": { "defaults": { "protocols": ["http", "https"] @@ -44125,11 +44120,6 @@ } } }, - "lakeformation": { - "endpoints": { - "us-isob-east-1": {} - } - }, "lambda": { "endpoints": { "us-isob-east-1": {} @@ -44914,11 +44904,6 @@ } } }, - "license-manager": { - "endpoints": { - "eu-isoe-west-1": {} - } - }, "logs": { "endpoints": { "eu-isoe-west-1": {} diff --git a/packages/core/src/submodules/protocols/json/AwsJsonRpcProtocol.ts b/packages/core/src/submodules/protocols/json/AwsJsonRpcProtocol.ts index b37599d5dab7b..9da3b0f121701 100644 --- a/packages/core/src/submodules/protocols/json/AwsJsonRpcProtocol.ts +++ b/packages/core/src/submodules/protocols/json/AwsJsonRpcProtocol.ts @@ -90,7 +90,7 @@ export abstract class AwsJsonRpcProtocol extends RpcProtocol { try { errorSchema = registry.getSchema(errorIdentifier) as ErrorSchema; } catch (e) { - const baseExceptionSchema = TypeRegistry.for("awssdkjs.synthetic." + namespace).getBaseException(); + const baseExceptionSchema = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace).getBaseException(); if (baseExceptionSchema) { const ErrorCtor = baseExceptionSchema.ctor; throw Object.assign(new ErrorCtor(errorName), dataObject); diff --git a/packages/core/src/submodules/protocols/json/AwsRestJsonProtocol.ts b/packages/core/src/submodules/protocols/json/AwsRestJsonProtocol.ts index b6375cdf75712..0d9ba1fe9cf63 100644 --- a/packages/core/src/submodules/protocols/json/AwsRestJsonProtocol.ts +++ b/packages/core/src/submodules/protocols/json/AwsRestJsonProtocol.ts @@ -128,7 +128,7 @@ export class AwsRestJsonProtocol extends HttpBindingProtocol { try { errorSchema = registry.getSchema(errorIdentifier) as ErrorSchema; } catch (e) { - const baseExceptionSchema = TypeRegistry.for("awssdkjs.synthetic." + namespace).getBaseException(); + const baseExceptionSchema = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace).getBaseException(); if (baseExceptionSchema) { const ErrorCtor = baseExceptionSchema.ctor; throw Object.assign(new ErrorCtor(errorName), dataObject); diff --git a/packages/core/src/submodules/protocols/json/JsonCodec.ts b/packages/core/src/submodules/protocols/json/JsonCodec.ts index 9f5ae0064ffad..38d085035379b 100644 --- a/packages/core/src/submodules/protocols/json/JsonCodec.ts +++ b/packages/core/src/submodules/protocols/json/JsonCodec.ts @@ -15,7 +15,7 @@ export type JsonSettings = CodecSettings & { * @public */ export class JsonCodec extends SerdeContextConfig implements Codec { - public constructor(public settings: JsonSettings) { + public constructor(public readonly settings: JsonSettings) { super(); } diff --git a/packages/core/src/submodules/protocols/json/JsonShapeDeserializer.ts b/packages/core/src/submodules/protocols/json/JsonShapeDeserializer.ts index e75bea4be6b2b..9a2bd4144daff 100644 --- a/packages/core/src/submodules/protocols/json/JsonShapeDeserializer.ts +++ b/packages/core/src/submodules/protocols/json/JsonShapeDeserializer.ts @@ -18,7 +18,7 @@ import { parseJsonBody } from "./parseJsonBody"; * @alpha */ export class JsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer { - public constructor(public settings: JsonSettings) { + public constructor(public readonly settings: JsonSettings) { super(); } diff --git a/packages/core/src/submodules/protocols/json/JsonShapeSerializer.ts b/packages/core/src/submodules/protocols/json/JsonShapeSerializer.ts index e9e558f38bce4..a7c2316a48150 100644 --- a/packages/core/src/submodules/protocols/json/JsonShapeSerializer.ts +++ b/packages/core/src/submodules/protocols/json/JsonShapeSerializer.ts @@ -14,7 +14,7 @@ export class JsonShapeSerializer extends SerdeContextConfig implements ShapeSeri private buffer: any; private rootSchema: NormalizedSchema | undefined; - public constructor(public settings: JsonSettings) { + public constructor(public readonly settings: JsonSettings) { super(); } diff --git a/packages/core/src/submodules/protocols/query/AwsEc2QueryProtocol.ts b/packages/core/src/submodules/protocols/query/AwsEc2QueryProtocol.ts index aad6a5ba530d1..7a06cad460c05 100644 --- a/packages/core/src/submodules/protocols/query/AwsEc2QueryProtocol.ts +++ b/packages/core/src/submodules/protocols/query/AwsEc2QueryProtocol.ts @@ -1,6 +1,30 @@ import { AwsQueryProtocol } from "./AwsQueryProtocol"; +import { QuerySerializerSettings } from "./QuerySerializerSettings"; /** * @alpha */ -export class AwsEc2QueryProtocol extends AwsQueryProtocol {} +export class AwsEc2QueryProtocol extends AwsQueryProtocol { + public constructor( + public options: { + defaultNamespace: string; + xmlNamespace: string; + version: string; + } + ) { + super(options); + const ec2Settings: Partial = { + capitalizeKeys: true, + flattenLists: true, + serializeEmptyLists: false, + }; + Object.assign(this.serializer.settings, ec2Settings); + } + + /** + * EC2 Query reads XResponse.XResult instead of XResponse directly. + */ + protected useNestedResult(): boolean { + return false; + } +} diff --git a/packages/core/src/submodules/protocols/query/AwsQueryProtocol.ts b/packages/core/src/submodules/protocols/query/AwsQueryProtocol.ts index 70231130c1606..ec47aa7f166f3 100644 --- a/packages/core/src/submodules/protocols/query/AwsQueryProtocol.ts +++ b/packages/core/src/submodules/protocols/query/AwsQueryProtocol.ts @@ -41,6 +41,7 @@ export class AwsQueryProtocol extends RpcProtocol { httpBindings: false, xmlNamespace: options.xmlNamespace, serviceNamespace: options.defaultNamespace, + serializeEmptyLists: true, }; this.serializer = new QueryShapeSerializer(settings); this.deserializer = new XmlShapeDeserializer(settings); @@ -109,7 +110,8 @@ export class AwsQueryProtocol extends RpcProtocol { response.headers[header.toLowerCase()] = value; } - const awsQueryResultKey = ns.isStructSchema() ? operationSchema.name.split("#")[1] + "Result" : undefined; + const awsQueryResultKey = + ns.isStructSchema() && this.useNestedResult() ? operationSchema.name.split("#")[1] + "Result" : undefined; const bytes: Uint8Array = await collectBody(response.body, context as SerdeFunctions); if (bytes.byteLength > 0) { Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey)); @@ -123,6 +125,13 @@ export class AwsQueryProtocol extends RpcProtocol { return output; } + /** + * EC2 Query overrides this. + */ + protected useNestedResult(): boolean { + return true; + } + protected async handleError( operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, @@ -137,6 +146,8 @@ export class AwsQueryProtocol extends RpcProtocol { [namespace, errorName] = errorIdentifier.split("#"); } + const errorDataSource = this.loadQueryError(dataObject); + const registry = TypeRegistry.for(namespace); let errorSchema: ErrorSchema; @@ -148,23 +159,23 @@ export class AwsQueryProtocol extends RpcProtocol { errorSchema = registry.getSchema(errorIdentifier) as ErrorSchema; } } catch (e) { - const baseExceptionSchema = TypeRegistry.for("awssdkjs.synthetic." + namespace).getBaseException(); + const baseExceptionSchema = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace).getBaseException(); if (baseExceptionSchema) { const ErrorCtor = baseExceptionSchema.ctor; - throw Object.assign(new ErrorCtor(errorName), dataObject); + throw Object.assign(new ErrorCtor(errorName), errorDataSource); } throw new Error(errorName); } const ns = NormalizedSchema.of(errorSchema); - const message = - dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; + const message = this.loadQueryErrorMessage(dataObject); const exception = new errorSchema.ctor(message); const output = {} as any; + for (const [name, member] of ns.structIterator()) { const target = member.getMergedTraits().xmlName ?? name; - const value = dataObject.Error?.[target] ?? dataObject[target]; + const value = errorDataSource[target] ?? dataObject[target]; output[name] = this.deserializer.readSchema(member, value); } @@ -179,12 +190,26 @@ export class AwsQueryProtocol extends RpcProtocol { throw exception; } + /** + * The variations in the error and error message locations are attributed to + * divergence between AWS Query and EC2 Query behavior. + */ protected loadQueryErrorCode(output: IHttpResponse, data: any): string | undefined { - if (data.Error?.Code !== undefined) { - return data.Error.Code; + const code = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code; + if (code !== undefined) { + return code; } if (output.statusCode == 404) { return "NotFound"; } } + + protected loadQueryError(data: any): any | undefined { + return data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error; + } + + protected loadQueryErrorMessage(data: any): string { + const errorData = this.loadQueryError(data); + return errorData?.message ?? errorData?.Message ?? data.message ?? data.Message ?? "Unknown"; + } } diff --git a/packages/core/src/submodules/protocols/query/QuerySerializerSettings.ts b/packages/core/src/submodules/protocols/query/QuerySerializerSettings.ts new file mode 100644 index 0000000000000..88dd858612d40 --- /dev/null +++ b/packages/core/src/submodules/protocols/query/QuerySerializerSettings.ts @@ -0,0 +1,7 @@ +import { CodecSettings } from "@smithy/types"; + +export type QuerySerializerSettings = CodecSettings & { + capitalizeKeys?: boolean; + flattenLists?: boolean; + serializeEmptyLists?: boolean; +}; diff --git a/packages/core/src/submodules/protocols/query/QueryShapeSerializer.ts b/packages/core/src/submodules/protocols/query/QueryShapeSerializer.ts index 45903eb0128ce..2ad004f23fe30 100644 --- a/packages/core/src/submodules/protocols/query/QueryShapeSerializer.ts +++ b/packages/core/src/submodules/protocols/query/QueryShapeSerializer.ts @@ -2,10 +2,11 @@ import { determineTimestampFormat, extendedEncodeURIComponent } from "@smithy/co import { NormalizedSchema, SCHEMA } from "@smithy/core/schema"; import { NumericValue } from "@smithy/core/serde"; import { dateToUtcString } from "@smithy/smithy-client"; -import type { CodecSettings, Schema, ShapeSerializer } from "@smithy/types"; +import type { Schema, ShapeSerializer } from "@smithy/types"; import { toBase64 } from "@smithy/util-base64"; import { SerdeContextConfig } from "../ConfigurableSerdeContext"; +import type { QuerySerializerSettings } from "./QuerySerializerSettings"; /** * @alpha @@ -13,7 +14,7 @@ import { SerdeContextConfig } from "../ConfigurableSerdeContext"; export class QueryShapeSerializer extends SerdeContextConfig implements ShapeSerializer { private buffer: string | undefined; - public constructor(private settings: CodecSettings) { + public constructor(public readonly settings: QuerySerializerSettings) { super(); } @@ -67,17 +68,19 @@ export class QueryShapeSerializer extends SerdeContextConfig implements ShapeSer } else if (ns.isListSchema()) { if (Array.isArray(value)) { if (value.length === 0) { - this.writeKey(prefix); - this.writeValue(""); + if (this.settings.serializeEmptyLists) { + this.writeKey(prefix); + this.writeValue(""); + } } else { const member = ns.getValueSchema(); - const flat = ns.getMergedTraits().xmlFlattened; + const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened; let i = 1; for (const item of value) { if (item == null) { continue; } - const suffix = member.getMergedTraits().xmlName ?? "member"; + const suffix = this.getKey("member", member.getMergedTraits().xmlName); const key = flat ? `${prefix}${i}` : `${prefix}${suffix}.${i}`; this.write(member, item, key); ++i; @@ -94,10 +97,10 @@ export class QueryShapeSerializer extends SerdeContextConfig implements ShapeSer if (v == null) { continue; } - const keySuffix = keySchema.getMergedTraits().xmlName ?? "key"; + const keySuffix = this.getKey("key", keySchema.getMergedTraits().xmlName); const key = flat ? `${prefix}${i}.${keySuffix}` : `${prefix}entry.${i}.${keySuffix}`; - const valueSuffix = memberSchema.getMergedTraits().xmlName ?? "value"; + const valueSuffix = this.getKey("value", memberSchema.getMergedTraits().xmlName); const valueKey = flat ? `${prefix}${i}.${valueSuffix}` : `${prefix}entry.${i}.${valueSuffix}`; this.write(keySchema, k, key); @@ -111,7 +114,7 @@ export class QueryShapeSerializer extends SerdeContextConfig implements ShapeSer if ((value as any)[memberName] == null) { continue; } - const suffix = member.getMergedTraits().xmlName ?? memberName; + const suffix = this.getKey(memberName, member.getMergedTraits().xmlName); const key = `${prefix}${suffix}`; this.write(member, (value as any)[memberName], key); } @@ -131,6 +134,14 @@ export class QueryShapeSerializer extends SerdeContextConfig implements ShapeSer return str; } + protected getKey(memberName: string, xmlName?: string): string { + const key = xmlName ?? memberName; + if (this.settings.capitalizeKeys) { + return key[0].toUpperCase() + key.slice(1); + } + return key; + } + protected writeKey(key: string) { if (key.endsWith(".")) { key = key.slice(0, key.length - 1); diff --git a/packages/core/src/submodules/protocols/xml/AwsRestXmlProtocol.ts b/packages/core/src/submodules/protocols/xml/AwsRestXmlProtocol.ts index e5a82f080e0ba..8f3465da98571 100644 --- a/packages/core/src/submodules/protocols/xml/AwsRestXmlProtocol.ts +++ b/packages/core/src/submodules/protocols/xml/AwsRestXmlProtocol.ts @@ -141,7 +141,7 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol { try { errorSchema = registry.getSchema(errorIdentifier) as ErrorSchema; } catch (e) { - const baseExceptionSchema = TypeRegistry.for("awssdkjs.synthetic." + namespace).getBaseException(); + const baseExceptionSchema = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace).getBaseException(); if (baseExceptionSchema) { const ErrorCtor = baseExceptionSchema.ctor; throw Object.assign(new ErrorCtor(errorName), dataObject); diff --git a/private/aws-protocoltests-ec2-schema/.gitignore b/private/aws-protocoltests-ec2-schema/.gitignore new file mode 100644 index 0000000000000..54f14c9aef253 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/private/aws-protocoltests-ec2-schema/LICENSE b/private/aws-protocoltests-ec2-schema/LICENSE new file mode 100644 index 0000000000000..ba9d6d1526906 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/private/aws-protocoltests-ec2-schema/README.md b/private/aws-protocoltests-ec2-schema/README.md new file mode 100644 index 0000000000000..5e7dee0a8d617 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/README.md @@ -0,0 +1,2565 @@ + + +# @aws-sdk/aws-protocoltests-ec2-schema + +## Description + +AWS SDK for JavaScript EC2Protocol Client for Node.js, Browser and React Native. + +An EC2 query service that sends query requests and XML responses. + +## Installing + +To install this package, simply type add or install @aws-sdk/aws-protocoltests-ec2-schema +using your favorite package manager: + +- `npm install @aws-sdk/aws-protocoltests-ec2-schema` +- `yarn add @aws-sdk/aws-protocoltests-ec2-schema` +- `pnpm add @aws-sdk/aws-protocoltests-ec2-schema` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EC2ProtocolClient` and +the commands you need, for example `QueryListsCommand`: + +```js +// ES5 example +const { EC2ProtocolClient, QueryListsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); +``` + +```ts +// ES6+ example +import { EC2ProtocolClient, QueryListsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new EC2ProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new QueryListsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-protocoltests-ec2-schema"; +const client = new AWS.EC2Protocol({ region: "REGION" }); + +// async/await. +try { + const data = await client.queryLists(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .queryLists(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.queryLists(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-protocoltests-ec2-schema` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EmptyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyOperationCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +KitchenSinkOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/KitchenSinkOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/KitchenSinkOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/KitchenSinkOperationCommandOutput/) + +
+
+ +NullOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NullOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullOperationCommandOutput/) + +
+
+ +OperationWithOptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithOptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithOptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithOptionalInputOutputCommandOutput/) + +
+
+ +PutAndGetInlineDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PutAndGetInlineDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutAndGetInlineDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutAndGetInlineDocumentsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseNullsOperationCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +OperationWithRequiredMembers + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithRequiredMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithRequiredMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithRequiredMembersCommandOutput/) + +
+
+ +OperationWithRequiredMembersWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithRequiredMembersWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +AcceptHeaderStarService + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/AcceptHeaderStarServiceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/AcceptHeaderStarServiceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/AcceptHeaderStarServiceCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryMapsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +DocumentType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DocumentTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DocumentTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DocumentTypeCommandOutput/) + +
+
+ +DocumentTypeAsMapValue + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DocumentTypeAsMapValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DocumentTypeAsMapValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DocumentTypeAsMapValueCommandOutput/) + +
+
+ +DocumentTypeAsPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DocumentTypeAsPayloadCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +HttpChecksumRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpChecksumRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpChecksumRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpChecksumRequiredCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpPrefixHeadersInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPrefixHeadersInResponseCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpRequestWithRegexLiteral + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithRegexLiteralCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithRegexLiteralCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithRegexLiteralCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +JsonBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonBlobsCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonListsCommandOutput/) + +
+
+ +JsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonMapsCommandOutput/) + +
+
+ +JsonTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonTimestampsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +MalformedAcceptWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedAcceptWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedAcceptWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedAcceptWithBodyCommandOutput/) + +
+
+ +MalformedAcceptWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedAcceptWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedAcceptWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedAcceptWithGenericStringCommandOutput/) + +
+
+ +MalformedAcceptWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedAcceptWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedAcceptWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedAcceptWithPayloadCommandOutput/) + +
+
+ +MalformedBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedBlobCommandOutput/) + +
+
+ +MalformedBoolean + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedBooleanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedBooleanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedBooleanCommandOutput/) + +
+
+ +MalformedByte + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedByteCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedByteCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedByteCommandOutput/) + +
+
+ +MalformedContentTypeWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedContentTypeWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedContentTypeWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithGenericStringCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedContentTypeWithoutBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithoutBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithoutBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBodyEmptyInput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedContentTypeWithoutBodyEmptyInputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandOutput/) + +
+
+ +MalformedContentTypeWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedContentTypeWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedContentTypeWithPayloadCommandOutput/) + +
+
+ +MalformedDouble + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedDoubleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedDoubleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedDoubleCommandOutput/) + +
+
+ +MalformedFloat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedFloatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedFloatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedFloatCommandOutput/) + +
+
+ +MalformedInteger + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedIntegerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedIntegerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedIntegerCommandOutput/) + +
+
+ +MalformedList + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedListCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedListCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedListCommandOutput/) + +
+
+ +MalformedLong + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedLongCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLongCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLongCommandOutput/) + +
+
+ +MalformedMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedMapCommandOutput/) + +
+
+ +MalformedRequestBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedRequestBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRequestBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRequestBodyCommandOutput/) + +
+
+ +MalformedShort + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedShortCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedShortCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedShortCommandOutput/) + +
+
+ +MalformedString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedStringCommandOutput/) + +
+
+ +MalformedTimestampBodyDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampBodyDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampBodyDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampBodyDateTimeCommandOutput/) + +
+
+ +MalformedTimestampBodyDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampBodyDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampBodyDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampBodyDefaultCommandOutput/) + +
+
+ +MalformedTimestampBodyHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampBodyHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampBodyHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampBodyHttpDateCommandOutput/) + +
+
+ +MalformedTimestampHeaderDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampHeaderDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampHeaderDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampHeaderDateTimeCommandOutput/) + +
+
+ +MalformedTimestampHeaderDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampHeaderDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampHeaderDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampHeaderDefaultCommandOutput/) + +
+
+ +MalformedTimestampHeaderEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampHeaderEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampHeaderEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampHeaderEpochCommandOutput/) + +
+
+ +MalformedTimestampPathDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampPathDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampPathDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampPathDefaultCommandOutput/) + +
+
+ +MalformedTimestampPathEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampPathEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampPathEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampPathEpochCommandOutput/) + +
+
+ +MalformedTimestampPathHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampPathHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampPathHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampPathHttpDateCommandOutput/) + +
+
+ +MalformedTimestampQueryDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampQueryDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampQueryDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampQueryDefaultCommandOutput/) + +
+
+ +MalformedTimestampQueryEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampQueryEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampQueryEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampQueryEpochCommandOutput/) + +
+
+ +MalformedTimestampQueryHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedTimestampQueryHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampQueryHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedTimestampQueryHttpDateCommandOutput/) + +
+
+ +MalformedUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedUnionCommandOutput/) + +
+
+ +MediaTypeHeader + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MediaTypeHeaderCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MediaTypeHeaderCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MediaTypeHeaderCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +OmitsSerializingEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OmitsSerializingEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OmitsSerializingEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OmitsSerializingEmptyListsCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +PostPlayerAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PostPlayerActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PostPlayerActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PostPlayerActionCommandOutput/) + +
+
+ +PostUnionWithJsonName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PostUnionWithJsonNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PostUnionWithJsonNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PostUnionWithJsonNameCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +ResponseCodeHttpFallback + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ResponseCodeHttpFallbackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ResponseCodeHttpFallbackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ResponseCodeHttpFallbackCommandOutput/) + +
+
+ +ResponseCodeRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ResponseCodeRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ResponseCodeRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ResponseCodeRequiredCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseJsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SparseJsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseJsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseJsonListsCommandOutput/) + +
+
+ +SparseJsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SparseJsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseJsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseJsonMapsCommandOutput/) + +
+
+ +StreamingTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/StreamingTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/StreamingTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/StreamingTraitsCommandOutput/) + +
+
+ +StreamingTraitsRequireLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/StreamingTraitsRequireLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/StreamingTraitsRequireLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/StreamingTraitsRequireLengthCommandOutput/) + +
+
+ +StreamingTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/StreamingTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/StreamingTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/StreamingTraitsWithMediaTypeCommandOutput/) + +
+
+ +TestBodyStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TestBodyStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestBodyStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestBodyStructureCommandOutput/) + +
+
+ +TestGetNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TestGetNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestGetNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestGetNoInputNoPayloadCommandOutput/) + +
+
+ +TestGetNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TestGetNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestGetNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestGetNoPayloadCommandOutput/) + +
+
+ +TestPayloadBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TestPayloadBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPayloadBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPayloadBlobCommandOutput/) + +
+
+ +TestPayloadStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TestPayloadStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPayloadStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPayloadStructureCommandOutput/) + +
+
+ +TestPostNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TestPostNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPostNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPostNoInputNoPayloadCommandOutput/) + +
+
+ +TestPostNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TestPostNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPostNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TestPostNoPayloadCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +UnitInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/UnitInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/UnitInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/UnitInputAndOutputCommandOutput/) + +
+
+ +MalformedEnum + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedEnumCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedEnumCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedEnumCommandOutput/) + +
+
+ +MalformedLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLengthCommandOutput/) + +
+
+ +MalformedLengthOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedLengthOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLengthOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLengthOverrideCommandOutput/) + +
+
+ +MalformedLengthQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedLengthQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLengthQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedLengthQueryStringCommandOutput/) + +
+
+ +MalformedPattern + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedPatternCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedPatternCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedPatternCommandOutput/) + +
+
+ +MalformedPatternOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedPatternOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedPatternOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedPatternOverrideCommandOutput/) + +
+
+ +MalformedRange + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedRangeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRangeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRangeCommandOutput/) + +
+
+ +MalformedRangeOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedRangeOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRangeOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRangeOverrideCommandOutput/) + +
+
+ +MalformedRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedRequiredCommandOutput/) + +
+
+ +MalformedUniqueItems + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/MalformedUniqueItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedUniqueItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/MalformedUniqueItemsCommandOutput/) + +
+
+ +RecursiveStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RecursiveStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveStructuresCommandOutput/) + +
+
+ +SensitiveValidation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SensitiveValidationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SensitiveValidationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SensitiveValidationCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +BodyWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/BodyWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/BodyWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/BodyWithXmlNameCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelHeaderOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointWithHostLabelHeaderOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithMemberXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithMemberXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithMemberXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithMemberXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPayloadWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithXmlNamespaceCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespaceAndPrefix + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPayloadWithXmlNamespaceAndPrefixCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +NestedXmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NestedXmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedXmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedXmlMapsCommandOutput/) + +
+
+ +NestedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NestedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NestedXmlMapWithXmlNameCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +XmlAttributes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlAttributesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlAttributesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlAttributesCommandOutput/) + +
+
+ +XmlAttributesOnPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlAttributesOnPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlAttributesOnPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlAttributesOnPayloadCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEmptyStrings + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEmptyStringsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyStringsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEmptyStringsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +XmlUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/XmlUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/XmlUnionsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +GetRestApis + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GetRestApisCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GetRestApisCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GetRestApisCommandOutput/) + +
+
+ +UploadArchive + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/UploadArchiveCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/UploadArchiveCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/UploadArchiveCommandOutput/) + +
+
+ +UploadMultipartPart + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/UploadMultipartPartCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/UploadMultipartPartCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/UploadMultipartPartCommandOutput/) + +
+
+ +Predict + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/PredictCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PredictCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/PredictCommandOutput/) + +
+
+ +DeleteObjectTagging + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DeleteObjectTaggingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DeleteObjectTaggingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DeleteObjectTaggingCommandOutput/) + +
+
+ +GetBucketLocation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GetBucketLocationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GetBucketLocationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GetBucketLocationCommandOutput/) + +
+
+ +GetObject + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GetObjectCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GetObjectCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GetObjectCommandOutput/) + +
+
+ +ListObjectsV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/ListObjectsV2Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ListObjectsV2CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/ListObjectsV2CommandOutput/) + +
+
+ +EmptyInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/EmptyInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/EmptyInputOutputCommandOutput/) + +
+
+ +Float16 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/Float16Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/Float16CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/Float16CommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +NoInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/NoInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/NoInputOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OptionalInputOutputCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +RpcV2CborDenseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RpcV2CborDenseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RpcV2CborDenseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RpcV2CborDenseMapsCommandOutput/) + +
+
+ +RpcV2CborLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RpcV2CborListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RpcV2CborListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RpcV2CborListsCommandOutput/) + +
+
+ +RpcV2CborSparseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/RpcV2CborSparseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RpcV2CborSparseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/RpcV2CborSparseMapsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/SparseNullsOperationCommandOutput/) + +
diff --git a/private/aws-protocoltests-ec2-schema/api-extractor.json b/private/aws-protocoltests-ec2-schema/api-extractor.json new file mode 100644 index 0000000000000..d5bf5ffeee851 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/private/aws-protocoltests-ec2-schema/package.json b/private/aws-protocoltests-ec2-schema/package.json new file mode 100644 index 0000000000000..4c97a8b9fd6c5 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/package.json @@ -0,0 +1,104 @@ +{ + "name": "@aws-sdk/aws-protocoltests-ec2-schema", + "description": "@aws-sdk/aws-protocoltests-ec2-schema client", + "version": "1.0.0-alpha.1", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "test": "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.5.2", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-compression": "^4.1.10", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.10", + "@smithy/middleware-retry": "^4.1.11", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.2", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.18", + "@smithy/util-defaults-mode-node": "^4.0.18", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "@smithy/util-utf8": "^4.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@tsconfig/node18": "18.2.4", + "@types/node": "^18.19.69", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~5.8.3", + "vitest": "2.1.8" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "private": true, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-protocoltests-ec2-schema", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/aws-protocoltests-ec2-schema" + } +} diff --git a/private/aws-protocoltests-ec2-schema/src/EC2Protocol.ts b/private/aws-protocoltests-ec2-schema/src/EC2Protocol.ts new file mode 100644 index 0000000000000..399f075a350da --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/EC2Protocol.ts @@ -0,0 +1,536 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + DatetimeOffsetsCommand, + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, +} from "./commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommand, + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { + EndpointOperationCommand, + EndpointOperationCommandInput, + EndpointOperationCommandOutput, +} from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommand, + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { + FractionalSecondsCommand, + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, +} from "./commands/FractionalSecondsCommand"; +import { + GreetingWithErrorsCommand, + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, +} from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommand, + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { + IgnoresWrappingXmlNameCommand, + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, +} from "./commands/IgnoresWrappingXmlNameCommand"; +import { + NestedStructuresCommand, + NestedStructuresCommandInput, + NestedStructuresCommandOutput, +} from "./commands/NestedStructuresCommand"; +import { + NoInputAndOutputCommand, + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, +} from "./commands/NoInputAndOutputCommand"; +import { + PutWithContentEncodingCommand, + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommand, + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommand, QueryListsCommandInput, QueryListsCommandOutput } from "./commands/QueryListsCommand"; +import { + QueryTimestampsCommand, + QueryTimestampsCommandInput, + QueryTimestampsCommandOutput, +} from "./commands/QueryTimestampsCommand"; +import { + RecursiveXmlShapesCommand, + RecursiveXmlShapesCommandInput, + RecursiveXmlShapesCommandOutput, +} from "./commands/RecursiveXmlShapesCommand"; +import { + SimpleInputParamsCommand, + SimpleInputParamsCommandInput, + SimpleInputParamsCommandOutput, +} from "./commands/SimpleInputParamsCommand"; +import { + SimpleScalarXmlPropertiesCommand, + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, +} from "./commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommand, XmlBlobsCommandInput, XmlBlobsCommandOutput } from "./commands/XmlBlobsCommand"; +import { + XmlEmptyBlobsCommand, + XmlEmptyBlobsCommandInput, + XmlEmptyBlobsCommandOutput, +} from "./commands/XmlEmptyBlobsCommand"; +import { + XmlEmptyListsCommand, + XmlEmptyListsCommandInput, + XmlEmptyListsCommandOutput, +} from "./commands/XmlEmptyListsCommand"; +import { XmlEnumsCommand, XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand"; +import { XmlIntEnumsCommand, XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand"; +import { XmlListsCommand, XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand"; +import { + XmlNamespacesCommand, + XmlNamespacesCommandInput, + XmlNamespacesCommandOutput, +} from "./commands/XmlNamespacesCommand"; +import { + XmlTimestampsCommand, + XmlTimestampsCommandInput, + XmlTimestampsCommandOutput, +} from "./commands/XmlTimestampsCommand"; +import { EC2ProtocolClient, EC2ProtocolClientConfig } from "./EC2ProtocolClient"; + +const commands = { + DatetimeOffsetsCommand, + EmptyInputAndEmptyOutputCommand, + EndpointOperationCommand, + EndpointWithHostLabelOperationCommand, + FractionalSecondsCommand, + GreetingWithErrorsCommand, + HostWithPathOperationCommand, + IgnoresWrappingXmlNameCommand, + NestedStructuresCommand, + NoInputAndOutputCommand, + PutWithContentEncodingCommand, + QueryIdempotencyTokenAutoFillCommand, + QueryListsCommand, + QueryTimestampsCommand, + RecursiveXmlShapesCommand, + SimpleInputParamsCommand, + SimpleScalarXmlPropertiesCommand, + XmlBlobsCommand, + XmlEmptyBlobsCommand, + XmlEmptyListsCommand, + XmlEnumsCommand, + XmlIntEnumsCommand, + XmlListsCommand, + XmlNamespacesCommand, + XmlTimestampsCommand, +}; + +export interface EC2Protocol { + /** + * @see {@link DatetimeOffsetsCommand} + */ + datetimeOffsets(): Promise; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + datetimeOffsets(args: DatetimeOffsetsCommandInput, cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void): void; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void + ): void; + + /** + * @see {@link EmptyInputAndEmptyOutputCommand} + */ + emptyInputAndEmptyOutput(): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + + /** + * @see {@link EndpointOperationCommand} + */ + endpointOperation(): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + endpointOperation( + args: EndpointOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointWithHostLabelOperationCommand} + */ + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + + /** + * @see {@link FractionalSecondsCommand} + */ + fractionalSeconds(): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + + /** + * @see {@link GreetingWithErrorsCommand} + */ + greetingWithErrors(): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + + /** + * @see {@link HostWithPathOperationCommand} + */ + hostWithPathOperation(): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + + /** + * @see {@link IgnoresWrappingXmlNameCommand} + */ + ignoresWrappingXmlName(): Promise; + ignoresWrappingXmlName( + args: IgnoresWrappingXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + ignoresWrappingXmlName( + args: IgnoresWrappingXmlNameCommandInput, + cb: (err: any, data?: IgnoresWrappingXmlNameCommandOutput) => void + ): void; + ignoresWrappingXmlName( + args: IgnoresWrappingXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: IgnoresWrappingXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link NestedStructuresCommand} + */ + nestedStructures(): Promise; + nestedStructures( + args: NestedStructuresCommandInput, + options?: __HttpHandlerOptions + ): Promise; + nestedStructures( + args: NestedStructuresCommandInput, + cb: (err: any, data?: NestedStructuresCommandOutput) => void + ): void; + nestedStructures( + args: NestedStructuresCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NestedStructuresCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndOutputCommand} + */ + noInputAndOutput(): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + + /** + * @see {@link PutWithContentEncodingCommand} + */ + putWithContentEncoding(): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + + /** + * @see {@link QueryIdempotencyTokenAutoFillCommand} + */ + queryIdempotencyTokenAutoFill(): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + + /** + * @see {@link QueryListsCommand} + */ + queryLists(): Promise; + queryLists(args: QueryListsCommandInput, options?: __HttpHandlerOptions): Promise; + queryLists(args: QueryListsCommandInput, cb: (err: any, data?: QueryListsCommandOutput) => void): void; + queryLists( + args: QueryListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryListsCommandOutput) => void + ): void; + + /** + * @see {@link QueryTimestampsCommand} + */ + queryTimestamps(): Promise; + queryTimestamps( + args: QueryTimestampsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryTimestamps(args: QueryTimestampsCommandInput, cb: (err: any, data?: QueryTimestampsCommandOutput) => void): void; + queryTimestamps( + args: QueryTimestampsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryTimestampsCommandOutput) => void + ): void; + + /** + * @see {@link RecursiveXmlShapesCommand} + */ + recursiveXmlShapes(): Promise; + recursiveXmlShapes( + args: RecursiveXmlShapesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + recursiveXmlShapes( + args: RecursiveXmlShapesCommandInput, + cb: (err: any, data?: RecursiveXmlShapesCommandOutput) => void + ): void; + recursiveXmlShapes( + args: RecursiveXmlShapesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RecursiveXmlShapesCommandOutput) => void + ): void; + + /** + * @see {@link SimpleInputParamsCommand} + */ + simpleInputParams(): Promise; + simpleInputParams( + args: SimpleInputParamsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleInputParams( + args: SimpleInputParamsCommandInput, + cb: (err: any, data?: SimpleInputParamsCommandOutput) => void + ): void; + simpleInputParams( + args: SimpleInputParamsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleInputParamsCommandOutput) => void + ): void; + + /** + * @see {@link SimpleScalarXmlPropertiesCommand} + */ + simpleScalarXmlProperties(): Promise; + simpleScalarXmlProperties( + args: SimpleScalarXmlPropertiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleScalarXmlProperties( + args: SimpleScalarXmlPropertiesCommandInput, + cb: (err: any, data?: SimpleScalarXmlPropertiesCommandOutput) => void + ): void; + simpleScalarXmlProperties( + args: SimpleScalarXmlPropertiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleScalarXmlPropertiesCommandOutput) => void + ): void; + + /** + * @see {@link XmlBlobsCommand} + */ + xmlBlobs(): Promise; + xmlBlobs(args: XmlBlobsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlBlobs(args: XmlBlobsCommandInput, cb: (err: any, data?: XmlBlobsCommandOutput) => void): void; + xmlBlobs( + args: XmlBlobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlBlobsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyBlobsCommand} + */ + xmlEmptyBlobs(): Promise; + xmlEmptyBlobs(args: XmlEmptyBlobsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyBlobs(args: XmlEmptyBlobsCommandInput, cb: (err: any, data?: XmlEmptyBlobsCommandOutput) => void): void; + xmlEmptyBlobs( + args: XmlEmptyBlobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyBlobsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyListsCommand} + */ + xmlEmptyLists(): Promise; + xmlEmptyLists(args: XmlEmptyListsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyLists(args: XmlEmptyListsCommandInput, cb: (err: any, data?: XmlEmptyListsCommandOutput) => void): void; + xmlEmptyLists( + args: XmlEmptyListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyListsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEnumsCommand} + */ + xmlEnums(): Promise; + xmlEnums(args: XmlEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEnums(args: XmlEnumsCommandInput, cb: (err: any, data?: XmlEnumsCommandOutput) => void): void; + xmlEnums( + args: XmlEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEnumsCommandOutput) => void + ): void; + + /** + * @see {@link XmlIntEnumsCommand} + */ + xmlIntEnums(): Promise; + xmlIntEnums(args: XmlIntEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlIntEnums(args: XmlIntEnumsCommandInput, cb: (err: any, data?: XmlIntEnumsCommandOutput) => void): void; + xmlIntEnums( + args: XmlIntEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlIntEnumsCommandOutput) => void + ): void; + + /** + * @see {@link XmlListsCommand} + */ + xmlLists(): Promise; + xmlLists(args: XmlListsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlLists(args: XmlListsCommandInput, cb: (err: any, data?: XmlListsCommandOutput) => void): void; + xmlLists( + args: XmlListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlListsCommandOutput) => void + ): void; + + /** + * @see {@link XmlNamespacesCommand} + */ + xmlNamespaces(): Promise; + xmlNamespaces(args: XmlNamespacesCommandInput, options?: __HttpHandlerOptions): Promise; + xmlNamespaces(args: XmlNamespacesCommandInput, cb: (err: any, data?: XmlNamespacesCommandOutput) => void): void; + xmlNamespaces( + args: XmlNamespacesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlNamespacesCommandOutput) => void + ): void; + + /** + * @see {@link XmlTimestampsCommand} + */ + xmlTimestamps(): Promise; + xmlTimestamps(args: XmlTimestampsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlTimestamps(args: XmlTimestampsCommandInput, cb: (err: any, data?: XmlTimestampsCommandOutput) => void): void; + xmlTimestamps( + args: XmlTimestampsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlTimestampsCommandOutput) => void + ): void; +} + +/** + * An EC2 query service that sends query requests and XML responses. + * @public + */ +export class EC2Protocol extends EC2ProtocolClient implements EC2Protocol {} +createAggregatedClient(commands, EC2Protocol); diff --git a/private/aws-protocoltests-ec2-schema/src/EC2ProtocolClient.ts b/private/aws-protocoltests-ec2-schema/src/EC2ProtocolClient.ts new file mode 100644 index 0000000000000..27fc0b507f4f7 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/EC2ProtocolClient.ts @@ -0,0 +1,440 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + ClientProtocol, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + HttpRequest, + HttpResponse, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + defaultEC2ProtocolHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "./commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "./commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, +} from "./commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommandInput, NestedStructuresCommandOutput } from "./commands/NestedStructuresCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "./commands/NoInputAndOutputCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommandInput, QueryListsCommandOutput } from "./commands/QueryListsCommand"; +import { QueryTimestampsCommandInput, QueryTimestampsCommandOutput } from "./commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommandInput, RecursiveXmlShapesCommandOutput } from "./commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommandInput, SimpleInputParamsCommandOutput } from "./commands/SimpleInputParamsCommand"; +import { + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, +} from "./commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommandInput, XmlBlobsCommandOutput } from "./commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommandInput, XmlEmptyBlobsCommandOutput } from "./commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommandInput, XmlEmptyListsCommandOutput } from "./commands/XmlEmptyListsCommand"; +import { XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand"; +import { XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand"; +import { XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand"; +import { XmlNamespacesCommandInput, XmlNamespacesCommandOutput } from "./commands/XmlNamespacesCommand"; +import { XmlTimestampsCommandInput, XmlTimestampsCommandOutput } from "./commands/XmlTimestampsCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | DatetimeOffsetsCommandInput + | EmptyInputAndEmptyOutputCommandInput + | EndpointOperationCommandInput + | EndpointWithHostLabelOperationCommandInput + | FractionalSecondsCommandInput + | GreetingWithErrorsCommandInput + | HostWithPathOperationCommandInput + | IgnoresWrappingXmlNameCommandInput + | NestedStructuresCommandInput + | NoInputAndOutputCommandInput + | PutWithContentEncodingCommandInput + | QueryIdempotencyTokenAutoFillCommandInput + | QueryListsCommandInput + | QueryTimestampsCommandInput + | RecursiveXmlShapesCommandInput + | SimpleInputParamsCommandInput + | SimpleScalarXmlPropertiesCommandInput + | XmlBlobsCommandInput + | XmlEmptyBlobsCommandInput + | XmlEmptyListsCommandInput + | XmlEnumsCommandInput + | XmlIntEnumsCommandInput + | XmlListsCommandInput + | XmlNamespacesCommandInput + | XmlTimestampsCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | DatetimeOffsetsCommandOutput + | EmptyInputAndEmptyOutputCommandOutput + | EndpointOperationCommandOutput + | EndpointWithHostLabelOperationCommandOutput + | FractionalSecondsCommandOutput + | GreetingWithErrorsCommandOutput + | HostWithPathOperationCommandOutput + | IgnoresWrappingXmlNameCommandOutput + | NestedStructuresCommandOutput + | NoInputAndOutputCommandOutput + | PutWithContentEncodingCommandOutput + | QueryIdempotencyTokenAutoFillCommandOutput + | QueryListsCommandOutput + | QueryTimestampsCommandOutput + | RecursiveXmlShapesCommandOutput + | SimpleInputParamsCommandOutput + | SimpleScalarXmlPropertiesCommandOutput + | XmlBlobsCommandOutput + | XmlEmptyBlobsCommandOutput + | XmlEmptyListsCommandOutput + | XmlEnumsCommandOutput + | XmlIntEnumsCommandOutput + | XmlListsCommandOutput + | XmlNamespacesCommandOutput + | XmlTimestampsCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON) + * may be overridden. A default will always be set by the client. + * Available options depend on the service's supported protocols and will not be validated by + * the client. + * @alpha + * + */ + protocol?: ClientProtocol; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type EC2ProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + CompressionInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of EC2ProtocolClient class constructor that set the region, credentials and other options. + */ +export interface EC2ProtocolClientConfig extends EC2ProtocolClientConfigType {} + +/** + * @public + */ +export type EC2ProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + CompressionResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of EC2ProtocolClient class. This is resolved and normalized from the {@link EC2ProtocolClientConfig | constructor configuration interface}. + */ +export interface EC2ProtocolClientResolvedConfig extends EC2ProtocolClientResolvedConfigType {} + +/** + * An EC2 query service that sends query requests and XML responses. + * @public + */ +export class EC2ProtocolClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + EC2ProtocolClientResolvedConfig +> { + /** + * The resolved configuration of EC2ProtocolClient class. This is resolved and normalized from the {@link EC2ProtocolClientConfig | constructor configuration interface}. + */ + readonly config: EC2ProtocolClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + super(_config_0 as any); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveCompressionConfig(_config_7); + const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []); + this.config = _config_9; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultEC2ProtocolHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: EC2ProtocolClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/private/aws-protocoltests-ec2-schema/src/auth/httpAuthExtensionConfiguration.ts b/private/aws-protocoltests-ec2-schema/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 0000000000000..4fcd9b8aa1383 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { EC2ProtocolHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: EC2ProtocolHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): EC2ProtocolHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: EC2ProtocolHttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: EC2ProtocolHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): EC2ProtocolHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/private/aws-protocoltests-ec2-schema/src/auth/httpAuthSchemeProvider.ts b/private/aws-protocoltests-ec2-schema/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 0000000000000..e8513d342cbd0 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,155 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, + Provider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { EC2ProtocolClientConfig, EC2ProtocolClientResolvedConfig } from "../EC2ProtocolClient"; + +/** + * @internal + */ +export interface EC2ProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface EC2ProtocolHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + EC2ProtocolClientResolvedConfig, + HandlerExecutionContext, + EC2ProtocolHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultEC2ProtocolHttpAuthSchemeParametersProvider = async ( + config: EC2ProtocolClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption(authParameters: EC2ProtocolHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "ec2query", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface EC2ProtocolHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultEC2ProtocolHttpAuthSchemeProvider: EC2ProtocolHttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + authSchemePreference?: string[] | Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: EC2ProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + readonly authSchemePreference: Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: EC2ProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), + }) as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/private/aws-protocoltests-ec2-schema/src/commands/DatetimeOffsetsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/DatetimeOffsetsCommand.ts new file mode 100644 index 0000000000000..74909717eb1c6 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/DatetimeOffsetsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DatetimeOffsetsOutput } from "../models/models_0"; +import { DatetimeOffsets } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandInput {} +/** + * @public + * + * The output of {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandOutput extends DatetimeOffsetsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, DatetimeOffsetsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, DatetimeOffsetsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new DatetimeOffsetsCommand(input); + * const response = await client.send(command); + * // { // DatetimeOffsetsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param DatetimeOffsetsCommandInput - {@link DatetimeOffsetsCommandInput} + * @returns {@link DatetimeOffsetsCommandOutput} + * @see {@link DatetimeOffsetsCommandInput} for command's `input` shape. + * @see {@link DatetimeOffsetsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class DatetimeOffsetsCommand extends $Command + .classBuilder< + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "DatetimeOffsets", {}) + .n("EC2ProtocolClient", "DatetimeOffsetsCommand") + .f(void 0, void 0) + .sc(DatetimeOffsets) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: DatetimeOffsetsOutput; + }; + sdk: { + input: DatetimeOffsetsCommandInput; + output: DatetimeOffsetsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts new file mode 100644 index 0000000000000..75816d54ca38d --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { EmptyInputAndEmptyOutputInput, EmptyInputAndEmptyOutputOutput } from "../models/models_0"; +import { EmptyInputAndEmptyOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandInput extends EmptyInputAndEmptyOutputInput {} +/** + * @public + * + * The output of {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandOutput extends EmptyInputAndEmptyOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response members. + * + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, EmptyInputAndEmptyOutputCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, EmptyInputAndEmptyOutputCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new EmptyInputAndEmptyOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EmptyInputAndEmptyOutputCommandInput - {@link EmptyInputAndEmptyOutputCommandInput} + * @returns {@link EmptyInputAndEmptyOutputCommandOutput} + * @see {@link EmptyInputAndEmptyOutputCommandInput} for command's `input` shape. + * @see {@link EmptyInputAndEmptyOutputCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class EmptyInputAndEmptyOutputCommand extends $Command + .classBuilder< + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "EmptyInputAndEmptyOutput", {}) + .n("EC2ProtocolClient", "EmptyInputAndEmptyOutputCommand") + .f(void 0, void 0) + .sc(EmptyInputAndEmptyOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EmptyInputAndEmptyOutputCommandInput; + output: EmptyInputAndEmptyOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/EndpointOperationCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/EndpointOperationCommand.ts new file mode 100644 index 0000000000000..e51b6e0f78a57 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/EndpointOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { EndpointOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandInput {} +/** + * @public + * + * The output of {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, EndpointOperationCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, EndpointOperationCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new EndpointOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointOperationCommandInput - {@link EndpointOperationCommandInput} + * @returns {@link EndpointOperationCommandOutput} + * @see {@link EndpointOperationCommandInput} for command's `input` shape. + * @see {@link EndpointOperationCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class EndpointOperationCommand extends $Command + .classBuilder< + EndpointOperationCommandInput, + EndpointOperationCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "EndpointOperation", {}) + .n("EC2ProtocolClient", "EndpointOperationCommand") + .f(void 0, void 0) + .sc(EndpointOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EndpointOperationCommandInput; + output: EndpointOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/EndpointWithHostLabelOperationCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/EndpointWithHostLabelOperationCommand.ts new file mode 100644 index 0000000000000..df515fee13c95 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/EndpointWithHostLabelOperationCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { HostLabelInput } from "../models/models_0"; +import { EndpointWithHostLabelOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandInput extends HostLabelInput {} +/** + * @public + * + * The output of {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, EndpointWithHostLabelOperationCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, EndpointWithHostLabelOperationCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = { // HostLabelInput + * label: "STRING_VALUE", // required + * }; + * const command = new EndpointWithHostLabelOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointWithHostLabelOperationCommandInput - {@link EndpointWithHostLabelOperationCommandInput} + * @returns {@link EndpointWithHostLabelOperationCommandOutput} + * @see {@link EndpointWithHostLabelOperationCommandInput} for command's `input` shape. + * @see {@link EndpointWithHostLabelOperationCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class EndpointWithHostLabelOperationCommand extends $Command + .classBuilder< + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "EndpointWithHostLabelOperation", {}) + .n("EC2ProtocolClient", "EndpointWithHostLabelOperationCommand") + .f(void 0, void 0) + .sc(EndpointWithHostLabelOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HostLabelInput; + output: {}; + }; + sdk: { + input: EndpointWithHostLabelOperationCommandInput; + output: EndpointWithHostLabelOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/FractionalSecondsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/FractionalSecondsCommand.ts new file mode 100644 index 0000000000000..9d6cfecb52a4b --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/FractionalSecondsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { FractionalSecondsOutput } from "../models/models_0"; +import { FractionalSeconds } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandInput {} +/** + * @public + * + * The output of {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, FractionalSecondsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, FractionalSecondsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new FractionalSecondsCommand(input); + * const response = await client.send(command); + * // { // FractionalSecondsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput} + * @returns {@link FractionalSecondsCommandOutput} + * @see {@link FractionalSecondsCommandInput} for command's `input` shape. + * @see {@link FractionalSecondsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class FractionalSecondsCommand extends $Command + .classBuilder< + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "FractionalSeconds", {}) + .n("EC2ProtocolClient", "FractionalSecondsCommand") + .f(void 0, void 0) + .sc(FractionalSeconds) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FractionalSecondsOutput; + }; + sdk: { + input: FractionalSecondsCommandInput; + output: FractionalSecondsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/GreetingWithErrorsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/GreetingWithErrorsCommand.ts new file mode 100644 index 0000000000000..3fa0d7e7bbcce --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/GreetingWithErrorsCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { GreetingWithErrorsOutput } from "../models/models_0"; +import { GreetingWithErrors } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandInput {} +/** + * @public + * + * The output of {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {} + +/** + * This operation has three possible return values: + * + * 1. A successful response in the form of GreetingWithErrorsOutput + * 2. An InvalidGreeting error. + * 3. A BadRequest error. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, GreetingWithErrorsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, GreetingWithErrorsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new GreetingWithErrorsCommand(input); + * const response = await client.send(command); + * // { // GreetingWithErrorsOutput + * // greeting: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput} + * @returns {@link GreetingWithErrorsCommandOutput} + * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape. + * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link InvalidGreeting} (client fault) + * This error is thrown when an invalid greeting value is provided. + * + * @throws {@link ComplexError} (client fault) + * This error is thrown when a request is invalid. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class GreetingWithErrorsCommand extends $Command + .classBuilder< + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "GreetingWithErrors", {}) + .n("EC2ProtocolClient", "GreetingWithErrorsCommand") + .f(void 0, void 0) + .sc(GreetingWithErrors) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: GreetingWithErrorsOutput; + }; + sdk: { + input: GreetingWithErrorsCommandInput; + output: GreetingWithErrorsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/HostWithPathOperationCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/HostWithPathOperationCommand.ts new file mode 100644 index 0000000000000..37791f0c8df01 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/HostWithPathOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { HostWithPathOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandInput {} +/** + * @public + * + * The output of {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, HostWithPathOperationCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, HostWithPathOperationCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new HostWithPathOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HostWithPathOperationCommandInput - {@link HostWithPathOperationCommandInput} + * @returns {@link HostWithPathOperationCommandOutput} + * @see {@link HostWithPathOperationCommandInput} for command's `input` shape. + * @see {@link HostWithPathOperationCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class HostWithPathOperationCommand extends $Command + .classBuilder< + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "HostWithPathOperation", {}) + .n("EC2ProtocolClient", "HostWithPathOperationCommand") + .f(void 0, void 0) + .sc(HostWithPathOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: HostWithPathOperationCommandInput; + output: HostWithPathOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/IgnoresWrappingXmlNameCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/IgnoresWrappingXmlNameCommand.ts new file mode 100644 index 0000000000000..a3ee5d5e5ae1a --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/IgnoresWrappingXmlNameCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { IgnoresWrappingXmlNameOutput } from "../models/models_0"; +import { IgnoresWrappingXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link IgnoresWrappingXmlNameCommand}. + */ +export interface IgnoresWrappingXmlNameCommandInput {} +/** + * @public + * + * The output of {@link IgnoresWrappingXmlNameCommand}. + */ +export interface IgnoresWrappingXmlNameCommandOutput extends IgnoresWrappingXmlNameOutput, __MetadataBearer {} + +/** + * The xmlName trait on the output structure is ignored in AWS Query. + * + * The wrapping element is always operation name + "Response". + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, IgnoresWrappingXmlNameCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, IgnoresWrappingXmlNameCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new IgnoresWrappingXmlNameCommand(input); + * const response = await client.send(command); + * // { // IgnoresWrappingXmlNameOutput + * // foo: "STRING_VALUE", + * // }; + * + * ``` + * + * @param IgnoresWrappingXmlNameCommandInput - {@link IgnoresWrappingXmlNameCommandInput} + * @returns {@link IgnoresWrappingXmlNameCommandOutput} + * @see {@link IgnoresWrappingXmlNameCommandInput} for command's `input` shape. + * @see {@link IgnoresWrappingXmlNameCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class IgnoresWrappingXmlNameCommand extends $Command + .classBuilder< + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "IgnoresWrappingXmlName", {}) + .n("EC2ProtocolClient", "IgnoresWrappingXmlNameCommand") + .f(void 0, void 0) + .sc(IgnoresWrappingXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: IgnoresWrappingXmlNameOutput; + }; + sdk: { + input: IgnoresWrappingXmlNameCommandInput; + output: IgnoresWrappingXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/NestedStructuresCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/NestedStructuresCommand.ts new file mode 100644 index 0000000000000..95e42a3eff116 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/NestedStructuresCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { NestedStructuresInput } from "../models/models_0"; +import { NestedStructures } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NestedStructuresCommand}. + */ +export interface NestedStructuresCommandInput extends NestedStructuresInput {} +/** + * @public + * + * The output of {@link NestedStructuresCommand}. + */ +export interface NestedStructuresCommandOutput extends __MetadataBearer {} + +/** + * This test serializes nested and recursive structure members. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, NestedStructuresCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, NestedStructuresCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = { // NestedStructuresInput + * Nested: { // StructArg + * StringArg: "STRING_VALUE", + * OtherArg: true || false, + * RecursiveArg: { + * StringArg: "STRING_VALUE", + * OtherArg: true || false, + * RecursiveArg: "", + * }, + * }, + * }; + * const command = new NestedStructuresCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NestedStructuresCommandInput - {@link NestedStructuresCommandInput} + * @returns {@link NestedStructuresCommandOutput} + * @see {@link NestedStructuresCommandInput} for command's `input` shape. + * @see {@link NestedStructuresCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class NestedStructuresCommand extends $Command + .classBuilder< + NestedStructuresCommandInput, + NestedStructuresCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "NestedStructures", {}) + .n("EC2ProtocolClient", "NestedStructuresCommand") + .f(void 0, void 0) + .sc(NestedStructures) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NestedStructuresInput; + output: {}; + }; + sdk: { + input: NestedStructuresCommandInput; + output: NestedStructuresCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/NoInputAndOutputCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/NoInputAndOutputCommand.ts new file mode 100644 index 0000000000000..d935686d01b75 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/NoInputAndOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { NoInputAndOutputOutput } from "../models/models_0"; +import { NoInputAndOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandOutput extends NoInputAndOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request payload or response members. + * + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, NoInputAndOutputCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, NoInputAndOutputCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new NoInputAndOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndOutputCommandInput - {@link NoInputAndOutputCommandInput} + * @returns {@link NoInputAndOutputCommandOutput} + * @see {@link NoInputAndOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndOutputCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class NoInputAndOutputCommand extends $Command + .classBuilder< + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "NoInputAndOutput", {}) + .n("EC2ProtocolClient", "NoInputAndOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndOutputCommandInput; + output: NoInputAndOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/PutWithContentEncodingCommand.ts new file mode 100644 index 0000000000000..f8fe41759fc22 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/PutWithContentEncodingCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { PutWithContentEncodingInput } from "../models/models_0"; +import { PutWithContentEncoding } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandInput extends PutWithContentEncodingInput {} +/** + * @public + * + * The output of {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, PutWithContentEncodingCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, PutWithContentEncodingCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = { // PutWithContentEncodingInput + * encoding: "STRING_VALUE", + * data: "STRING_VALUE", + * }; + * const command = new PutWithContentEncodingCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param PutWithContentEncodingCommandInput - {@link PutWithContentEncodingCommandInput} + * @returns {@link PutWithContentEncodingCommandOutput} + * @see {@link PutWithContentEncodingCommandInput} for command's `input` shape. + * @see {@link PutWithContentEncodingCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class PutWithContentEncodingCommand extends $Command + .classBuilder< + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [ + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getCompressionPlugin(config, { + encodings: ["gzip"], + }), + ]; + }) + .s("AwsEc2", "PutWithContentEncoding", {}) + .n("EC2ProtocolClient", "PutWithContentEncodingCommand") + .f(void 0, void 0) + .sc(PutWithContentEncoding) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutWithContentEncodingInput; + output: {}; + }; + sdk: { + input: PutWithContentEncodingCommandInput; + output: PutWithContentEncodingCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts new file mode 100644 index 0000000000000..deefb717b7a40 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryIdempotencyTokenAutoFillInput } from "../models/models_0"; +import { QueryIdempotencyTokenAutoFill } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandInput extends QueryIdempotencyTokenAutoFillInput {} +/** + * @public + * + * The output of {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandOutput extends __MetadataBearer {} + +/** + * Automatically adds idempotency tokens. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, QueryIdempotencyTokenAutoFillCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, QueryIdempotencyTokenAutoFillCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = { // QueryIdempotencyTokenAutoFillInput + * token: "STRING_VALUE", + * }; + * const command = new QueryIdempotencyTokenAutoFillCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryIdempotencyTokenAutoFillCommandInput - {@link QueryIdempotencyTokenAutoFillCommandInput} + * @returns {@link QueryIdempotencyTokenAutoFillCommandOutput} + * @see {@link QueryIdempotencyTokenAutoFillCommandInput} for command's `input` shape. + * @see {@link QueryIdempotencyTokenAutoFillCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class QueryIdempotencyTokenAutoFillCommand extends $Command + .classBuilder< + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "QueryIdempotencyTokenAutoFill", {}) + .n("EC2ProtocolClient", "QueryIdempotencyTokenAutoFillCommand") + .f(void 0, void 0) + .sc(QueryIdempotencyTokenAutoFill) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryIdempotencyTokenAutoFillInput; + output: {}; + }; + sdk: { + input: QueryIdempotencyTokenAutoFillCommandInput; + output: QueryIdempotencyTokenAutoFillCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/QueryListsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/QueryListsCommand.ts new file mode 100644 index 0000000000000..12d81903cb34b --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/QueryListsCommand.ts @@ -0,0 +1,104 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryListsInput } from "../models/models_0"; +import { QueryLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryListsCommand}. + */ +export interface QueryListsCommandInput extends QueryListsInput {} +/** + * @public + * + * The output of {@link QueryListsCommand}. + */ +export interface QueryListsCommandOutput extends __MetadataBearer {} + +/** + * This test serializes simple and complex lists. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, QueryListsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, QueryListsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = { // QueryListsInput + * ListArg: [ // StringList + * "STRING_VALUE", + * ], + * ComplexListArg: [ // GreetingList + * { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * ], + * ListArgWithXmlNameMember: [ // ListWithXmlName + * "STRING_VALUE", + * ], + * ListArgWithXmlName: [ + * "STRING_VALUE", + * ], + * NestedWithList: { // NestedStructWithList + * ListArg: [ + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new QueryListsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryListsCommandInput - {@link QueryListsCommandInput} + * @returns {@link QueryListsCommandOutput} + * @see {@link QueryListsCommandInput} for command's `input` shape. + * @see {@link QueryListsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class QueryListsCommand extends $Command + .classBuilder< + QueryListsCommandInput, + QueryListsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "QueryLists", {}) + .n("EC2ProtocolClient", "QueryListsCommand") + .f(void 0, void 0) + .sc(QueryLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryListsInput; + output: {}; + }; + sdk: { + input: QueryListsCommandInput; + output: QueryListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/QueryTimestampsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/QueryTimestampsCommand.ts new file mode 100644 index 0000000000000..1c6bdc0804f6a --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/QueryTimestampsCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryTimestampsInput } from "../models/models_0"; +import { QueryTimestamps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryTimestampsCommand}. + */ +export interface QueryTimestampsCommandInput extends QueryTimestampsInput {} +/** + * @public + * + * The output of {@link QueryTimestampsCommand}. + */ +export interface QueryTimestampsCommandOutput extends __MetadataBearer {} + +/** + * This test serializes timestamps. + * + * 1. Timestamps are serialized as RFC 3339 date-time values by default. + * 2. A timestampFormat trait on a member changes the format. + * 3. A timestampFormat trait on the shape targeted by the member changes the format. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, QueryTimestampsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, QueryTimestampsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = { // QueryTimestampsInput + * normalFormat: new Date("TIMESTAMP"), + * epochMember: new Date("TIMESTAMP"), + * epochTarget: new Date("TIMESTAMP"), + * }; + * const command = new QueryTimestampsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryTimestampsCommandInput - {@link QueryTimestampsCommandInput} + * @returns {@link QueryTimestampsCommandOutput} + * @see {@link QueryTimestampsCommandInput} for command's `input` shape. + * @see {@link QueryTimestampsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class QueryTimestampsCommand extends $Command + .classBuilder< + QueryTimestampsCommandInput, + QueryTimestampsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "QueryTimestamps", {}) + .n("EC2ProtocolClient", "QueryTimestampsCommand") + .f(void 0, void 0) + .sc(QueryTimestamps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryTimestampsInput; + output: {}; + }; + sdk: { + input: QueryTimestampsCommandInput; + output: QueryTimestampsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/RecursiveXmlShapesCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/RecursiveXmlShapesCommand.ts new file mode 100644 index 0000000000000..adb7be3ebfc25 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/RecursiveXmlShapesCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { RecursiveXmlShapesOutput } from "../models/models_0"; +import { RecursiveXmlShapes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RecursiveXmlShapesCommand}. + */ +export interface RecursiveXmlShapesCommandInput {} +/** + * @public + * + * The output of {@link RecursiveXmlShapesCommand}. + */ +export interface RecursiveXmlShapesCommandOutput extends RecursiveXmlShapesOutput, __MetadataBearer {} + +/** + * Recursive shapes + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, RecursiveXmlShapesCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, RecursiveXmlShapesCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new RecursiveXmlShapesCommand(input); + * const response = await client.send(command); + * // { // RecursiveXmlShapesOutput + * // nested: { // RecursiveXmlShapesOutputNested1 + * // foo: "STRING_VALUE", + * // nested: { // RecursiveXmlShapesOutputNested2 + * // bar: "STRING_VALUE", + * // recursiveMember: { + * // foo: "STRING_VALUE", + * // nested: { + * // bar: "STRING_VALUE", + * // recursiveMember: "", + * // }, + * // }, + * // }, + * // }, + * // }; + * + * ``` + * + * @param RecursiveXmlShapesCommandInput - {@link RecursiveXmlShapesCommandInput} + * @returns {@link RecursiveXmlShapesCommandOutput} + * @see {@link RecursiveXmlShapesCommandInput} for command's `input` shape. + * @see {@link RecursiveXmlShapesCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class RecursiveXmlShapesCommand extends $Command + .classBuilder< + RecursiveXmlShapesCommandInput, + RecursiveXmlShapesCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "RecursiveXmlShapes", {}) + .n("EC2ProtocolClient", "RecursiveXmlShapesCommand") + .f(void 0, void 0) + .sc(RecursiveXmlShapes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: RecursiveXmlShapesOutput; + }; + sdk: { + input: RecursiveXmlShapesCommandInput; + output: RecursiveXmlShapesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/SimpleInputParamsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/SimpleInputParamsCommand.ts new file mode 100644 index 0000000000000..c6b9ccc1e502c --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/SimpleInputParamsCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleInputParamsInput } from "../models/models_0"; +import { SimpleInputParams } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleInputParamsCommand}. + */ +export interface SimpleInputParamsCommandInput extends SimpleInputParamsInput {} +/** + * @public + * + * The output of {@link SimpleInputParamsCommand}. + */ +export interface SimpleInputParamsCommandOutput extends __MetadataBearer {} + +/** + * This test serializes strings, numbers, and boolean values. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, SimpleInputParamsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, SimpleInputParamsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = { // SimpleInputParamsInput + * Foo: "STRING_VALUE", + * Bar: "STRING_VALUE", + * Baz: true || false, + * Bam: Number("int"), + * FloatValue: Number("float"), + * Boo: Number("double"), + * Qux: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * FooEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * HasQueryName: "STRING_VALUE", + * HasQueryAndXmlName: "STRING_VALUE", + * UsesXmlName: "STRING_VALUE", + * }; + * const command = new SimpleInputParamsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param SimpleInputParamsCommandInput - {@link SimpleInputParamsCommandInput} + * @returns {@link SimpleInputParamsCommandOutput} + * @see {@link SimpleInputParamsCommandInput} for command's `input` shape. + * @see {@link SimpleInputParamsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class SimpleInputParamsCommand extends $Command + .classBuilder< + SimpleInputParamsCommandInput, + SimpleInputParamsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "SimpleInputParams", {}) + .n("EC2ProtocolClient", "SimpleInputParamsCommand") + .f(void 0, void 0) + .sc(SimpleInputParams) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleInputParamsInput; + output: {}; + }; + sdk: { + input: SimpleInputParamsCommandInput; + output: SimpleInputParamsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/SimpleScalarXmlPropertiesCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/SimpleScalarXmlPropertiesCommand.ts new file mode 100644 index 0000000000000..6434cb26c2c48 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/SimpleScalarXmlPropertiesCommand.ts @@ -0,0 +1,95 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleScalarXmlPropertiesOutput } from "../models/models_0"; +import { SimpleScalarXmlProperties } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleScalarXmlPropertiesCommand}. + */ +export interface SimpleScalarXmlPropertiesCommandInput {} +/** + * @public + * + * The output of {@link SimpleScalarXmlPropertiesCommand}. + */ +export interface SimpleScalarXmlPropertiesCommandOutput extends SimpleScalarXmlPropertiesOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, SimpleScalarXmlPropertiesCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, SimpleScalarXmlPropertiesCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new SimpleScalarXmlPropertiesCommand(input); + * const response = await client.send(command); + * // { // SimpleScalarXmlPropertiesOutput + * // stringValue: "STRING_VALUE", + * // emptyStringValue: "STRING_VALUE", + * // trueBooleanValue: true || false, + * // falseBooleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }; + * + * ``` + * + * @param SimpleScalarXmlPropertiesCommandInput - {@link SimpleScalarXmlPropertiesCommandInput} + * @returns {@link SimpleScalarXmlPropertiesCommandOutput} + * @see {@link SimpleScalarXmlPropertiesCommandInput} for command's `input` shape. + * @see {@link SimpleScalarXmlPropertiesCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class SimpleScalarXmlPropertiesCommand extends $Command + .classBuilder< + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "SimpleScalarXmlProperties", {}) + .n("EC2ProtocolClient", "SimpleScalarXmlPropertiesCommand") + .f(void 0, void 0) + .sc(SimpleScalarXmlProperties) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: SimpleScalarXmlPropertiesOutput; + }; + sdk: { + input: SimpleScalarXmlPropertiesCommandInput; + output: SimpleScalarXmlPropertiesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlBlobsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlBlobsCommand.ts new file mode 100644 index 0000000000000..7b81d0a1be70d --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlBlobsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlBlobsOutput } from "../models/models_0"; +import { XmlBlobs } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlBlobsCommand}. + */ +export interface XmlBlobsCommandInput {} +/** + * @public + * + * The output of {@link XmlBlobsCommand}. + */ +export interface XmlBlobsCommandOutput extends XmlBlobsOutput, __MetadataBearer {} + +/** + * Blobs are base64 encoded + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlBlobsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlBlobsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlBlobsCommand(input); + * const response = await client.send(command); + * // { // XmlBlobsOutput + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param XmlBlobsCommandInput - {@link XmlBlobsCommandInput} + * @returns {@link XmlBlobsCommandOutput} + * @see {@link XmlBlobsCommandInput} for command's `input` shape. + * @see {@link XmlBlobsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class XmlBlobsCommand extends $Command + .classBuilder< + XmlBlobsCommandInput, + XmlBlobsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlBlobs", {}) + .n("EC2ProtocolClient", "XmlBlobsCommand") + .f(void 0, void 0) + .sc(XmlBlobs) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlBlobsOutput; + }; + sdk: { + input: XmlBlobsCommandInput; + output: XmlBlobsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlEmptyBlobsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlEmptyBlobsCommand.ts new file mode 100644 index 0000000000000..2d23288a35283 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlEmptyBlobsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlBlobsOutput } from "../models/models_0"; +import { XmlEmptyBlobs } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyBlobsCommand}. + */ +export interface XmlEmptyBlobsCommandInput {} +/** + * @public + * + * The output of {@link XmlEmptyBlobsCommand}. + */ +export interface XmlEmptyBlobsCommandOutput extends XmlBlobsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlEmptyBlobsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlEmptyBlobsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlEmptyBlobsCommand(input); + * const response = await client.send(command); + * // { // XmlBlobsOutput + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param XmlEmptyBlobsCommandInput - {@link XmlEmptyBlobsCommandInput} + * @returns {@link XmlEmptyBlobsCommandOutput} + * @see {@link XmlEmptyBlobsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyBlobsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class XmlEmptyBlobsCommand extends $Command + .classBuilder< + XmlEmptyBlobsCommandInput, + XmlEmptyBlobsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlEmptyBlobs", {}) + .n("EC2ProtocolClient", "XmlEmptyBlobsCommand") + .f(void 0, void 0) + .sc(XmlEmptyBlobs) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlBlobsOutput; + }; + sdk: { + input: XmlEmptyBlobsCommandInput; + output: XmlEmptyBlobsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlEmptyListsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlEmptyListsCommand.ts new file mode 100644 index 0000000000000..521ed8211a856 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlEmptyListsCommand.ts @@ -0,0 +1,132 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlListsOutput } from "../models/models_0"; +import { XmlEmptyLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyListsCommand}. + */ +export interface XmlEmptyListsCommandInput {} +/** + * @public + * + * The output of {@link XmlEmptyListsCommand}. + */ +export interface XmlEmptyListsCommandOutput extends XmlListsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlEmptyListsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlEmptyListsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlEmptyListsCommand(input); + * const response = await client.send(command); + * // { // XmlListsOutput + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // renamedListMembers: [ // RenamedListMembers + * // "STRING_VALUE", + * // ], + * // flattenedList: [ + * // "STRING_VALUE", + * // ], + * // flattenedList2: [ + * // "STRING_VALUE", + * // ], + * // flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * // "STRING_VALUE", + * // ], + * // flattenedListWithNamespace: [ // ListWithNamespace + * // "STRING_VALUE", + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param XmlEmptyListsCommandInput - {@link XmlEmptyListsCommandInput} + * @returns {@link XmlEmptyListsCommandOutput} + * @see {@link XmlEmptyListsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyListsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class XmlEmptyListsCommand extends $Command + .classBuilder< + XmlEmptyListsCommandInput, + XmlEmptyListsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlEmptyLists", {}) + .n("EC2ProtocolClient", "XmlEmptyListsCommand") + .f(void 0, void 0) + .sc(XmlEmptyLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlListsOutput; + }; + sdk: { + input: XmlEmptyListsCommandInput; + output: XmlEmptyListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlEnumsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlEnumsCommand.ts new file mode 100644 index 0000000000000..b48fa89fe9e4f --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlEnumsCommand.ts @@ -0,0 +1,97 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlEnumsOutput } from "../models/models_0"; +import { XmlEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEnumsCommand}. + */ +export interface XmlEnumsCommandInput {} +/** + * @public + * + * The output of {@link XmlEnumsCommand}. + */ +export interface XmlEnumsCommandOutput extends XmlEnumsOutput, __MetadataBearer {} + +/** + * This example serializes enums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlEnumsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlEnumsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlEnumsCommand(input); + * const response = await client.send(command); + * // { // XmlEnumsOutput + * // fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumSet: [ // FooEnumSet + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumMap: { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }; + * + * ``` + * + * @param XmlEnumsCommandInput - {@link XmlEnumsCommandInput} + * @returns {@link XmlEnumsCommandOutput} + * @see {@link XmlEnumsCommandInput} for command's `input` shape. + * @see {@link XmlEnumsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class XmlEnumsCommand extends $Command + .classBuilder< + XmlEnumsCommandInput, + XmlEnumsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlEnums", {}) + .n("EC2ProtocolClient", "XmlEnumsCommand") + .f(void 0, void 0) + .sc(XmlEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlEnumsOutput; + }; + sdk: { + input: XmlEnumsCommandInput; + output: XmlEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlIntEnumsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlIntEnumsCommand.ts new file mode 100644 index 0000000000000..133922d6b2bc0 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlIntEnumsCommand.ts @@ -0,0 +1,97 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlIntEnumsOutput } from "../models/models_0"; +import { XmlIntEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlIntEnumsCommand}. + */ +export interface XmlIntEnumsCommandInput {} +/** + * @public + * + * The output of {@link XmlIntEnumsCommand}. + */ +export interface XmlIntEnumsCommandOutput extends XmlIntEnumsOutput, __MetadataBearer {} + +/** + * This example serializes intEnums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlIntEnumsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlIntEnumsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlIntEnumsCommand(input); + * const response = await client.send(command); + * // { // XmlIntEnumsOutput + * // intEnum1: 1 || 2 || 3, + * // intEnum2: 1 || 2 || 3, + * // intEnum3: 1 || 2 || 3, + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // intEnumSet: [ // IntegerEnumSet + * // 1 || 2 || 3, + * // ], + * // intEnumMap: { // IntegerEnumMap + * // "": 1 || 2 || 3, + * // }, + * // }; + * + * ``` + * + * @param XmlIntEnumsCommandInput - {@link XmlIntEnumsCommandInput} + * @returns {@link XmlIntEnumsCommandOutput} + * @see {@link XmlIntEnumsCommandInput} for command's `input` shape. + * @see {@link XmlIntEnumsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class XmlIntEnumsCommand extends $Command + .classBuilder< + XmlIntEnumsCommandInput, + XmlIntEnumsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlIntEnums", {}) + .n("EC2ProtocolClient", "XmlIntEnumsCommand") + .f(void 0, void 0) + .sc(XmlIntEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlIntEnumsOutput; + }; + sdk: { + input: XmlIntEnumsCommandInput; + output: XmlIntEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlListsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlListsCommand.ts new file mode 100644 index 0000000000000..0c704790a666b --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlListsCommand.ts @@ -0,0 +1,142 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlListsOutput } from "../models/models_0"; +import { XmlLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlListsCommand}. + */ +export interface XmlListsCommandInput {} +/** + * @public + * + * The output of {@link XmlListsCommand}. + */ +export interface XmlListsCommandOutput extends XmlListsOutput, __MetadataBearer {} + +/** + * This test case serializes XML lists for the following cases for both + * input and output: + * + * 1. Normal XML lists. + * 2. Normal XML sets. + * 3. XML lists of lists. + * 4. XML lists with @xmlName on its members + * 5. Flattened XML lists. + * 6. Flattened XML lists with @xmlName. + * 7. Flattened XML lists with @xmlNamespace. + * 8. Lists of structures. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlListsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlListsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlListsCommand(input); + * const response = await client.send(command); + * // { // XmlListsOutput + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // renamedListMembers: [ // RenamedListMembers + * // "STRING_VALUE", + * // ], + * // flattenedList: [ + * // "STRING_VALUE", + * // ], + * // flattenedList2: [ + * // "STRING_VALUE", + * // ], + * // flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * // "STRING_VALUE", + * // ], + * // flattenedListWithNamespace: [ // ListWithNamespace + * // "STRING_VALUE", + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param XmlListsCommandInput - {@link XmlListsCommandInput} + * @returns {@link XmlListsCommandOutput} + * @see {@link XmlListsCommandInput} for command's `input` shape. + * @see {@link XmlListsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class XmlListsCommand extends $Command + .classBuilder< + XmlListsCommandInput, + XmlListsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlLists", {}) + .n("EC2ProtocolClient", "XmlListsCommand") + .f(void 0, void 0) + .sc(XmlLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlListsOutput; + }; + sdk: { + input: XmlListsCommandInput; + output: XmlListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlNamespacesCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlNamespacesCommand.ts new file mode 100644 index 0000000000000..c839feb4bbe67 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlNamespacesCommand.ts @@ -0,0 +1,91 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlNamespacesOutput } from "../models/models_0"; +import { XmlNamespaces } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlNamespacesCommand}. + */ +export interface XmlNamespacesCommandInput {} +/** + * @public + * + * The output of {@link XmlNamespacesCommand}. + */ +export interface XmlNamespacesCommandOutput extends XmlNamespacesOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlNamespacesCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlNamespacesCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlNamespacesCommand(input); + * const response = await client.send(command); + * // { // XmlNamespacesOutput + * // nested: { // XmlNamespaceNested + * // foo: "STRING_VALUE", + * // values: [ // XmlNamespacedList + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param XmlNamespacesCommandInput - {@link XmlNamespacesCommandInput} + * @returns {@link XmlNamespacesCommandOutput} + * @see {@link XmlNamespacesCommandInput} for command's `input` shape. + * @see {@link XmlNamespacesCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + */ +export class XmlNamespacesCommand extends $Command + .classBuilder< + XmlNamespacesCommandInput, + XmlNamespacesCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlNamespaces", {}) + .n("EC2ProtocolClient", "XmlNamespacesCommand") + .f(void 0, void 0) + .sc(XmlNamespaces) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlNamespacesOutput; + }; + sdk: { + input: XmlNamespacesCommandInput; + output: XmlNamespacesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/XmlTimestampsCommand.ts b/private/aws-protocoltests-ec2-schema/src/commands/XmlTimestampsCommand.ts new file mode 100644 index 0000000000000..fb8964293dc6b --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/XmlTimestampsCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { EC2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2ProtocolClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlTimestampsOutput } from "../models/models_0"; +import { XmlTimestamps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlTimestampsCommand}. + */ +export interface XmlTimestampsCommandInput {} +/** + * @public + * + * The output of {@link XmlTimestampsCommand}. + */ +export interface XmlTimestampsCommandOutput extends XmlTimestampsOutput, __MetadataBearer {} + +/** + * This tests how timestamps are serialized, including using the + * default format of date-time and various @timestampFormat trait + * values. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { EC2ProtocolClient, XmlTimestampsCommand } from "@aws-sdk/aws-protocoltests-ec2-schema"; // ES Modules import + * // const { EC2ProtocolClient, XmlTimestampsCommand } = require("@aws-sdk/aws-protocoltests-ec2-schema"); // CommonJS import + * const client = new EC2ProtocolClient(config); + * const input = {}; + * const command = new XmlTimestampsCommand(input); + * const response = await client.send(command); + * // { // XmlTimestampsOutput + * // normal: new Date("TIMESTAMP"), + * // dateTime: new Date("TIMESTAMP"), + * // dateTimeOnTarget: new Date("TIMESTAMP"), + * // epochSeconds: new Date("TIMESTAMP"), + * // epochSecondsOnTarget: new Date("TIMESTAMP"), + * // httpDate: new Date("TIMESTAMP"), + * // httpDateOnTarget: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param XmlTimestampsCommandInput - {@link XmlTimestampsCommandInput} + * @returns {@link XmlTimestampsCommandOutput} + * @see {@link XmlTimestampsCommandInput} for command's `input` shape. + * @see {@link XmlTimestampsCommandOutput} for command's `response` shape. + * @see {@link EC2ProtocolClientResolvedConfig | config} for EC2ProtocolClient's `config` shape. + * + * @throws {@link EC2ProtocolServiceException} + *

Base exception class for all service exceptions from EC2Protocol service.

+ * + * + * @public + */ +export class XmlTimestampsCommand extends $Command + .classBuilder< + XmlTimestampsCommandInput, + XmlTimestampsCommandOutput, + EC2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsEc2", "XmlTimestamps", {}) + .n("EC2ProtocolClient", "XmlTimestampsCommand") + .f(void 0, void 0) + .sc(XmlTimestamps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlTimestampsOutput; + }; + sdk: { + input: XmlTimestampsCommandInput; + output: XmlTimestampsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-ec2-schema/src/commands/index.ts b/private/aws-protocoltests-ec2-schema/src/commands/index.ts new file mode 100644 index 0000000000000..663e4ba05aade --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/commands/index.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +export * from "./DatetimeOffsetsCommand"; +export * from "./EmptyInputAndEmptyOutputCommand"; +export * from "./EndpointOperationCommand"; +export * from "./EndpointWithHostLabelOperationCommand"; +export * from "./FractionalSecondsCommand"; +export * from "./GreetingWithErrorsCommand"; +export * from "./HostWithPathOperationCommand"; +export * from "./IgnoresWrappingXmlNameCommand"; +export * from "./NestedStructuresCommand"; +export * from "./NoInputAndOutputCommand"; +export * from "./PutWithContentEncodingCommand"; +export * from "./QueryIdempotencyTokenAutoFillCommand"; +export * from "./QueryListsCommand"; +export * from "./QueryTimestampsCommand"; +export * from "./RecursiveXmlShapesCommand"; +export * from "./SimpleInputParamsCommand"; +export * from "./SimpleScalarXmlPropertiesCommand"; +export * from "./XmlBlobsCommand"; +export * from "./XmlEmptyBlobsCommand"; +export * from "./XmlEmptyListsCommand"; +export * from "./XmlEnumsCommand"; +export * from "./XmlIntEnumsCommand"; +export * from "./XmlListsCommand"; +export * from "./XmlNamespacesCommand"; +export * from "./XmlTimestampsCommand"; diff --git a/private/aws-protocoltests-ec2-schema/src/endpoint/EndpointParameters.ts b/private/aws-protocoltests-ec2-schema/src/endpoint/EndpointParameters.ts new file mode 100644 index 0000000000000..571dc8a904370 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/endpoint/EndpointParameters.ts @@ -0,0 +1,29 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return Object.assign(options, { + defaultSigningName: "ec2query", + }); +}; + +export const commonParams = { + endpoint: { type: "builtInParams", name: "endpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + endpoint?: string; +} diff --git a/private/aws-protocoltests-ec2-schema/src/endpoint/endpointResolver.ts b/private/aws-protocoltests-ec2-schema/src/endpoint/endpointResolver.ts new file mode 100644 index 0000000000000..8bb222967df85 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["endpoint"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/private/aws-protocoltests-ec2-schema/src/endpoint/ruleset.ts b/private/aws-protocoltests-ec2-schema/src/endpoint/ruleset.ts new file mode 100644 index 0000000000000..14416a50b2697 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/endpoint/ruleset.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { RuleSetObject } from "@smithy/types"; + +export const ruleSet: RuleSetObject = { + version: "1.0", + parameters: { + endpoint: { + type: "string", + builtIn: "SDK::Endpoint", + documentation: "Endpoint used for making requests. Should be formatted as a URI.", + }, + }, + rules: [ + { + conditions: [ + { + fn: "isSet", + argv: [ + { + ref: "endpoint", + }, + ], + }, + ], + endpoint: { + url: { + ref: "endpoint", + }, + }, + type: "endpoint", + }, + { + conditions: [], + error: "(default endpointRuleSet) endpoint is not set - you must configure an endpoint.", + type: "error", + }, + ], +}; diff --git a/private/aws-protocoltests-ec2-schema/src/extensionConfiguration.ts b/private/aws-protocoltests-ec2-schema/src/extensionConfiguration.ts new file mode 100644 index 0000000000000..89162f1fe3c0b --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface EC2ProtocolExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/private/aws-protocoltests-ec2-schema/src/index.ts b/private/aws-protocoltests-ec2-schema/src/index.ts new file mode 100644 index 0000000000000..7c269a8f87594 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/index.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + * An EC2 query service that sends query requests and XML responses. + * + * @packageDocumentation + */ +export * from "./EC2ProtocolClient"; +export * from "./EC2Protocol"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { EC2ProtocolExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { EC2ProtocolServiceException } from "./models/EC2ProtocolServiceException"; diff --git a/private/aws-protocoltests-ec2-schema/src/models/EC2ProtocolServiceException.ts b/private/aws-protocoltests-ec2-schema/src/models/EC2ProtocolServiceException.ts new file mode 100644 index 0000000000000..7ca494829e992 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/models/EC2ProtocolServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from EC2Protocol service. + */ +export class EC2ProtocolServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, EC2ProtocolServiceException.prototype); + } +} diff --git a/private/aws-protocoltests-ec2-schema/src/models/index.ts b/private/aws-protocoltests-ec2-schema/src/models/index.ts new file mode 100644 index 0000000000000..9eaceb12865f8 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/private/aws-protocoltests-ec2-schema/src/models/models_0.ts b/private/aws-protocoltests-ec2-schema/src/models/models_0.ts new file mode 100644 index 0000000000000..0b6305e9991ff --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/models/models_0.ts @@ -0,0 +1,342 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +import { EC2ProtocolServiceException as __BaseException } from "./EC2ProtocolServiceException"; + +/** + * @public + */ +export interface DatetimeOffsetsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputInput {} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputOutput {} + +/** + * @public + */ +export interface HostLabelInput { + label: string | undefined; +} + +/** + * @public + */ +export interface FractionalSecondsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface ComplexNestedErrorData { + Foo?: string | undefined; +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name: "ComplexError" = "ComplexError"; + readonly $fault: "client" = "client"; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * @public + */ +export interface GreetingWithErrorsOutput { + greeting?: string | undefined; +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name: "InvalidGreeting" = "InvalidGreeting"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface IgnoresWrappingXmlNameOutput { + foo?: string | undefined; +} + +/** + * @public + */ +export interface NoInputAndOutputOutput {} + +/** + * @public + */ +export interface PutWithContentEncodingInput { + encoding?: string | undefined; + data?: string | undefined; +} + +/** + * @public + */ +export interface QueryIdempotencyTokenAutoFillInput { + token?: string | undefined; +} + +/** + * @public + */ +export interface GreetingStruct { + hi?: string | undefined; +} + +/** + * @public + */ +export interface NestedStructWithList { + ListArg?: string[] | undefined; +} + +/** + * @public + */ +export interface QueryListsInput { + ListArg?: string[] | undefined; + ComplexListArg?: GreetingStruct[] | undefined; + ListArgWithXmlNameMember?: string[] | undefined; + ListArgWithXmlName?: string[] | undefined; + NestedWithList?: NestedStructWithList | undefined; +} + +/** + * @public + */ +export interface QueryTimestampsInput { + normalFormat?: Date | undefined; + epochMember?: Date | undefined; + epochTarget?: Date | undefined; +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +/** + * @public + */ +export interface SimpleInputParamsInput { + Foo?: string | undefined; + Bar?: string | undefined; + Baz?: boolean | undefined; + Bam?: number | undefined; + FloatValue?: number | undefined; + Boo?: number | undefined; + Qux?: Uint8Array | undefined; + FooEnum?: FooEnum | undefined; + HasQueryName?: string | undefined; + HasQueryAndXmlName?: string | undefined; + UsesXmlName?: string | undefined; +} + +/** + * @public + */ +export interface SimpleScalarXmlPropertiesOutput { + stringValue?: string | undefined; + emptyStringValue?: string | undefined; + trueBooleanValue?: boolean | undefined; + falseBooleanValue?: boolean | undefined; + byteValue?: number | undefined; + shortValue?: number | undefined; + integerValue?: number | undefined; + longValue?: number | undefined; + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export interface XmlBlobsOutput { + data?: Uint8Array | undefined; +} + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} + +/** + * @public + */ +export interface StructureListMember { + a?: string | undefined; + b?: string | undefined; +} + +/** + * @public + */ +export interface XmlListsOutput { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + renamedListMembers?: string[] | undefined; + flattenedList?: string[] | undefined; + flattenedList2?: string[] | undefined; + flattenedListWithMemberNamespace?: string[] | undefined; + flattenedListWithNamespace?: string[] | undefined; + structureList?: StructureListMember[] | undefined; +} + +/** + * @public + */ +export interface XmlEnumsOutput { + fooEnum1?: FooEnum | undefined; + fooEnum2?: FooEnum | undefined; + fooEnum3?: FooEnum | undefined; + fooEnumList?: FooEnum[] | undefined; + fooEnumSet?: FooEnum[] | undefined; + fooEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlIntEnumsOutput { + intEnum1?: IntegerEnum | undefined; + intEnum2?: IntegerEnum | undefined; + intEnum3?: IntegerEnum | undefined; + intEnumList?: IntegerEnum[] | undefined; + intEnumSet?: IntegerEnum[] | undefined; + intEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlNamespaceNested { + foo?: string | undefined; + values?: string[] | undefined; +} + +/** + * @public + */ +export interface XmlNamespacesOutput { + nested?: XmlNamespaceNested | undefined; +} + +/** + * @public + */ +export interface XmlTimestampsOutput { + normal?: Date | undefined; + dateTime?: Date | undefined; + dateTimeOnTarget?: Date | undefined; + epochSeconds?: Date | undefined; + epochSecondsOnTarget?: Date | undefined; + httpDate?: Date | undefined; + httpDateOnTarget?: Date | undefined; +} + +/** + * @public + */ +export interface StructArg { + StringArg?: string | undefined; + OtherArg?: boolean | undefined; + RecursiveArg?: StructArg | undefined; +} + +/** + * @public + */ +export interface NestedStructuresInput { + Nested?: StructArg | undefined; +} + +/** + * @public + */ +export interface RecursiveXmlShapesOutputNested1 { + foo?: string | undefined; + nested?: RecursiveXmlShapesOutputNested2 | undefined; +} + +/** + * @public + */ +export interface RecursiveXmlShapesOutputNested2 { + bar?: string | undefined; + recursiveMember?: RecursiveXmlShapesOutputNested1 | undefined; +} + +/** + * @public + */ +export interface RecursiveXmlShapesOutput { + nested?: RecursiveXmlShapesOutputNested1 | undefined; +} diff --git a/private/aws-protocoltests-ec2-schema/src/protocols/Aws_ec2.ts b/private/aws-protocoltests-ec2-schema/src/protocols/Aws_ec2.ts new file mode 100644 index 0000000000000..52b684eedee79 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/protocols/Aws_ec2.ts @@ -0,0 +1,2085 @@ +// smithy-typescript generated code +import { parseXmlBody as parseBody, parseXmlErrorBody as parseErrorBody } from "@aws-sdk/core"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, + isValidHostname as __isValidHostname, +} from "@smithy/protocol-http"; +import { + collectBody, + decorateServiceException as __decorateServiceException, + expectNonNull as __expectNonNull, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + getArrayIfSingleItem as __getArrayIfSingleItem, + parseBoolean as __parseBoolean, + parseEpochTimestamp as __parseEpochTimestamp, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime as __parseRfc7231DateTime, + serializeDateTime as __serializeDateTime, + serializeFloat as __serializeFloat, + strictParseByte as __strictParseByte, + strictParseFloat as __strictParseFloat, + strictParseInt32 as __strictParseInt32, + strictParseLong as __strictParseLong, + strictParseShort as __strictParseShort, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + HeaderBag as __HeaderBag, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "../commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "../commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "../commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "../commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "../commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "../commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "../commands/HostWithPathOperationCommand"; +import { + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, +} from "../commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommandInput, NestedStructuresCommandOutput } from "../commands/NestedStructuresCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "../commands/NoInputAndOutputCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "../commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "../commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommandInput, QueryListsCommandOutput } from "../commands/QueryListsCommand"; +import { QueryTimestampsCommandInput, QueryTimestampsCommandOutput } from "../commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommandInput, RecursiveXmlShapesCommandOutput } from "../commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommandInput, SimpleInputParamsCommandOutput } from "../commands/SimpleInputParamsCommand"; +import { + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, +} from "../commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommandInput, XmlBlobsCommandOutput } from "../commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommandInput, XmlEmptyBlobsCommandOutput } from "../commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommandInput, XmlEmptyListsCommandOutput } from "../commands/XmlEmptyListsCommand"; +import { XmlEnumsCommandInput, XmlEnumsCommandOutput } from "../commands/XmlEnumsCommand"; +import { XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "../commands/XmlIntEnumsCommand"; +import { XmlListsCommandInput, XmlListsCommandOutput } from "../commands/XmlListsCommand"; +import { XmlNamespacesCommandInput, XmlNamespacesCommandOutput } from "../commands/XmlNamespacesCommand"; +import { XmlTimestampsCommandInput, XmlTimestampsCommandOutput } from "../commands/XmlTimestampsCommand"; +import { EC2ProtocolServiceException as __BaseException } from "../models/EC2ProtocolServiceException"; +import { + ComplexError, + ComplexNestedErrorData, + DatetimeOffsetsOutput, + EmptyInputAndEmptyOutputInput, + EmptyInputAndEmptyOutputOutput, + FooEnum, + FractionalSecondsOutput, + GreetingStruct, + GreetingWithErrorsOutput, + HostLabelInput, + IgnoresWrappingXmlNameOutput, + IntegerEnum, + InvalidGreeting, + NestedStructuresInput, + NestedStructWithList, + NoInputAndOutputOutput, + PutWithContentEncodingInput, + QueryIdempotencyTokenAutoFillInput, + QueryListsInput, + QueryTimestampsInput, + RecursiveXmlShapesOutput, + RecursiveXmlShapesOutputNested1, + RecursiveXmlShapesOutputNested2, + SimpleInputParamsInput, + SimpleScalarXmlPropertiesOutput, + StructArg, + StructureListMember, + XmlBlobsOutput, + XmlEnumsOutput, + XmlIntEnumsOutput, + XmlListsOutput, + XmlNamespaceNested, + XmlNamespacesOutput, + XmlTimestampsOutput, +} from "../models/models_0"; + +/** + * serializeAws_ec2DatetimeOffsetsCommand + */ +export const se_DatetimeOffsetsCommand = async ( + input: DatetimeOffsetsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _DO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2EmptyInputAndEmptyOutputCommand + */ +export const se_EmptyInputAndEmptyOutputCommand = async ( + input: EmptyInputAndEmptyOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_EmptyInputAndEmptyOutputInput(input, context), + [_A]: _EIAEO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2EndpointOperationCommand + */ +export const se_EndpointOperationCommand = async ( + input: EndpointOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _EO, + [_V]: _, + }); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo." + resolvedHostname; + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_ec2EndpointWithHostLabelOperationCommand + */ +export const se_EndpointWithHostLabelOperationCommand = async ( + input: EndpointWithHostLabelOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_HostLabelInput(input, context), + [_A]: _EWHLO, + [_V]: _, + }); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo.{label}." + resolvedHostname; + if (input.label === undefined) { + throw new Error("Empty value provided for input host prefix: label."); + } + resolvedHostname = resolvedHostname.replace("{label}", input.label!); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_ec2FractionalSecondsCommand + */ +export const se_FractionalSecondsCommand = async ( + input: FractionalSecondsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _FS, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2GreetingWithErrorsCommand + */ +export const se_GreetingWithErrorsCommand = async ( + input: GreetingWithErrorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _GWE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2HostWithPathOperationCommand + */ +export const se_HostWithPathOperationCommand = async ( + input: HostWithPathOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _HWPO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2IgnoresWrappingXmlNameCommand + */ +export const se_IgnoresWrappingXmlNameCommand = async ( + input: IgnoresWrappingXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _IWXN, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2NestedStructuresCommand + */ +export const se_NestedStructuresCommand = async ( + input: NestedStructuresCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_NestedStructuresInput(input, context), + [_A]: _NS, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2NoInputAndOutputCommand + */ +export const se_NoInputAndOutputCommand = async ( + input: NoInputAndOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _NIAO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2PutWithContentEncodingCommand + */ +export const se_PutWithContentEncodingCommand = async ( + input: PutWithContentEncodingCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_PutWithContentEncodingInput(input, context), + [_A]: _PWCE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2QueryIdempotencyTokenAutoFillCommand + */ +export const se_QueryIdempotencyTokenAutoFillCommand = async ( + input: QueryIdempotencyTokenAutoFillCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_QueryIdempotencyTokenAutoFillInput(input, context), + [_A]: _QITAF, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2QueryListsCommand + */ +export const se_QueryListsCommand = async ( + input: QueryListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_QueryListsInput(input, context), + [_A]: _QL, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2QueryTimestampsCommand + */ +export const se_QueryTimestampsCommand = async ( + input: QueryTimestampsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_QueryTimestampsInput(input, context), + [_A]: _QT, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2RecursiveXmlShapesCommand + */ +export const se_RecursiveXmlShapesCommand = async ( + input: RecursiveXmlShapesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _RXS, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2SimpleInputParamsCommand + */ +export const se_SimpleInputParamsCommand = async ( + input: SimpleInputParamsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_SimpleInputParamsInput(input, context), + [_A]: _SIP, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2SimpleScalarXmlPropertiesCommand + */ +export const se_SimpleScalarXmlPropertiesCommand = async ( + input: SimpleScalarXmlPropertiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _SSXP, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlBlobsCommand + */ +export const se_XmlBlobsCommand = async ( + input: XmlBlobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XB, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlEmptyBlobsCommand + */ +export const se_XmlEmptyBlobsCommand = async ( + input: XmlEmptyBlobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XEB, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlEmptyListsCommand + */ +export const se_XmlEmptyListsCommand = async ( + input: XmlEmptyListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XEL, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlEnumsCommand + */ +export const se_XmlEnumsCommand = async ( + input: XmlEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlIntEnumsCommand + */ +export const se_XmlIntEnumsCommand = async ( + input: XmlIntEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XIE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlListsCommand + */ +export const se_XmlListsCommand = async ( + input: XmlListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XL, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlNamespacesCommand + */ +export const se_XmlNamespacesCommand = async ( + input: XmlNamespacesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XN, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_ec2XmlTimestampsCommand + */ +export const se_XmlTimestampsCommand = async ( + input: XmlTimestampsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XT, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * deserializeAws_ec2DatetimeOffsetsCommand + */ +export const de_DatetimeOffsetsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DatetimeOffsetsOutput(data, context); + const response: DatetimeOffsetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2EmptyInputAndEmptyOutputCommand + */ +export const de_EmptyInputAndEmptyOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EmptyInputAndEmptyOutputOutput(data, context); + const response: EmptyInputAndEmptyOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2EndpointOperationCommand + */ +export const de_EndpointOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2EndpointWithHostLabelOperationCommand + */ +export const de_EndpointWithHostLabelOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointWithHostLabelOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2FractionalSecondsCommand + */ +export const de_FractionalSecondsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FractionalSecondsOutput(data, context); + const response: FractionalSecondsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2GreetingWithErrorsCommand + */ +export const de_GreetingWithErrorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GreetingWithErrorsOutput(data, context); + const response: GreetingWithErrorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2HostWithPathOperationCommand + */ +export const de_HostWithPathOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: HostWithPathOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2IgnoresWrappingXmlNameCommand + */ +export const de_IgnoresWrappingXmlNameCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_IgnoresWrappingXmlNameOutput(data, context); + const response: IgnoresWrappingXmlNameCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2NestedStructuresCommand + */ +export const de_NestedStructuresCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: NestedStructuresCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2NoInputAndOutputCommand + */ +export const de_NoInputAndOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_NoInputAndOutputOutput(data, context); + const response: NoInputAndOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2PutWithContentEncodingCommand + */ +export const de_PutWithContentEncodingCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: PutWithContentEncodingCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2QueryIdempotencyTokenAutoFillCommand + */ +export const de_QueryIdempotencyTokenAutoFillCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: QueryIdempotencyTokenAutoFillCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2QueryListsCommand + */ +export const de_QueryListsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: QueryListsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2QueryTimestampsCommand + */ +export const de_QueryTimestampsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: QueryTimestampsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2RecursiveXmlShapesCommand + */ +export const de_RecursiveXmlShapesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RecursiveXmlShapesOutput(data, context); + const response: RecursiveXmlShapesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2SimpleInputParamsCommand + */ +export const de_SimpleInputParamsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: SimpleInputParamsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_ec2SimpleScalarXmlPropertiesCommand + */ +export const de_SimpleScalarXmlPropertiesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SimpleScalarXmlPropertiesOutput(data, context); + const response: SimpleScalarXmlPropertiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlBlobsCommand + */ +export const de_XmlBlobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlBlobsOutput(data, context); + const response: XmlBlobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlEmptyBlobsCommand + */ +export const de_XmlEmptyBlobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlBlobsOutput(data, context); + const response: XmlEmptyBlobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlEmptyListsCommand + */ +export const de_XmlEmptyListsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlListsOutput(data, context); + const response: XmlEmptyListsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlEnumsCommand + */ +export const de_XmlEnumsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlEnumsOutput(data, context); + const response: XmlEnumsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlIntEnumsCommand + */ +export const de_XmlIntEnumsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlIntEnumsOutput(data, context); + const response: XmlIntEnumsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlListsCommand + */ +export const de_XmlListsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlListsOutput(data, context); + const response: XmlListsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlNamespacesCommand + */ +export const de_XmlNamespacesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlNamespacesOutput(data, context); + const response: XmlNamespacesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_ec2XmlTimestampsCommand + */ +export const de_XmlTimestampsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlTimestampsOutput(data, context); + const response: XmlTimestampsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Aws_ec2CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadEc2ErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.ec2#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.ec2#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Errors.Error, + errorCode, + }) as never; + } +}; + +/** + * deserializeAws_ec2ComplexErrorRes + */ +const de_ComplexErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_ComplexError(body.Errors.Error, context); + const exception = new ComplexError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_ec2InvalidGreetingRes + */ +const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_InvalidGreeting(body.Errors.Error, context); + const exception = new InvalidGreeting({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * serializeAws_ec2EmptyInputAndEmptyOutputInput + */ +const se_EmptyInputAndEmptyOutputInput = (input: EmptyInputAndEmptyOutputInput, context: __SerdeContext): any => { + const entries: any = {}; + return entries; +}; + +/** + * serializeAws_ec2HostLabelInput + */ +const se_HostLabelInput = (input: HostLabelInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_l] != null) { + entries[_L] = input[_l]; + } + return entries; +}; + +/** + * serializeAws_ec2ListWithXmlName + */ +const se_ListWithXmlName = (input: string[], context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + entries[`Item.${counter}`] = entry; + counter++; + } + return entries; +}; + +/** + * serializeAws_ec2NestedStructuresInput + */ +const se_NestedStructuresInput = (input: NestedStructuresInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_N] != null) { + const memberEntries = se_StructArg(input[_N], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Nested.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_ec2NestedStructWithList + */ +const se_NestedStructWithList = (input: NestedStructWithList, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_LA] != null) { + const memberEntries = se_StringList(input[_LA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ListArg.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_ec2PutWithContentEncodingInput + */ +const se_PutWithContentEncodingInput = (input: PutWithContentEncodingInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_e] != null) { + entries[_E] = input[_e]; + } + if (input[_d] != null) { + entries[_D] = input[_d]; + } + return entries; +}; + +/** + * serializeAws_ec2QueryIdempotencyTokenAutoFillInput + */ +const se_QueryIdempotencyTokenAutoFillInput = ( + input: QueryIdempotencyTokenAutoFillInput, + context: __SerdeContext +): any => { + const entries: any = {}; + if (input[_t] === undefined) { + input[_t] = generateIdempotencyToken(); + } + if (input[_t] != null) { + entries[_T] = input[_t]; + } + return entries; +}; + +/** + * serializeAws_ec2QueryListsInput + */ +const se_QueryListsInput = (input: QueryListsInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_LA] != null) { + const memberEntries = se_StringList(input[_LA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ListArg.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_CLA] != null) { + const memberEntries = se_GreetingList(input[_CLA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ComplexListArg.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_LAWXNM] != null) { + const memberEntries = se_ListWithXmlName(input[_LAWXNM], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ListArgWithXmlNameMember.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_LAWXN] != null) { + const memberEntries = se_ListWithXmlName(input[_LAWXN], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Hi.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_NWL] != null) { + const memberEntries = se_NestedStructWithList(input[_NWL], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `NestedWithList.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_ec2QueryTimestampsInput + */ +const se_QueryTimestampsInput = (input: QueryTimestampsInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_nF] != null) { + entries[_NF] = __serializeDateTime(input[_nF]); + } + if (input[_eM] != null) { + entries[_EM] = input[_eM].getTime() / 1_000; + } + if (input[_eT] != null) { + entries[_ET] = input[_eT].getTime() / 1_000; + } + return entries; +}; + +/** + * serializeAws_ec2SimpleInputParamsInput + */ +const se_SimpleInputParamsInput = (input: SimpleInputParamsInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_F] != null) { + entries[_F] = input[_F]; + } + if (input[_B] != null) { + entries[_B] = input[_B]; + } + if (input[_Ba] != null) { + entries[_Ba] = input[_Ba]; + } + if (input[_Bam] != null) { + entries[_Bam] = input[_Bam]; + } + if (input[_FV] != null) { + entries[_FV] = __serializeFloat(input[_FV]); + } + if (input[_Bo] != null) { + entries[_Bo] = __serializeFloat(input[_Bo]); + } + if (input[_Q] != null) { + entries[_Q] = context.base64Encoder(input[_Q]); + } + if (input[_FE] != null) { + entries[_FE] = input[_FE]; + } + if (input[_HQN] != null) { + entries[_HQN] = input[_HQN]; + } + if (input[_HQAXN] != null) { + entries[_HQAXN] = input[_HQAXN]; + } + if (input[_UXN] != null) { + entries[_UXN] = input[_UXN]; + } + return entries; +}; + +/** + * serializeAws_ec2StructArg + */ +const se_StructArg = (input: StructArg, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_SA] != null) { + entries[_SA] = input[_SA]; + } + if (input[_OA] != null) { + entries[_OA] = input[_OA]; + } + if (input[_RA] != null) { + const memberEntries = se_StructArg(input[_RA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `RecursiveArg.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_ec2GreetingList + */ +const se_GreetingList = (input: GreetingStruct[], context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + const memberEntries = se_GreetingStruct(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`Member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}; + +/** + * serializeAws_ec2GreetingStruct + */ +const se_GreetingStruct = (input: GreetingStruct, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_h] != null) { + entries[_H] = input[_h]; + } + return entries; +}; + +/** + * serializeAws_ec2StringList + */ +const se_StringList = (input: string[], context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + entries[`Member.${counter}`] = entry; + counter++; + } + return entries; +}; + +/** + * deserializeAws_ec2ComplexError + */ +const de_ComplexError = (output: any, context: __SerdeContext): ComplexError => { + const contents: any = {}; + if (output[_TL] != null) { + contents[_TL] = __expectString(output[_TL]); + } + if (output[_N] != null) { + contents[_N] = de_ComplexNestedErrorData(output[_N], context); + } + return contents; +}; + +/** + * deserializeAws_ec2ComplexNestedErrorData + */ +const de_ComplexNestedErrorData = (output: any, context: __SerdeContext): ComplexNestedErrorData => { + const contents: any = {}; + if (output[_F] != null) { + contents[_F] = __expectString(output[_F]); + } + return contents; +}; + +/** + * deserializeAws_ec2DatetimeOffsetsOutput + */ +const de_DatetimeOffsetsOutput = (output: any, context: __SerdeContext): DatetimeOffsetsOutput => { + const contents: any = {}; + if (output[_da] != null) { + contents[_da] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_da])); + } + return contents; +}; + +/** + * deserializeAws_ec2EmptyInputAndEmptyOutputOutput + */ +const de_EmptyInputAndEmptyOutputOutput = (output: any, context: __SerdeContext): EmptyInputAndEmptyOutputOutput => { + const contents: any = {}; + return contents; +}; + +/** + * deserializeAws_ec2FractionalSecondsOutput + */ +const de_FractionalSecondsOutput = (output: any, context: __SerdeContext): FractionalSecondsOutput => { + const contents: any = {}; + if (output[_da] != null) { + contents[_da] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_da])); + } + return contents; +}; + +/** + * deserializeAws_ec2GreetingWithErrorsOutput + */ +const de_GreetingWithErrorsOutput = (output: any, context: __SerdeContext): GreetingWithErrorsOutput => { + const contents: any = {}; + if (output[_g] != null) { + contents[_g] = __expectString(output[_g]); + } + return contents; +}; + +/** + * deserializeAws_ec2IgnoresWrappingXmlNameOutput + */ +const de_IgnoresWrappingXmlNameOutput = (output: any, context: __SerdeContext): IgnoresWrappingXmlNameOutput => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + return contents; +}; + +/** + * deserializeAws_ec2InvalidGreeting + */ +const de_InvalidGreeting = (output: any, context: __SerdeContext): InvalidGreeting => { + const contents: any = {}; + if (output[_M] != null) { + contents[_M] = __expectString(output[_M]); + } + return contents; +}; + +/** + * deserializeAws_ec2ListWithMemberNamespace + */ +const de_ListWithMemberNamespace = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2ListWithNamespace + */ +const de_ListWithNamespace = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2NoInputAndOutputOutput + */ +const de_NoInputAndOutputOutput = (output: any, context: __SerdeContext): NoInputAndOutputOutput => { + const contents: any = {}; + return contents; +}; + +/** + * deserializeAws_ec2RecursiveXmlShapesOutput + */ +const de_RecursiveXmlShapesOutput = (output: any, context: __SerdeContext): RecursiveXmlShapesOutput => { + const contents: any = {}; + if (output[_n] != null) { + contents[_n] = de_RecursiveXmlShapesOutputNested1(output[_n], context); + } + return contents; +}; + +/** + * deserializeAws_ec2RecursiveXmlShapesOutputNested1 + */ +const de_RecursiveXmlShapesOutputNested1 = (output: any, context: __SerdeContext): RecursiveXmlShapesOutputNested1 => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + if (output[_n] != null) { + contents[_n] = de_RecursiveXmlShapesOutputNested2(output[_n], context); + } + return contents; +}; + +/** + * deserializeAws_ec2RecursiveXmlShapesOutputNested2 + */ +const de_RecursiveXmlShapesOutputNested2 = (output: any, context: __SerdeContext): RecursiveXmlShapesOutputNested2 => { + const contents: any = {}; + if (output[_b] != null) { + contents[_b] = __expectString(output[_b]); + } + if (output[_rM] != null) { + contents[_rM] = de_RecursiveXmlShapesOutputNested1(output[_rM], context); + } + return contents; +}; + +/** + * deserializeAws_ec2RenamedListMembers + */ +const de_RenamedListMembers = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2SimpleScalarXmlPropertiesOutput + */ +const de_SimpleScalarXmlPropertiesOutput = (output: any, context: __SerdeContext): SimpleScalarXmlPropertiesOutput => { + const contents: any = {}; + if (output[_sV] != null) { + contents[_sV] = __expectString(output[_sV]); + } + if (output[_eSV] != null) { + contents[_eSV] = __expectString(output[_eSV]); + } + if (output[_tBV] != null) { + contents[_tBV] = __parseBoolean(output[_tBV]); + } + if (output[_fBV] != null) { + contents[_fBV] = __parseBoolean(output[_fBV]); + } + if (output[_bV] != null) { + contents[_bV] = __strictParseByte(output[_bV]) as number; + } + if (output[_sVh] != null) { + contents[_sVh] = __strictParseShort(output[_sVh]) as number; + } + if (output[_iV] != null) { + contents[_iV] = __strictParseInt32(output[_iV]) as number; + } + if (output[_lV] != null) { + contents[_lV] = __strictParseLong(output[_lV]) as number; + } + if (output[_fV] != null) { + contents[_fV] = __strictParseFloat(output[_fV]) as number; + } + if (output[_DD] != null) { + contents[_dV] = __strictParseFloat(output[_DD]) as number; + } + return contents; +}; + +/** + * deserializeAws_ec2StructureList + */ +const de_StructureList = (output: any, context: __SerdeContext): StructureListMember[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StructureListMember(entry, context); + }); +}; + +/** + * deserializeAws_ec2StructureListMember + */ +const de_StructureListMember = (output: any, context: __SerdeContext): StructureListMember => { + const contents: any = {}; + if (output[_v] != null) { + contents[_a] = __expectString(output[_v]); + } + if (output[_o] != null) { + contents[_b_] = __expectString(output[_o]); + } + return contents; +}; + +/** + * deserializeAws_ec2XmlBlobsOutput + */ +const de_XmlBlobsOutput = (output: any, context: __SerdeContext): XmlBlobsOutput => { + const contents: any = {}; + if (output[_d] != null) { + contents[_d] = context.base64Decoder(output[_d]); + } + return contents; +}; + +/** + * deserializeAws_ec2XmlEnumsOutput + */ +const de_XmlEnumsOutput = (output: any, context: __SerdeContext): XmlEnumsOutput => { + const contents: any = {}; + if (output[_fE] != null) { + contents[_fE] = __expectString(output[_fE]); + } + if (output[_fEo] != null) { + contents[_fEo] = __expectString(output[_fEo]); + } + if (output[_fEoo] != null) { + contents[_fEoo] = __expectString(output[_fEoo]); + } + if (output.fooEnumList === "") { + contents[_fEL] = []; + } else if (output[_fEL] != null && output[_fEL][_m] != null) { + contents[_fEL] = de_FooEnumList(__getArrayIfSingleItem(output[_fEL][_m]), context); + } + if (output.fooEnumSet === "") { + contents[_fES] = []; + } else if (output[_fES] != null && output[_fES][_m] != null) { + contents[_fES] = de_FooEnumSet(__getArrayIfSingleItem(output[_fES][_m]), context); + } + if (output.fooEnumMap === "") { + contents[_fEM] = {}; + } else if (output[_fEM] != null && output[_fEM][_en] != null) { + contents[_fEM] = de_FooEnumMap(__getArrayIfSingleItem(output[_fEM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_ec2XmlIntEnumsOutput + */ +const de_XmlIntEnumsOutput = (output: any, context: __SerdeContext): XmlIntEnumsOutput => { + const contents: any = {}; + if (output[_iE] != null) { + contents[_iE] = __strictParseInt32(output[_iE]) as number; + } + if (output[_iEn] != null) { + contents[_iEn] = __strictParseInt32(output[_iEn]) as number; + } + if (output[_iEnt] != null) { + contents[_iEnt] = __strictParseInt32(output[_iEnt]) as number; + } + if (output.intEnumList === "") { + contents[_iEL] = []; + } else if (output[_iEL] != null && output[_iEL][_m] != null) { + contents[_iEL] = de_IntegerEnumList(__getArrayIfSingleItem(output[_iEL][_m]), context); + } + if (output.intEnumSet === "") { + contents[_iES] = []; + } else if (output[_iES] != null && output[_iES][_m] != null) { + contents[_iES] = de_IntegerEnumSet(__getArrayIfSingleItem(output[_iES][_m]), context); + } + if (output.intEnumMap === "") { + contents[_iEM] = {}; + } else if (output[_iEM] != null && output[_iEM][_en] != null) { + contents[_iEM] = de_IntegerEnumMap(__getArrayIfSingleItem(output[_iEM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_ec2XmlListsOutput + */ +const de_XmlListsOutput = (output: any, context: __SerdeContext): XmlListsOutput => { + const contents: any = {}; + if (output.stringList === "") { + contents[_sL] = []; + } else if (output[_sL] != null && output[_sL][_m] != null) { + contents[_sL] = de_StringList(__getArrayIfSingleItem(output[_sL][_m]), context); + } + if (output.stringSet === "") { + contents[_sS] = []; + } else if (output[_sS] != null && output[_sS][_m] != null) { + contents[_sS] = de_StringSet(__getArrayIfSingleItem(output[_sS][_m]), context); + } + if (output.integerList === "") { + contents[_iL] = []; + } else if (output[_iL] != null && output[_iL][_m] != null) { + contents[_iL] = de_IntegerList(__getArrayIfSingleItem(output[_iL][_m]), context); + } + if (output.booleanList === "") { + contents[_bL] = []; + } else if (output[_bL] != null && output[_bL][_m] != null) { + contents[_bL] = de_BooleanList(__getArrayIfSingleItem(output[_bL][_m]), context); + } + if (output.timestampList === "") { + contents[_tL] = []; + } else if (output[_tL] != null && output[_tL][_m] != null) { + contents[_tL] = de_TimestampList(__getArrayIfSingleItem(output[_tL][_m]), context); + } + if (output.enumList === "") { + contents[_eL] = []; + } else if (output[_eL] != null && output[_eL][_m] != null) { + contents[_eL] = de_FooEnumList(__getArrayIfSingleItem(output[_eL][_m]), context); + } + if (output.intEnumList === "") { + contents[_iEL] = []; + } else if (output[_iEL] != null && output[_iEL][_m] != null) { + contents[_iEL] = de_IntegerEnumList(__getArrayIfSingleItem(output[_iEL][_m]), context); + } + if (output.nestedStringList === "") { + contents[_nSL] = []; + } else if (output[_nSL] != null && output[_nSL][_m] != null) { + contents[_nSL] = de_NestedStringList(__getArrayIfSingleItem(output[_nSL][_m]), context); + } + if (output.renamed === "") { + contents[_rLM] = []; + } else if (output[_r] != null && output[_r][_i] != null) { + contents[_rLM] = de_RenamedListMembers(__getArrayIfSingleItem(output[_r][_i]), context); + } + if (output.flattenedList === "") { + contents[_fL] = []; + } else if (output[_fL] != null) { + contents[_fL] = de_RenamedListMembers(__getArrayIfSingleItem(output[_fL]), context); + } + if (output.customName === "") { + contents[_fLl] = []; + } else if (output[_cN] != null) { + contents[_fLl] = de_RenamedListMembers(__getArrayIfSingleItem(output[_cN]), context); + } + if (output.flattenedListWithMemberNamespace === "") { + contents[_fLWMN] = []; + } else if (output[_fLWMN] != null) { + contents[_fLWMN] = de_ListWithMemberNamespace(__getArrayIfSingleItem(output[_fLWMN]), context); + } + if (output.flattenedListWithNamespace === "") { + contents[_fLWN] = []; + } else if (output[_fLWN] != null) { + contents[_fLWN] = de_ListWithNamespace(__getArrayIfSingleItem(output[_fLWN]), context); + } + if (output.myStructureList === "") { + contents[_sLt] = []; + } else if (output[_mSL] != null && output[_mSL][_i] != null) { + contents[_sLt] = de_StructureList(__getArrayIfSingleItem(output[_mSL][_i]), context); + } + return contents; +}; + +/** + * deserializeAws_ec2XmlNamespacedList + */ +const de_XmlNamespacedList = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2XmlNamespaceNested + */ +const de_XmlNamespaceNested = (output: any, context: __SerdeContext): XmlNamespaceNested => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + if (output.values === "") { + contents[_va] = []; + } else if (output[_va] != null && output[_va][_m] != null) { + contents[_va] = de_XmlNamespacedList(__getArrayIfSingleItem(output[_va][_m]), context); + } + return contents; +}; + +/** + * deserializeAws_ec2XmlNamespacesOutput + */ +const de_XmlNamespacesOutput = (output: any, context: __SerdeContext): XmlNamespacesOutput => { + const contents: any = {}; + if (output[_n] != null) { + contents[_n] = de_XmlNamespaceNested(output[_n], context); + } + return contents; +}; + +/** + * deserializeAws_ec2XmlTimestampsOutput + */ +const de_XmlTimestampsOutput = (output: any, context: __SerdeContext): XmlTimestampsOutput => { + const contents: any = {}; + if (output[_no] != null) { + contents[_no] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_no])); + } + if (output[_dT] != null) { + contents[_dT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_dT])); + } + if (output[_dTOT] != null) { + contents[_dTOT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_dTOT])); + } + if (output[_eS] != null) { + contents[_eS] = __expectNonNull(__parseEpochTimestamp(output[_eS])); + } + if (output[_eSOT] != null) { + contents[_eSOT] = __expectNonNull(__parseEpochTimestamp(output[_eSOT])); + } + if (output[_hD] != null) { + contents[_hD] = __expectNonNull(__parseRfc7231DateTime(output[_hD])); + } + if (output[_hDOT] != null) { + contents[_hDOT] = __expectNonNull(__parseRfc7231DateTime(output[_hDOT])); + } + return contents; +}; + +/** + * deserializeAws_ec2BooleanList + */ +const de_BooleanList = (output: any, context: __SerdeContext): boolean[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __parseBoolean(entry); + }); +}; + +/** + * deserializeAws_ec2FooEnumList + */ +const de_FooEnumList = (output: any, context: __SerdeContext): FooEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2FooEnumMap + */ +const de_FooEnumMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = __expectString(pair["value"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_ec2FooEnumSet + */ +const de_FooEnumSet = (output: any, context: __SerdeContext): FooEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2IntegerEnumList + */ +const de_IntegerEnumList = (output: any, context: __SerdeContext): IntegerEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_ec2IntegerEnumMap + */ +const de_IntegerEnumMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = __strictParseInt32(pair["value"]) as number; + return acc; + }, {}); +}; + +/** + * deserializeAws_ec2IntegerEnumSet + */ +const de_IntegerEnumSet = (output: any, context: __SerdeContext): IntegerEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_ec2IntegerList + */ +const de_IntegerList = (output: any, context: __SerdeContext): number[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_ec2NestedStringList + */ +const de_NestedStringList = (output: any, context: __SerdeContext): string[][] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StringList(__getArrayIfSingleItem(entry["member"]), context); + }); +}; + +/** + * deserializeAws_ec2StringList + */ +const de_StringList = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2StringSet + */ +const de_StringSet = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_ec2TimestampList + */ +const de_TimestampList = (output: any, context: __SerdeContext): Date[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectNonNull(__parseRfc3339DateTimeWithOffset(entry)); + }); +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const throwDefaultError = withBaseException(__BaseException); +const buildHttpRpcRequest = async ( + context: __SerdeContext, + headers: __HeaderBag, + path: string, + resolvedHostname: string | undefined, + body: any +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents: any = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; + +const _ = "2020-01-08"; +const _A = "Action"; +const _B = "Bar"; +const _Ba = "Baz"; +const _Bam = "Bam"; +const _Bo = "Boo"; +const _CLA = "ComplexListArg"; +const _D = "Data"; +const _DD = "DoubleDribble"; +const _DO = "DatetimeOffsets"; +const _E = "Encoding"; +const _EIAEO = "EmptyInputAndEmptyOutput"; +const _EM = "EpochMember"; +const _EO = "EndpointOperation"; +const _ET = "EpochTarget"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _F = "Foo"; +const _FE = "FooEnum"; +const _FS = "FractionalSeconds"; +const _FV = "FloatValue"; +const _GWE = "GreetingWithErrors"; +const _H = "Hi"; +const _HQAXN = "HasQueryAndXmlName"; +const _HQN = "HasQueryName"; +const _HWPO = "HostWithPathOperation"; +const _IWXN = "IgnoresWrappingXmlName"; +const _L = "Label"; +const _LA = "ListArg"; +const _LAWXN = "ListArgWithXmlName"; +const _LAWXNM = "ListArgWithXmlNameMember"; +const _M = "Message"; +const _N = "Nested"; +const _NF = "NormalFormat"; +const _NIAO = "NoInputAndOutput"; +const _NS = "NestedStructures"; +const _NWL = "NestedWithList"; +const _OA = "OtherArg"; +const _PWCE = "PutWithContentEncoding"; +const _Q = "Qux"; +const _QITAF = "QueryIdempotencyTokenAutoFill"; +const _QL = "QueryLists"; +const _QT = "QueryTimestamps"; +const _RA = "RecursiveArg"; +const _RXS = "RecursiveXmlShapes"; +const _SA = "StringArg"; +const _SIP = "SimpleInputParams"; +const _SSXP = "SimpleScalarXmlProperties"; +const _T = "Token"; +const _TL = "TopLevel"; +const _UXN = "UsesXmlName"; +const _V = "Version"; +const _XB = "XmlBlobs"; +const _XE = "XmlEnums"; +const _XEB = "XmlEmptyBlobs"; +const _XEL = "XmlEmptyLists"; +const _XIE = "XmlIntEnums"; +const _XL = "XmlLists"; +const _XN = "XmlNamespaces"; +const _XT = "XmlTimestamps"; +const _a = "a"; +const _b = "bar"; +const _bL = "booleanList"; +const _bV = "byteValue"; +const _b_ = "b"; +const _cN = "customName"; +const _d = "data"; +const _dT = "dateTime"; +const _dTOT = "dateTimeOnTarget"; +const _dV = "doubleValue"; +const _da = "datetime"; +const _e = "encoding"; +const _eL = "enumList"; +const _eM = "epochMember"; +const _eS = "epochSeconds"; +const _eSOT = "epochSecondsOnTarget"; +const _eSV = "emptyStringValue"; +const _eT = "epochTarget"; +const _en = "entry"; +const _f = "foo"; +const _fBV = "falseBooleanValue"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fL = "flattenedList"; +const _fLWMN = "flattenedListWithMemberNamespace"; +const _fLWN = "flattenedListWithNamespace"; +const _fLl = "flattenedList2"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "hi"; +const _hD = "httpDate"; +const _hDOT = "httpDateOnTarget"; +const _i = "item"; +const _iE = "intEnum1"; +const _iEL = "intEnumList"; +const _iEM = "intEnumMap"; +const _iES = "intEnumSet"; +const _iEn = "intEnum2"; +const _iEnt = "intEnum3"; +const _iL = "integerList"; +const _iV = "integerValue"; +const _l = "label"; +const _lV = "longValue"; +const _m = "member"; +const _mSL = "myStructureList"; +const _n = "nested"; +const _nF = "normalFormat"; +const _nSL = "nestedStringList"; +const _no = "normal"; +const _o = "other"; +const _r = "renamed"; +const _rLM = "renamedListMembers"; +const _rM = "recursiveMember"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sS = "stringSet"; +const _sV = "stringValue"; +const _sVh = "shortValue"; +const _t = "token"; +const _tBV = "trueBooleanValue"; +const _tL = "timestampList"; +const _v = "value"; +const _va = "values"; + +const buildFormUrlencodedString = (formEntries: Record): string => + Object.entries(formEntries) + .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) + .join("&"); + +const loadEc2ErrorCode = (output: __HttpResponse, data: any): string | undefined => { + if (data.Errors.Error?.Code !== undefined) { + return data.Errors.Error.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } +}; diff --git a/private/aws-protocoltests-ec2-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.browser.ts new file mode 100644 index 0000000000000..3bacfb1ed8a0b --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.browser.ts @@ -0,0 +1,51 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/private/aws-protocoltests-ec2-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.native.ts new file mode 100644 index 0000000000000..0656194a84669 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/private/aws-protocoltests-ec2-schema/src/runtimeConfig.shared.ts b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.shared.ts new file mode 100644 index 0000000000000..b99ff6857d335 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.shared.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { AwsEc2QueryProtocol } from "@aws-sdk/core/protocols"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultEC2ProtocolHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { + return { + apiVersion: "2020-01-08", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultEC2ProtocolHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + protocol: + config?.protocol ?? + new AwsEc2QueryProtocol({ + defaultNamespace: "aws.protocoltests.ec2", + xmlNamespace: "https://example.com/", + version: "2020-01-08", + }), + serviceId: config?.serviceId ?? "EC2 Protocol", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/private/aws-protocoltests-ec2-schema/src/runtimeConfig.ts b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.ts new file mode 100644 index 0000000000000..a59baf1e991fe --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/runtimeConfig.ts @@ -0,0 +1,81 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: + config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), + retryMode: + config?.retryMode ?? + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; diff --git a/private/aws-protocoltests-ec2-schema/src/runtimeExtensions.ts b/private/aws-protocoltests-ec2-schema/src/runtimeExtensions.ts new file mode 100644 index 0000000000000..43f57c1b52952 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/runtimeExtensions.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { EC2ProtocolExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: EC2ProtocolExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: EC2ProtocolExtensionConfiguration = Object.assign( + getAwsRegionExtensionConfiguration(runtimeConfig), + getDefaultExtensionConfiguration(runtimeConfig), + getHttpHandlerExtensionConfiguration(runtimeConfig), + getHttpAuthExtensionConfiguration(runtimeConfig) + ); + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return Object.assign( + runtimeConfig, + resolveAwsRegionExtensionConfiguration(extensionConfiguration), + resolveDefaultRuntimeConfig(extensionConfiguration), + resolveHttpHandlerRuntimeConfig(extensionConfiguration), + resolveHttpAuthRuntimeConfig(extensionConfiguration) + ); +}; diff --git a/private/aws-protocoltests-ec2-schema/src/schemas/schemas.ts b/private/aws-protocoltests-ec2-schema/src/schemas/schemas.ts new file mode 100644 index 0000000000000..314b1854b7633 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/src/schemas/schemas.ts @@ -0,0 +1,758 @@ +const _ = ""; +const _B = "Boolean"; +const _BL = "BooleanList"; +const _Ba = "Bar"; +const _Bam = "Bam"; +const _Baz = "Baz"; +const _Bl = "Blob"; +const _Bo = "Boo"; +const _By = "Byte"; +const _CE = "ComplexError"; +const _CE_ = "Content-Encoding"; +const _CLA = "ComplexListArg"; +const _CNED = "ComplexNestedErrorData"; +const _D = "Double"; +const _DD = "DoubleDribble"; +const _DO = "DatetimeOffsets"; +const _DOO = "DatetimeOffsetsOutput"; +const _DT = "DateTime"; +const _EIAEO = "EmptyInputAndEmptyOutput"; +const _EIAEOI = "EmptyInputAndEmptyOutputInput"; +const _EIAEOO = "EmptyInputAndEmptyOutputOutput"; +const _EO = "EndpointOperation"; +const _ES = "EpochSeconds"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FEL = "FooEnumList"; +const _FEM = "FooEnumMap"; +const _FES = "FooEnumSet"; +const _FS = "FractionalSeconds"; +const _FSO = "FractionalSecondsOutput"; +const _FV = "FloatValue"; +const _Fo = "Foo"; +const _GL = "GreetingList"; +const _GS = "GreetingStruct"; +const _GWE = "GreetingWithErrors"; +const _GWEO = "GreetingWithErrorsOutput"; +const _H = "Hi"; +const _HD = "HttpDate"; +const _HLI = "HostLabelInput"; +const _HQAXN = "HasQueryAndXmlName"; +const _HQN = "HasQueryName"; +const _HWPO = "HostWithPathOperation"; +const _I = "Integer"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IEM = "IntegerEnumMap"; +const _IES = "IntegerEnumSet"; +const _IG = "InvalidGreeting"; +const _IL = "IntegerList"; +const _IM = "IgnoreMe"; +const _IWXN = "IgnoresWrappingXmlName"; +const _IWXNO = "IgnoresWrappingXmlNameOutput"; +const _L = "Long"; +const _LA = "ListArg"; +const _LAWXN = "ListArgWithXmlName"; +const _LAWXNM = "ListArgWithXmlNameMember"; +const _LWMN = "ListWithMemberNamespace"; +const _LWN = "ListWithNamespace"; +const _LWXN = "ListWithXmlName"; +const _M = "Message"; +const _N = "Nested"; +const _NIAO = "NoInputAndOutput"; +const _NIAOO = "NoInputAndOutputOutput"; +const _NS = "NestedStructures"; +const _NSI = "NestedStructuresInput"; +const _NSL = "NestedStringList"; +const _NSWL = "NestedStructWithList"; +const _NWL = "NestedWithList"; +const _OA = "OtherArg"; +const _PWCE = "PutWithContentEncoding"; +const _PWCEI = "PutWithContentEncodingInput"; +const _Q = "Qux"; +const _QITAF = "QueryIdempotencyTokenAutoFill"; +const _QITAFI = "QueryIdempotencyTokenAutoFillInput"; +const _QL = "QueryLists"; +const _QLI = "QueryListsInput"; +const _QT = "QueryTimestamps"; +const _QTI = "QueryTimestampsInput"; +const _RA = "RecursiveArg"; +const _RLM = "RenamedListMembers"; +const _RXS = "RecursiveXmlShapes"; +const _RXSO = "RecursiveXmlShapesOutput"; +const _RXSON = "RecursiveXmlShapesOutputNested1"; +const _RXSONe = "RecursiveXmlShapesOutputNested2"; +const _S = "String"; +const _SA = "StructArg"; +const _SAt = "StringArg"; +const _SIP = "SimpleInputParams"; +const _SIPI = "SimpleInputParamsInput"; +const _SL = "StringList"; +const _SLM = "StructureListMember"; +const _SLt = "StructureList"; +const _SS = "StringSet"; +const _SSXP = "SimpleScalarXmlProperties"; +const _SSXPO = "SimpleScalarXmlPropertiesOutput"; +const _Sh = "Short"; +const _T = "Timestamp"; +const _TL = "TimestampList"; +const _TLo = "TopLevel"; +const _UXN = "UsesXmlName"; +const _XB = "XmlBlobs"; +const _XBO = "XmlBlobsOutput"; +const _XE = "XmlEnums"; +const _XEB = "XmlEmptyBlobs"; +const _XEL = "XmlEmptyLists"; +const _XEO = "XmlEnumsOutput"; +const _XIE = "XmlIntEnums"; +const _XIEO = "XmlIntEnumsOutput"; +const _XL = "XmlLists"; +const _XLO = "XmlListsOutput"; +const _XN = "XmlNamespaces"; +const _XNL = "XmlNamespacedList"; +const _XNN = "XmlNamespaceNested"; +const _XNO = "XmlNamespacesOutput"; +const _XT = "XmlTimestamps"; +const _XTO = "XmlTimestampsOutput"; +const _a = "a"; +const _b = "bar"; +const _bL = "booleanList"; +const _bV = "byteValue"; +const _b_ = "b"; +const _ba = "baz"; +const _c = "client"; +const _cN = "customName"; +const _d = "datetime"; +const _dT = "dateTime"; +const _dTOT = "dateTimeOnTarget"; +const _dV = "doubleValue"; +const _da = "data"; +const _e = "error"; +const _eL = "enumList"; +const _eM = "epochMember"; +const _eQN = "ec2QueryName"; +const _eS = "epochSeconds"; +const _eSOT = "epochSecondsOnTarget"; +const _eSV = "emptyStringValue"; +const _eT = "epochTarget"; +const _en = "encoding"; +const _end = "endpoint"; +const _f = "foo"; +const _fBV = "falseBooleanValue"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fL = "flattenedList"; +const _fLWMN = "flattenedListWithMemberNamespace"; +const _fLWN = "flattenedListWithNamespace"; +const _fLl = "flattenedList2"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "http://foo.com"; +const _hD = "httpDate"; +const _hDOT = "httpDateOnTarget"; +const _hH = "httpHeader"; +const _hL = "hostLabel"; +const _hQAXN = "hasQueryAndXmlName"; +const _hi = "hi"; +const _hl = "https://xml-list.example.com"; +const _hm = "https://xml-member.example.com"; +const _ht = "http://baz.com"; +const _htt = "http://qux.com"; +const _http = "http://bux.com"; +const _i = "item"; +const _iE = "intEnum1"; +const _iEL = "intEnumList"; +const _iEM = "intEnumMap"; +const _iES = "intEnumSet"; +const _iEn = "intEnum2"; +const _iEnt = "intEnum3"; +const _iL = "integerList"; +const _iV = "integerValue"; +const _l = "label"; +const _lV = "longValue"; +const _mSL = "myStructureList"; +const _n = "nested"; +const _nF = "normalFormat"; +const _nSL = "nestedStringList"; +const _no = "normal"; +const _o = "other"; +const _r = "renamed"; +const _rLM = "renamedListMembers"; +const _rM = "recursiveMember"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sS = "stringSet"; +const _sV = "stringValue"; +const _sVh = "shortValue"; +const _t = "token"; +const _tBV = "trueBooleanValue"; +const _tL = "timestampList"; +const _uXN = "usesXmlName"; +const _v = "value"; +const _va = "values"; +const _xF = "xmlFlattened"; +const _xN = "xmlName"; +const _xNm = "xmlNamespace"; +const n0 = "aws.protocoltests.ec2"; +const n1 = "aws.protocoltests.shared"; + +// smithy-typescript generated code +import { error, list, op, struct } from "@smithy/core/schema"; + +import { EC2ProtocolServiceException as __EC2ProtocolServiceException } from "../models/EC2ProtocolServiceException"; +import { ComplexError as __ComplexError, InvalidGreeting as __InvalidGreeting } from "../models/index"; + +/* eslint no-var: 0 */ + +export var ComplexError = error( + n0, + _CE, + { + [_e]: _c, + }, + [_TLo, _N], + [0, () => ComplexNestedErrorData], + + __ComplexError +); +export var ComplexNestedErrorData = struct(n0, _CNED, 0, [_Fo], [0]); +export var DatetimeOffsetsOutput = struct(n0, _DOO, 0, [_d], [5]); +export var EmptyInputAndEmptyOutputInput = struct(n0, _EIAEOI, 0, [], []); +export var EmptyInputAndEmptyOutputOutput = struct(n0, _EIAEOO, 0, [], []); +export var FractionalSecondsOutput = struct(n0, _FSO, 0, [_d], [5]); +export var GreetingWithErrorsOutput = struct(n0, _GWEO, 0, [_g], [0]); +export var HostLabelInput = struct( + n0, + _HLI, + 0, + [_l], + [ + [ + 0, + { + [_hL]: 1, + }, + ], + ] +); +export var IgnoresWrappingXmlNameOutput = struct( + n0, + _IWXNO, + { + [_xN]: _IM, + }, + [_f], + [0] +); +export var InvalidGreeting = error( + n0, + _IG, + { + [_e]: _c, + }, + [_M], + [0], + + __InvalidGreeting +); +export var NestedStructuresInput = struct(n0, _NSI, 0, [_N], [() => StructArg]); +export var NestedStructWithList = struct(n0, _NSWL, 0, [_LA], [64 | 0]); +export var NoInputAndOutputOutput = struct(n0, _NIAOO, 0, [], []); +export var PutWithContentEncodingInput = struct( + n0, + _PWCEI, + 0, + [_en, _da], + [ + [ + 0, + { + [_hH]: _CE_, + }, + ], + 0, + ] +); +export var QueryIdempotencyTokenAutoFillInput = struct(n0, _QITAFI, 0, [_t], [[0, 4]]); +export var QueryListsInput = struct( + n0, + _QLI, + 0, + [_LA, _CLA, _LAWXNM, _LAWXN, _NWL], + [ + 64 | 0, + () => GreetingList, + [() => ListWithXmlName, 0], + [ + () => ListWithXmlName, + { + [_xN]: _H, + }, + ], + () => NestedStructWithList, + ] +); +export var QueryTimestampsInput = struct(n0, _QTI, 0, [_nF, _eM, _eT], [4, 7, 7]); +export var RecursiveXmlShapesOutput = struct(n0, _RXSO, 0, [_n], [() => RecursiveXmlShapesOutputNested1]); +export var RecursiveXmlShapesOutputNested1 = struct( + n0, + _RXSON, + 0, + [_f, _n], + [0, () => RecursiveXmlShapesOutputNested2] +); +export var RecursiveXmlShapesOutputNested2 = struct( + n0, + _RXSONe, + 0, + [_b, _rM], + [0, () => RecursiveXmlShapesOutputNested1] +); +export var SimpleInputParamsInput = struct( + n0, + _SIPI, + 0, + [_Fo, _Ba, _Baz, _Bam, _FV, _Bo, _Q, _FE, _HQN, _HQAXN, _UXN], + [ + 0, + 0, + 2, + 1, + 1, + 1, + 21, + 0, + [ + 0, + { + [_eQN]: `HasQueryName`, + }, + ], + [ + 0, + { + [_eQN]: `HasQueryAndXmlName`, + [_xN]: _hQAXN, + }, + ], + [ + 0, + { + [_xN]: _uXN, + }, + ], + ] +); +export var SimpleScalarXmlPropertiesOutput = struct( + n0, + _SSXPO, + 0, + [_sV, _eSV, _tBV, _fBV, _bV, _sVh, _iV, _lV, _fV, _dV], + [ + [ + 0, + { + [_eQN]: `IgnoreMe`, + }, + ], + 0, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + [ + 1, + { + [_xN]: _DD, + }, + ], + ] +); +export var StructArg = struct(n0, _SA, 0, [_SAt, _OA, _RA], [0, 2, () => StructArg]); +export var StructureListMember = struct( + n0, + _SLM, + 0, + [_a, _b_], + [ + [ + 0, + { + [_xN]: _v, + }, + ], + [ + 0, + { + [_xN]: _o, + }, + ], + ] +); +export var XmlBlobsOutput = struct(n0, _XBO, 0, [_da], [21]); +export var XmlEnumsOutput = struct( + n0, + _XEO, + 0, + [_fE, _fEo, _fEoo, _fEL, _fES, _fEM], + [0, 0, 0, 64 | 0, 64 | 0, 128 | 0] +); +export var XmlIntEnumsOutput = struct( + n0, + _XIEO, + 0, + [_iE, _iEn, _iEnt, _iEL, _iES, _iEM], + [1, 1, 1, 64 | 1, 64 | 1, 128 | 1] +); +export var XmlListsOutput = struct( + n0, + _XLO, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _rLM, _fL, _fLl, _fLWMN, _fLWN, _sLt], + [ + 64 | 0, + 64 | 0, + 64 | 1, + 64 | 2, + 64 | 4, + 64 | 0, + 64 | 1, + list(n1, _NSL, 0, 64 | 0), + [ + () => RenamedListMembers, + { + [_xN]: _r, + }, + ], + [ + () => RenamedListMembers, + { + [_xF]: 1, + }, + ], + [ + () => RenamedListMembers, + { + [_xN]: _cN, + [_xF]: 1, + }, + ], + [ + () => ListWithMemberNamespace, + { + [_xF]: 1, + }, + ], + [ + () => ListWithNamespace, + { + [_xF]: 1, + }, + ], + [ + () => StructureList, + { + [_xN]: _mSL, + }, + ], + ] +); +export var XmlNamespaceNested = struct( + n0, + _XNN, + { + [_xNm]: [_, _h], + }, + [_f, _va], + [ + [ + 0, + { + [_xNm]: [_ba, _ht], + }, + ], + [ + () => XmlNamespacedList, + { + [_xNm]: [_, _htt], + }, + ], + ] +); +export var XmlNamespacesOutput = struct( + n0, + _XNO, + { + [_xNm]: [_, _h], + }, + [_n], + [[() => XmlNamespaceNested, 0]] +); +export var XmlTimestampsOutput = struct(n0, _XTO, 0, [_no, _dT, _dTOT, _eS, _eSOT, _hD, _hDOT], [4, 5, 5, 7, 7, 6, 6]); +export var GreetingStruct = struct(n1, _GS, 0, [_hi], [0]); +export var Unit = "unit" as const; + +export var EC2ProtocolServiceException = error( + "smithy.ts.sdk.synthetic.aws.protocoltests.ec2", + "EC2ProtocolServiceException", + 0, + [], + [], + __EC2ProtocolServiceException +); +export var ListWithMemberNamespace = list( + n0, + _LWMN, + { + [_xNm]: [_, _hl], + }, + [ + 0, + { + [_xNm]: [_, _hm], + }, + ] +); +export var ListWithNamespace = list( + n0, + _LWN, + { + [_xNm]: [_, _hl], + }, + 0 +); +export var ListWithXmlName = list(n0, _LWXN, 0, [ + 0, + { + [_xN]: _i, + }, +]); +export var RenamedListMembers = list(n0, _RLM, 0, [ + 0, + { + [_xN]: _i, + }, +]); +export var StructureList = list(n0, _SLt, 0, [ + () => StructureListMember, + { + [_xN]: _i, + }, +]); +export var XmlNamespacedList = list(n0, _XNL, 0, [ + 0, + { + [_xNm]: [_, _http], + }, +]); +export var BooleanList = 64 | 2; + +export var FooEnumList = 64 | 0; + +export var FooEnumSet = 64 | 0; + +export var GreetingList = list(n1, _GL, 0, () => GreetingStruct); +export var IntegerEnumList = 64 | 1; + +export var IntegerEnumSet = 64 | 1; + +export var IntegerList = 64 | 1; + +export var NestedStringList = list(n1, _NSL, 0, 64 | 0); +export var StringList = 64 | 0; + +export var StringSet = 64 | 0; + +export var TimestampList = 64 | 4; + +export var FooEnumMap = 128 | 0; + +export var IntegerEnumMap = 128 | 1; + +export var DatetimeOffsets = op( + n0, + _DO, + 0, + () => Unit, + () => DatetimeOffsetsOutput +); +export var EmptyInputAndEmptyOutput = op( + n0, + _EIAEO, + 0, + () => EmptyInputAndEmptyOutputInput, + () => EmptyInputAndEmptyOutputOutput +); +export var EndpointOperation = op( + n0, + _EO, + { + [_end]: ["foo."], + }, + () => Unit, + () => Unit +); +export var EndpointWithHostLabelOperation = op( + n0, + _EWHLO, + { + [_end]: ["foo.{label}."], + }, + () => HostLabelInput, + () => Unit +); +export var FractionalSeconds = op( + n0, + _FS, + 0, + () => Unit, + () => FractionalSecondsOutput +); +export var GreetingWithErrors = op( + n0, + _GWE, + 0, + () => Unit, + () => GreetingWithErrorsOutput +); +export var HostWithPathOperation = op( + n0, + _HWPO, + 0, + () => Unit, + () => Unit +); +export var IgnoresWrappingXmlName = op( + n0, + _IWXN, + 0, + () => Unit, + () => IgnoresWrappingXmlNameOutput +); +export var NestedStructures = op( + n0, + _NS, + 0, + () => NestedStructuresInput, + () => Unit +); +export var NoInputAndOutput = op( + n0, + _NIAO, + 0, + () => Unit, + () => NoInputAndOutputOutput +); +export var PutWithContentEncoding = op( + n0, + _PWCE, + 0, + () => PutWithContentEncodingInput, + () => Unit +); +export var QueryIdempotencyTokenAutoFill = op( + n0, + _QITAF, + 0, + () => QueryIdempotencyTokenAutoFillInput, + () => Unit +); +export var QueryLists = op( + n0, + _QL, + 0, + () => QueryListsInput, + () => Unit +); +export var QueryTimestamps = op( + n0, + _QT, + 0, + () => QueryTimestampsInput, + () => Unit +); +export var RecursiveXmlShapes = op( + n0, + _RXS, + 0, + () => Unit, + () => RecursiveXmlShapesOutput +); +export var SimpleInputParams = op( + n0, + _SIP, + 0, + () => SimpleInputParamsInput, + () => Unit +); +export var SimpleScalarXmlProperties = op( + n0, + _SSXP, + 0, + () => Unit, + () => SimpleScalarXmlPropertiesOutput +); +export var XmlBlobs = op( + n0, + _XB, + 0, + () => Unit, + () => XmlBlobsOutput +); +export var XmlEmptyBlobs = op( + n0, + _XEB, + 0, + () => Unit, + () => XmlBlobsOutput +); +export var XmlEmptyLists = op( + n0, + _XEL, + 0, + () => Unit, + () => XmlListsOutput +); +export var XmlEnums = op( + n0, + _XE, + 0, + () => Unit, + () => XmlEnumsOutput +); +export var XmlIntEnums = op( + n0, + _XIE, + 0, + () => Unit, + () => XmlIntEnumsOutput +); +export var XmlLists = op( + n0, + _XL, + 0, + () => Unit, + () => XmlListsOutput +); +export var XmlNamespaces = op( + n0, + _XN, + 0, + () => Unit, + () => XmlNamespacesOutput +); +export var XmlTimestamps = op( + n0, + _XT, + 0, + () => Unit, + () => XmlTimestampsOutput +); diff --git a/private/aws-protocoltests-ec2-schema/test/functional/ec2query.spec.ts b/private/aws-protocoltests-ec2-schema/test/functional/ec2query.spec.ts new file mode 100644 index 0000000000000..6ac7f55b1e221 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/test/functional/ec2query.spec.ts @@ -0,0 +1,2861 @@ +// smithy-typescript generated code +import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; +import { Encoder as __Encoder } from "@smithy/types"; +import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; +import { Readable } from "stream"; +import { expect, test as it } from "vitest"; + +import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommand } from "../../src/commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HostWithPathOperationCommand } from "../../src/commands/HostWithPathOperationCommand"; +import { IgnoresWrappingXmlNameCommand } from "../../src/commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommand } from "../../src/commands/NestedStructuresCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { PutWithContentEncodingCommand } from "../../src/commands/PutWithContentEncodingCommand"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommand } from "../../src/commands/QueryListsCommand"; +import { QueryTimestampsCommand } from "../../src/commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommand } from "../../src/commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommand } from "../../src/commands/SimpleInputParamsCommand"; +import { SimpleScalarXmlPropertiesCommand } from "../../src/commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommand } from "../../src/commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommand } from "../../src/commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommand } from "../../src/commands/XmlEmptyListsCommand"; +import { XmlEnumsCommand } from "../../src/commands/XmlEnumsCommand"; +import { XmlIntEnumsCommand } from "../../src/commands/XmlIntEnumsCommand"; +import { XmlListsCommand } from "../../src/commands/XmlListsCommand"; +import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand"; +import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand"; +import { EC2ProtocolClient } from "../../src/EC2ProtocolClient"; + +/** + * Throws an expected exception that contains the serialized request. + */ +class EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error { + constructor(readonly request: HttpRequest) { + super(); + } +} + +/** + * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a + * request. The thrown exception contains the serialized request. + */ +class RequestSerializationTestHandler implements HttpHandler { + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request)); + } + updateHttpClientConfig(key: never, value: never): void {} + httpHandlerConfigs() { + return {}; + } +} + +/** + * Returns a resolved Promise of the specified response contents. + */ +class ResponseDeserializationTestHandler implements HttpHandler { + isSuccess: boolean; + code: number; + headers: HeaderBag; + body: string | Uint8Array; + isBase64Body: boolean; + + constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) { + this.isSuccess = isSuccess; + this.code = code; + if (headers === undefined) { + this.headers = {}; + } else { + this.headers = headers; + } + if (body === undefined) { + body = ""; + } + this.body = body; + this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), "base64").toString("base64") === body; + } + + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.resolve({ + response: new HttpResponse({ + statusCode: this.code, + headers: this.headers, + body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]), + }), + }); + } + + updateHttpClientConfig(key: never, value: never): void {} + + httpHandlerConfigs() { + return {}; + } +} + +interface comparableParts { + [key: string]: string; +} + +/** + * Generates a standard map of un-equal values given input parts. + */ +const compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => { + const unequalParts: any = {}; + Object.keys(expectedParts).forEach((key) => { + if (generatedParts[key] === undefined) { + unequalParts[key] = { exp: expectedParts[key], gen: undefined }; + } else if (!equivalentContents(expectedParts[key], generatedParts[key])) { + unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] }; + } + }); + + Object.keys(generatedParts).forEach((key) => { + if (expectedParts[key] === undefined) { + unequalParts[key] = { exp: undefined, gen: generatedParts[key] }; + } + }); + + if (Object.keys(unequalParts).length !== 0) { + return unequalParts; + } + return undefined; +}; + +/** + * Compares all types for equivalent contents, doing nested + * equality checks based on non-`$metadata` + * properties that have defined values. + */ +const equivalentContents = (expected: any, generated: any): boolean => { + if (typeof (global as any).expect === "function") { + expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected)); + return true; + } + + const localExpected = expected; + + // Short circuit on equality. + if (localExpected == generated) { + return true; + } + + if (typeof expected !== "object") { + return expected === generated; + } + + // If a test fails with an issue in the below 6 lines, it's likely + // due to an issue in the nestedness or existence of the property + // being compared. + delete localExpected["$metadata"]; + delete generated["$metadata"]; + Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]); + Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]); + + const expectedProperties = Object.getOwnPropertyNames(localExpected); + const generatedProperties = Object.getOwnPropertyNames(generated); + + // Short circuit on different property counts. + if (expectedProperties.length != generatedProperties.length) { + return false; + } + + // Compare properties directly. + for (let index = 0; index < expectedProperties.length; index++) { + const propertyName = expectedProperties[index]; + if (!equivalentContents(localExpected[propertyName], generated[propertyName])) { + return false; + } + } + + return true; +}; + +const clientParams = { + region: "us-west-2", + credentials: { accessKeyId: "key", secretAccessKey: "secret" }, + endpoint: () => { + const url = new URL("https://localhost/"); + return Promise.resolve({ + hostname: url.hostname, + protocol: url.protocol, + path: url.pathname, + }) as Promise; + }, +}; + +/** + * A wrapper function that shadows `fail` from jest-jasmine2 + * (jasmine2 was replaced with circus in > v27 as the default test runner) + */ +const fail = (error?: any): never => { + throw new Error(error); +}; + +/** + * Hexadecimal to byteArray. + */ +const toBytes = (hex: string) => { + return Buffer.from(hex, "base64"); +}; + +function normalizeByteArrayType(data: any) { + // normalize float32 errors + if (typeof data === "number") { + const u = new Uint8Array(4); + const dv = new DataView(u.buffer, u.byteOffset, u.byteLength); + dv.setFloat32(0, data); + return dv.getFloat32(0); + } + if (!data || typeof data !== "object") { + return data; + } + if (data instanceof Uint8Array) { + return Uint8Array.from(data); + } + if (data instanceof String || data instanceof Boolean || data instanceof Number) { + return data.valueOf(); + } + const output = {} as any; + for (const key of Object.getOwnPropertyNames(data)) { + output[key] = normalizeByteArrayType(data[key]); + } + return output; +} + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("Ec2QueryDateTimeWithNegativeOffset:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 2019-12-16T22:48:18-01:00 + requestid + + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("Ec2QueryDateTimeWithPositiveOffset:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 2019-12-17T00:48:18+01:00 + requestid + + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty input serializes no extra query params + */ +it("Ec2QueryEmptyInputAndEmptyOutput:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyInputAndEmptyOutputCommand({} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=EmptyInputAndEmptyOutput&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Empty output + */ +it("Ec2QueryEmptyInputAndEmptyOutput:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + requestid + + ` + ), + }); + + const params: any = {}; + const command = new EmptyInputAndEmptyOutputCommand(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); +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait. + */ +it("Ec2QueryEndpointTrait:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointOperationCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.headers["host"]).toBe("foo.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=EndpointOperation&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait, and can use the host label trait to define + * further customization based on user input. + */ +it("Ec2QueryEndpointTraitWithHostLabel:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointWithHostLabelOperationCommand({ + label: "bar", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.headers["host"]).toBe("foo.bar.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=EndpointWithHostLabelOperation&Version=2020-01-08&Label=bar`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that clients can correctly parse datetime timestamps with fractional seconds + */ +it("Ec2QueryDateTimeWithFractionalSeconds:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 2000-01-02T20:34:56.123Z + requestid + + ` + ), + }); + + const params: any = {}; + const command = new FractionalSecondsCommand(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 = [ + { + datetime: new Date(9.46845296123e8 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that operations with errors successfully know how to deserialize the successful response + */ +it("Ec2GreetingWithErrors:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + Hello + requestid + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(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 = [ + { + greeting: "Hello", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses simple XML errors + */ +it("Ec2InvalidGreetingError:Error:GreetingWithErrors", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + + + InvalidGreeting + Hi + + + foo-id + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "InvalidGreeting") { + console.log(err); + fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +it("Ec2ComplexError:Error:GreetingWithErrors", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + + + ComplexError + Hi + Top level + + bar + + + + foo-id + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + TopLevel: "Top level", + Nested: { + Foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Custom endpoints supplied by users can have paths + */ +it("Ec2QueryHostWithPath:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + endpoint: "https://example.com/custom", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HostWithPathOperationCommand({}); + 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("/custom/"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=HostWithPathOperation&Version=2020-01-08`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * The xmlName trait on the output structure is ignored in the ec2 protocol + */ +it("Ec2IgnoresWrappingXmlName:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + bar + requestid + + ` + ), + }); + + const params: any = {}; + const command = new IgnoresWrappingXmlNameCommand(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 = [ + { + foo: "bar", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes nested structures using dots + */ +it("Ec2NestedStructures:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NestedStructuresCommand({ + Nested: { + StringArg: "foo", + OtherArg: true, + RecursiveArg: { + StringArg: "baz", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=NestedStructures&Version=2020-01-08&Nested.StringArg=foo&Nested.OtherArg=true&Nested.RecursiveArg.StringArg=baz`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * No input serializes no payload + */ +it("Ec2QueryNoInputAndOutput:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndOutputCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=NoInputAndOutput&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Empty output + */ +it("Ec2QueryNoInputAndOutput:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + requestid + + ` + ), + }); + + const params: any = {}; + const command = new NoInputAndOutputCommand(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); +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header. + */ +it("SDKAppliedContentEncoding_ec2Query:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header, and the + * user-provided content-encoding is NOT in the Content-Encoding header since HTTP binding + * traits are ignored in the ec2Query protocol. + * + */ +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + encoding: "custom", + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Automatically adds idempotency token when not set + */ +it("Ec2ProtocolIdempotencyTokenAutoFill:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000000", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&Token=00000000-0000-4000-8000-000000000000`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Uses the given idempotency token as-is + */ +it("Ec2ProtocolIdempotencyTokenAutoFillIsSet:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000123", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&Token=00000000-0000-4000-8000-000000000123`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes query lists. All EC2 lists are flattened. + */ +it("Ec2Lists:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + ListArg: ["foo", "bar", "baz"], + ComplexListArg: [ + { + hi: "hello", + } as any, + { + hi: "hola", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&ListArg.1=foo&ListArg.2=bar&ListArg.3=baz&ComplexListArg.1.Hi=hello&ComplexListArg.2.Hi=hola`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Does not serialize empty query lists. + */ +it("Ec2EmptyQueryLists:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + ListArg: [], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * An xmlName trait in the member of a list has no effect on the list serialization. + */ +it("Ec2ListArgWithXmlNameMember:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + ListArgWithXmlNameMember: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&ListArgWithXmlNameMember.1=A&ListArgWithXmlNameMember.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Changes the name of the list using the xmlName trait + */ +it("Ec2ListMemberWithXmlName:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + ListArgWithXmlName: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&Hi.1=A&Hi.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Nested structure with a list member + */ +it("Ec2ListNestedStructWithList:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + NestedWithList: { + ListArg: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&NestedWithList.ListArg.1=A&NestedWithList.ListArg.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes timestamps + */ +it("Ec2TimestampsInput:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryTimestampsCommand({ + normalFormat: new Date(1422172800000), + epochMember: new Date(1422172800000), + epochTarget: new Date(1422172800000), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryTimestamps&Version=2020-01-08&NormalFormat=2015-01-25T08%3A00%3A00Z&EpochMember=1422172800&EpochTarget=1422172800`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes recursive structures + */ +it("Ec2RecursiveShapes:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + + Foo1 + + Bar1 + + Foo2 + + Bar2 + + + + + requestid + + ` + ), + }); + + const params: any = {}; + const command = new RecursiveXmlShapesCommand(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 = [ + { + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + }, + }, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes strings + */ +it("Ec2SimpleInputParamsStrings:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Foo: "val1", + Bar: "val2", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Bar=val2`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes booleans that are true + */ +it("Ec2SimpleInputParamsStringAndBooleanTrue:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Foo: "val1", + Baz: true, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Baz=true`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes booleans that are false + */ +it("Ec2SimpleInputParamsStringsAndBooleanFalse:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Baz: false, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Baz=false`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes integers + */ +it("Ec2SimpleInputParamsInteger:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Bam: 10, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Bam=10`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes floats + */ +it("Ec2SimpleInputParamsFloat:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Boo: 10.8, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Boo=10.8`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Blobs are base64 encoded in the query string + */ +it("Ec2SimpleInputParamsBlob:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Qux: Uint8Array.from("value", (c) => c.charCodeAt(0)), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Qux=dmFsdWU%3D`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes enums in the query string + */ +it("Ec2Enums:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FooEnum: "Foo", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FooEnum=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes query using ec2QueryName trait. + */ +it("Ec2Query:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + HasQueryName: "Hi", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&HasQueryName=Hi`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * ec2QueryName trait is preferred over xmlName. + */ +it("Ec2QueryIsPreferred:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + HasQueryAndXmlName: "Hi", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&HasQueryAndXmlName=Hi`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * xmlName is used with the ec2 protocol, but the first character is uppercased + */ +it("Ec2XmlNameIsUppercased:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + UsesXmlName: "Hi", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&UsesXmlName=Hi`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling NaN float values. + */ +it("Ec2QuerySupportsNaNFloatInputs:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FloatValue: NaN, + Boo: NaN, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=NaN&Boo=NaN`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("Ec2QuerySupportsInfinityFloatInputs:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FloatValue: Infinity, + Boo: Infinity, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=Infinity&Boo=Infinity`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling -Infinity float values. + */ +it("Ec2QuerySupportsNegativeInfinityFloatInputs:Request", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FloatValue: -Infinity, + Boo: -Infinity, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=-Infinity&Boo=-Infinity`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("Ec2SimpleScalarProperties:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + string + + true + false + 1 + 2 + 3 + 4 + 5.5 + 6.5 + requestid + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + stringValue: "string", + emptyStringValue: "", + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling NaN float values. + */ +it("Ec2QuerySupportsNaNFloatOutputs:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + NaN + NaN + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + floatValue: NaN, + doubleValue: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float values. + */ +it("Ec2QuerySupportsInfinityFloatOutputs:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + Infinity + Infinity + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + floatValue: Infinity, + doubleValue: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float values. + */ +it("Ec2QuerySupportsNegativeInfinityFloatOutputs:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + -Infinity + -Infinity + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + floatValue: -Infinity, + doubleValue: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Blobs are base64 encoded + */ +it("Ec2XmlBlobs:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + dmFsdWU= + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlBlobsCommand(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 = [ + { + data: Uint8Array.from("value", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty blobs are deserialized as empty string + */ +it("Ec2XmlEmptyBlobs:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyBlobsCommand(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 = [ + { + data: Uint8Array.from("", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty self closed blobs are deserialized as empty string + */ +it("Ec2XmlEmptySelfClosedBlobs:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyBlobsCommand(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 = [ + { + data: Uint8Array.from("", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes empty XML lists + */ +it("Ec2XmlEmptyLists:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyListsCommand(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 = [ + { + stringList: [], + stringSet: [], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("Ec2XmlEnums:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + Foo + 0 + 1 + + Foo + 0 + + + Foo + 0 + + + + hi + Foo + + + zero + 0 + + + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlEnumsCommand(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 = [ + { + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("Ec2XmlIntEnums:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 1 + 2 + 3 + + 1 + 2 + + + 1 + 2 + + + + a + 1 + + + b + 2 + + + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlIntEnumsCommand(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 = [ + { + intEnum1: 1, + intEnum2: 2, + intEnum3: 3, + intEnumList: [1, 2], + intEnumSet: [1, 2], + intEnumMap: { + a: 1, + b: 2, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests for XML list serialization + */ +it("Ec2XmlLists:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + + foo + bar + + + foo + bar + + + 1 + 2 + + + true + false + + + 2014-04-29T18:30:38Z + 2014-04-29T18:30:38Z + + + Foo + 0 + + + 1 + 2 + + + + foo + bar + + + baz + qux + + + + foo + bar + + hi + bye + yep + nope + a + b + a + b + + + 1 + 2 + + + 3 + 4 + + + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlListsCommand(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 = [ + { + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238 * 1000), new Date(1398796238 * 1000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + renamedListMembers: ["foo", "bar"], + flattenedList: ["hi", "bye"], + flattenedList2: ["yep", "nope"], + flattenedListWithMemberNamespace: ["a", "b"], + flattenedListWithNamespace: ["a", "b"], + structureList: [ + { + a: "1", + b: "2", + }, + { + a: "3", + b: "4", + }, + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML namespaces + */ +it("Ec2XmlNamespaces:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + + Foo + + Bar + Baz + + + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlNamespacesCommand(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 = [ + { + nested: { + foo: "Foo", + values: ["Bar", "Baz"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests how normal timestamps are serialized + */ +it("Ec2XmlTimestamps:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 2014-04-29T18:30:38Z + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + normal: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time works like normal timestamps + */ +it("Ec2XmlTimestampsWithDateTimeFormat:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 2014-04-29T18:30:38Z + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + dateTime: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time on the target shape works like normal timestamps + */ +it("Ec2XmlTimestampsWithDateTimeOnTargetFormat:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 2014-04-29T18:30:38Z + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + dateTimeOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds works + */ +it("Ec2XmlTimestampsWithEpochSecondsFormat:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 1398796238 + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + epochSeconds: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds on the target shape works + */ +it("Ec2XmlTimestampsWithEpochSecondsOnTargetFormat:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + 1398796238 + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + epochSecondsOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date works + */ +it("Ec2XmlTimestampsWithHttpDateFormat:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + Tue, 29 Apr 2014 18:30:38 GMT + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + httpDate: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date on the target shape works + */ +it("Ec2XmlTimestampsWithHttpDateOnTargetFormat:Response", async () => { + const client = new EC2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml;charset=UTF-8", + }, + ` + Tue, 29 Apr 2014 18:30:38 GMT + requestid + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + httpDateOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentFormUrlencodedBodies = (expectedBody: string, generatedBody: string): Object => { + const fromEntries = (components: string[][]): Record => { + const parts: Record = {}; + + components.forEach((component) => { + parts[component[0]] = component[1]; + }); + + return parts; + }; + + // Generate to k:v maps from query components + const expectedParts = fromEntries(expectedBody.split("&").map((part) => part.trim().split("="))); + const generatedParts = fromEntries(generatedBody.split("&").map((part) => part.trim().split("="))); + + return compareParts(expectedParts, generatedParts); +}; + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentUnknownTypeBodies = ( + utf8Encoder: __Encoder, + expectedBody: string, + generatedBody: string | Uint8Array +): Object => { + const expectedParts = { Value: expectedBody }; + const generatedParts = { + Value: generatedBody instanceof Uint8Array ? utf8Encoder(generatedBody) : generatedBody, + }; + + return compareParts(expectedParts, generatedParts); +}; diff --git a/private/aws-protocoltests-ec2-schema/tsconfig.cjs.json b/private/aws-protocoltests-ec2-schema/tsconfig.cjs.json new file mode 100644 index 0000000000000..9224176da7f72 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-ec2-schema/tsconfig.es.json b/private/aws-protocoltests-ec2-schema/tsconfig.es.json new file mode 100644 index 0000000000000..5a76fb6593463 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "ESNext", + "moduleResolution": "bundler", + "outDir": "dist-es", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-ec2-schema/tsconfig.json b/private/aws-protocoltests-ec2-schema/tsconfig.json new file mode 100644 index 0000000000000..956bed461a6ce --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/private/aws-protocoltests-ec2-schema/tsconfig.types.json b/private/aws-protocoltests-ec2-schema/tsconfig.types.json new file mode 100644 index 0000000000000..b9a5eb7844868 --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/tsconfig.types.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true, + "noCheck": false + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/private/aws-protocoltests-ec2-schema/vite.config.js b/private/aws-protocoltests-ec2-schema/vite.config.js new file mode 100644 index 0000000000000..e7147d3ac9e1d --- /dev/null +++ b/private/aws-protocoltests-ec2-schema/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-json-10-schema/.gitignore b/private/aws-protocoltests-json-10-schema/.gitignore new file mode 100644 index 0000000000000..54f14c9aef253 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/private/aws-protocoltests-json-10-schema/LICENSE b/private/aws-protocoltests-json-10-schema/LICENSE new file mode 100644 index 0000000000000..ba9d6d1526906 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/private/aws-protocoltests-json-10-schema/README.md b/private/aws-protocoltests-json-10-schema/README.md new file mode 100644 index 0000000000000..e9a5d7d6742a1 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/README.md @@ -0,0 +1,2563 @@ + + +# @aws-sdk/aws-protocoltests-json-10-schema + +## Description + +AWS SDK for JavaScript JSONRPC10 Client for Node.js, Browser and React Native. + +## Installing + +To install this package, simply type add or install @aws-sdk/aws-protocoltests-json-10-schema +using your favorite package manager: + +- `npm install @aws-sdk/aws-protocoltests-json-10-schema` +- `yarn add @aws-sdk/aws-protocoltests-json-10-schema` +- `pnpm add @aws-sdk/aws-protocoltests-json-10-schema` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `JSONRPC10Client` and +the commands you need, for example `JsonUnionsCommand`: + +```js +// ES5 example +const { JSONRPC10Client, JsonUnionsCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); +``` + +```ts +// ES6+ example +import { JSONRPC10Client, JsonUnionsCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new JSONRPC10Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new JsonUnionsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-protocoltests-json-10-schema"; +const client = new AWS.JSONRPC10({ region: "REGION" }); + +// async/await. +try { + const data = await client.jsonUnions(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .jsonUnions(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.jsonUnions(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-protocoltests-json-10-schema` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryListsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlListsCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlTimestampsCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EmptyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyOperationCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonUnionsCommandOutput/) + +
+
+ +KitchenSinkOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/KitchenSinkOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/KitchenSinkOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/KitchenSinkOperationCommandOutput/) + +
+
+ +NullOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NullOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullOperationCommandOutput/) + +
+
+ +OperationWithOptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithOptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithOptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithOptionalInputOutputCommandOutput/) + +
+
+ +PutAndGetInlineDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PutAndGetInlineDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutAndGetInlineDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutAndGetInlineDocumentsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseNullsOperationCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonUnionsCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +OperationWithRequiredMembers + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithRequiredMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithRequiredMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithRequiredMembersCommandOutput/) + +
+
+ +OperationWithRequiredMembersWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithRequiredMembersWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithRequiredMembersWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithRequiredMembersWithDefaultsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +AcceptHeaderStarService + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/AcceptHeaderStarServiceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/AcceptHeaderStarServiceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/AcceptHeaderStarServiceCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryListsCommandOutput/) + +
+
+ +QueryMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryMapsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlTimestampsCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +DocumentType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DocumentTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DocumentTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DocumentTypeCommandOutput/) + +
+
+ +DocumentTypeAsMapValue + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DocumentTypeAsMapValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DocumentTypeAsMapValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DocumentTypeAsMapValueCommandOutput/) + +
+
+ +DocumentTypeAsPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DocumentTypeAsPayloadCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +HttpChecksumRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpChecksumRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpChecksumRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpChecksumRequiredCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpPrefixHeadersInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPrefixHeadersInResponseCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpRequestWithRegexLiteral + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithRegexLiteralCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithRegexLiteralCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithRegexLiteralCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +JsonBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonBlobsCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonListsCommandOutput/) + +
+
+ +JsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonMapsCommandOutput/) + +
+
+ +JsonTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonTimestampsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/JsonUnionsCommandOutput/) + +
+
+ +MalformedAcceptWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedAcceptWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedAcceptWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedAcceptWithBodyCommandOutput/) + +
+
+ +MalformedAcceptWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedAcceptWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedAcceptWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedAcceptWithGenericStringCommandOutput/) + +
+
+ +MalformedAcceptWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedAcceptWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedAcceptWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedAcceptWithPayloadCommandOutput/) + +
+
+ +MalformedBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedBlobCommandOutput/) + +
+
+ +MalformedBoolean + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedBooleanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedBooleanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedBooleanCommandOutput/) + +
+
+ +MalformedByte + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedByteCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedByteCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedByteCommandOutput/) + +
+
+ +MalformedContentTypeWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedContentTypeWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedContentTypeWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithGenericStringCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedContentTypeWithoutBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithoutBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithoutBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBodyEmptyInput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedContentTypeWithoutBodyEmptyInputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandOutput/) + +
+
+ +MalformedContentTypeWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedContentTypeWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedContentTypeWithPayloadCommandOutput/) + +
+
+ +MalformedDouble + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedDoubleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedDoubleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedDoubleCommandOutput/) + +
+
+ +MalformedFloat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedFloatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedFloatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedFloatCommandOutput/) + +
+
+ +MalformedInteger + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedIntegerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedIntegerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedIntegerCommandOutput/) + +
+
+ +MalformedList + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedListCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedListCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedListCommandOutput/) + +
+
+ +MalformedLong + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedLongCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLongCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLongCommandOutput/) + +
+
+ +MalformedMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedMapCommandOutput/) + +
+
+ +MalformedRequestBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedRequestBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRequestBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRequestBodyCommandOutput/) + +
+
+ +MalformedShort + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedShortCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedShortCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedShortCommandOutput/) + +
+
+ +MalformedString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedStringCommandOutput/) + +
+
+ +MalformedTimestampBodyDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampBodyDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampBodyDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampBodyDateTimeCommandOutput/) + +
+
+ +MalformedTimestampBodyDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampBodyDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampBodyDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampBodyDefaultCommandOutput/) + +
+
+ +MalformedTimestampBodyHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampBodyHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampBodyHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampBodyHttpDateCommandOutput/) + +
+
+ +MalformedTimestampHeaderDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampHeaderDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampHeaderDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampHeaderDateTimeCommandOutput/) + +
+
+ +MalformedTimestampHeaderDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampHeaderDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampHeaderDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampHeaderDefaultCommandOutput/) + +
+
+ +MalformedTimestampHeaderEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampHeaderEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampHeaderEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampHeaderEpochCommandOutput/) + +
+
+ +MalformedTimestampPathDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampPathDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampPathDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampPathDefaultCommandOutput/) + +
+
+ +MalformedTimestampPathEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampPathEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampPathEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampPathEpochCommandOutput/) + +
+
+ +MalformedTimestampPathHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampPathHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampPathHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampPathHttpDateCommandOutput/) + +
+
+ +MalformedTimestampQueryDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampQueryDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampQueryDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampQueryDefaultCommandOutput/) + +
+
+ +MalformedTimestampQueryEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampQueryEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampQueryEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampQueryEpochCommandOutput/) + +
+
+ +MalformedTimestampQueryHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedTimestampQueryHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampQueryHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedTimestampQueryHttpDateCommandOutput/) + +
+
+ +MalformedUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedUnionCommandOutput/) + +
+
+ +MediaTypeHeader + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MediaTypeHeaderCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MediaTypeHeaderCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MediaTypeHeaderCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +OmitsSerializingEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OmitsSerializingEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OmitsSerializingEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OmitsSerializingEmptyListsCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +PostPlayerAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PostPlayerActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PostPlayerActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PostPlayerActionCommandOutput/) + +
+
+ +PostUnionWithJsonName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PostUnionWithJsonNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PostUnionWithJsonNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PostUnionWithJsonNameCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveShapesCommandOutput/) + +
+
+ +ResponseCodeHttpFallback + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ResponseCodeHttpFallbackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ResponseCodeHttpFallbackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ResponseCodeHttpFallbackCommandOutput/) + +
+
+ +ResponseCodeRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ResponseCodeRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ResponseCodeRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ResponseCodeRequiredCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseJsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SparseJsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseJsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseJsonListsCommandOutput/) + +
+
+ +SparseJsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SparseJsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseJsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseJsonMapsCommandOutput/) + +
+
+ +StreamingTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/StreamingTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/StreamingTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/StreamingTraitsCommandOutput/) + +
+
+ +StreamingTraitsRequireLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/StreamingTraitsRequireLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/StreamingTraitsRequireLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/StreamingTraitsRequireLengthCommandOutput/) + +
+
+ +StreamingTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/StreamingTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/StreamingTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/StreamingTraitsWithMediaTypeCommandOutput/) + +
+
+ +TestBodyStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TestBodyStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestBodyStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestBodyStructureCommandOutput/) + +
+
+ +TestGetNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TestGetNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestGetNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestGetNoInputNoPayloadCommandOutput/) + +
+
+ +TestGetNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TestGetNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestGetNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestGetNoPayloadCommandOutput/) + +
+
+ +TestPayloadBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TestPayloadBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPayloadBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPayloadBlobCommandOutput/) + +
+
+ +TestPayloadStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TestPayloadStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPayloadStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPayloadStructureCommandOutput/) + +
+
+ +TestPostNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TestPostNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPostNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPostNoInputNoPayloadCommandOutput/) + +
+
+ +TestPostNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TestPostNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPostNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TestPostNoPayloadCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +UnitInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/UnitInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/UnitInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/UnitInputAndOutputCommandOutput/) + +
+
+ +MalformedEnum + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedEnumCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedEnumCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedEnumCommandOutput/) + +
+
+ +MalformedLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLengthCommandOutput/) + +
+
+ +MalformedLengthOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedLengthOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLengthOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLengthOverrideCommandOutput/) + +
+
+ +MalformedLengthQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedLengthQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLengthQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedLengthQueryStringCommandOutput/) + +
+
+ +MalformedPattern + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedPatternCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedPatternCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedPatternCommandOutput/) + +
+
+ +MalformedPatternOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedPatternOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedPatternOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedPatternOverrideCommandOutput/) + +
+
+ +MalformedRange + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedRangeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRangeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRangeCommandOutput/) + +
+
+ +MalformedRangeOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedRangeOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRangeOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRangeOverrideCommandOutput/) + +
+
+ +MalformedRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedRequiredCommandOutput/) + +
+
+ +MalformedUniqueItems + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/MalformedUniqueItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedUniqueItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/MalformedUniqueItemsCommandOutput/) + +
+
+ +RecursiveStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RecursiveStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveStructuresCommandOutput/) + +
+
+ +SensitiveValidation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SensitiveValidationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SensitiveValidationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SensitiveValidationCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +BodyWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/BodyWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/BodyWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/BodyWithXmlNameCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelHeaderOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointWithHostLabelHeaderOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelHeaderOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelHeaderOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithMemberXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithMemberXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithMemberXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithMemberXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPayloadWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithXmlNamespaceCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespaceAndPrefix + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPayloadWithXmlNamespaceAndPrefixCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +NestedXmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NestedXmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedXmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedXmlMapsCommandOutput/) + +
+
+ +NestedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NestedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NestedXmlMapWithXmlNameCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveShapesCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +XmlAttributes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlAttributesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlAttributesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlAttributesCommandOutput/) + +
+
+ +XmlAttributesOnPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlAttributesOnPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlAttributesOnPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlAttributesOnPayloadCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEmptyStrings + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEmptyStringsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyStringsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEmptyStringsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlTimestampsCommandOutput/) + +
+
+ +XmlUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/XmlUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/XmlUnionsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +GetRestApis + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GetRestApisCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GetRestApisCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GetRestApisCommandOutput/) + +
+
+ +UploadArchive + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/UploadArchiveCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/UploadArchiveCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/UploadArchiveCommandOutput/) + +
+
+ +UploadMultipartPart + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/UploadMultipartPartCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/UploadMultipartPartCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/UploadMultipartPartCommandOutput/) + +
+
+ +Predict + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/PredictCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PredictCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/PredictCommandOutput/) + +
+
+ +DeleteObjectTagging + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DeleteObjectTaggingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DeleteObjectTaggingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DeleteObjectTaggingCommandOutput/) + +
+
+ +GetBucketLocation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GetBucketLocationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GetBucketLocationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GetBucketLocationCommandOutput/) + +
+
+ +GetObject + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GetObjectCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GetObjectCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GetObjectCommandOutput/) + +
+
+ +ListObjectsV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/ListObjectsV2Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ListObjectsV2CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/ListObjectsV2CommandOutput/) + +
+
+ +EmptyInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/EmptyInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/EmptyInputOutputCommandOutput/) + +
+
+ +Float16 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/Float16Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/Float16CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/Float16CommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +NoInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/NoInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/NoInputOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OptionalInputOutputCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RecursiveShapesCommandOutput/) + +
+
+ +RpcV2CborDenseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RpcV2CborDenseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RpcV2CborDenseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RpcV2CborDenseMapsCommandOutput/) + +
+
+ +RpcV2CborLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RpcV2CborListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RpcV2CborListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RpcV2CborListsCommandOutput/) + +
+
+ +RpcV2CborSparseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/RpcV2CborSparseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RpcV2CborSparseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/RpcV2CborSparseMapsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/SparseNullsOperationCommandOutput/) + +
diff --git a/private/aws-protocoltests-json-10-schema/api-extractor.json b/private/aws-protocoltests-json-10-schema/api-extractor.json new file mode 100644 index 0000000000000..d5bf5ffeee851 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/private/aws-protocoltests-json-10-schema/package.json b/private/aws-protocoltests-json-10-schema/package.json new file mode 100644 index 0000000000000..7d4f3f7d6d420 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/package.json @@ -0,0 +1,104 @@ +{ + "name": "@aws-sdk/aws-protocoltests-json-10-schema", + "description": "@aws-sdk/aws-protocoltests-json-10-schema client", + "version": "1.0.0-alpha.1", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "test": "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.5.2", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-compression": "^4.1.10", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.10", + "@smithy/middleware-retry": "^4.1.11", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.2", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.18", + "@smithy/util-defaults-mode-node": "^4.0.18", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "@smithy/util-utf8": "^4.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@tsconfig/node18": "18.2.4", + "@types/node": "^18.19.69", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~5.8.3", + "vitest": "2.1.8" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "private": true, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-protocoltests-json-10-schema", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/aws-protocoltests-json-10-schema" + } +} diff --git a/private/aws-protocoltests-json-10-schema/src/JSONRPC10.ts b/private/aws-protocoltests-json-10-schema/src/JSONRPC10.ts new file mode 100644 index 0000000000000..3736b21f2f3b8 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/JSONRPC10.ts @@ -0,0 +1,364 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + ContentTypeParametersCommand, + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { + EmptyInputAndEmptyOutputCommand, + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { + EndpointOperationCommand, + EndpointOperationCommandInput, + EndpointOperationCommandOutput, +} from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommand, + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { + GreetingWithErrorsCommand, + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, +} from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommand, + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { JsonUnionsCommand, JsonUnionsCommandInput, JsonUnionsCommandOutput } from "./commands/JsonUnionsCommand"; +import { + NoInputAndNoOutputCommand, + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, +} from "./commands/NoInputAndNoOutputCommand"; +import { + NoInputAndOutputCommand, + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, +} from "./commands/NoInputAndOutputCommand"; +import { + OperationWithDefaultsCommand, + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, +} from "./commands/OperationWithDefaultsCommand"; +import { + OperationWithNestedStructureCommand, + OperationWithNestedStructureCommandInput, + OperationWithNestedStructureCommandOutput, +} from "./commands/OperationWithNestedStructureCommand"; +import { + OperationWithRequiredMembersCommand, + OperationWithRequiredMembersCommandInput, + OperationWithRequiredMembersCommandOutput, +} from "./commands/OperationWithRequiredMembersCommand"; +import { + OperationWithRequiredMembersWithDefaultsCommand, + OperationWithRequiredMembersWithDefaultsCommandInput, + OperationWithRequiredMembersWithDefaultsCommandOutput, +} from "./commands/OperationWithRequiredMembersWithDefaultsCommand"; +import { + PutWithContentEncodingCommand, + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + SimpleScalarPropertiesCommand, + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { JSONRPC10Client, JSONRPC10ClientConfig } from "./JSONRPC10Client"; + +const commands = { + ContentTypeParametersCommand, + EmptyInputAndEmptyOutputCommand, + EndpointOperationCommand, + EndpointWithHostLabelOperationCommand, + GreetingWithErrorsCommand, + HostWithPathOperationCommand, + JsonUnionsCommand, + NoInputAndNoOutputCommand, + NoInputAndOutputCommand, + OperationWithDefaultsCommand, + OperationWithNestedStructureCommand, + OperationWithRequiredMembersCommand, + OperationWithRequiredMembersWithDefaultsCommand, + PutWithContentEncodingCommand, + SimpleScalarPropertiesCommand, +}; + +export interface JSONRPC10 { + /** + * @see {@link ContentTypeParametersCommand} + */ + contentTypeParameters(): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + + /** + * @see {@link EmptyInputAndEmptyOutputCommand} + */ + emptyInputAndEmptyOutput(): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + + /** + * @see {@link EndpointOperationCommand} + */ + endpointOperation(): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + endpointOperation( + args: EndpointOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointWithHostLabelOperationCommand} + */ + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + + /** + * @see {@link GreetingWithErrorsCommand} + */ + greetingWithErrors(): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + + /** + * @see {@link HostWithPathOperationCommand} + */ + hostWithPathOperation(): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + + /** + * @see {@link JsonUnionsCommand} + */ + jsonUnions(): Promise; + jsonUnions(args: JsonUnionsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonUnions(args: JsonUnionsCommandInput, cb: (err: any, data?: JsonUnionsCommandOutput) => void): void; + jsonUnions( + args: JsonUnionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonUnionsCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndNoOutputCommand} + */ + noInputAndNoOutput(): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndOutputCommand} + */ + noInputAndOutput(): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithDefaultsCommand} + */ + operationWithDefaults(): Promise; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void + ): void; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithNestedStructureCommand} + */ + operationWithNestedStructure( + args: OperationWithNestedStructureCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithNestedStructure( + args: OperationWithNestedStructureCommandInput, + cb: (err: any, data?: OperationWithNestedStructureCommandOutput) => void + ): void; + operationWithNestedStructure( + args: OperationWithNestedStructureCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithNestedStructureCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithRequiredMembersCommand} + */ + operationWithRequiredMembers(): Promise; + operationWithRequiredMembers( + args: OperationWithRequiredMembersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithRequiredMembers( + args: OperationWithRequiredMembersCommandInput, + cb: (err: any, data?: OperationWithRequiredMembersCommandOutput) => void + ): void; + operationWithRequiredMembers( + args: OperationWithRequiredMembersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithRequiredMembersCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithRequiredMembersWithDefaultsCommand} + */ + operationWithRequiredMembersWithDefaults(): Promise; + operationWithRequiredMembersWithDefaults( + args: OperationWithRequiredMembersWithDefaultsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithRequiredMembersWithDefaults( + args: OperationWithRequiredMembersWithDefaultsCommandInput, + cb: (err: any, data?: OperationWithRequiredMembersWithDefaultsCommandOutput) => void + ): void; + operationWithRequiredMembersWithDefaults( + args: OperationWithRequiredMembersWithDefaultsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithRequiredMembersWithDefaultsCommandOutput) => void + ): void; + + /** + * @see {@link PutWithContentEncodingCommand} + */ + putWithContentEncoding(): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + + /** + * @see {@link SimpleScalarPropertiesCommand} + */ + simpleScalarProperties(): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; +} + +/** + * @public + */ +export class JSONRPC10 extends JSONRPC10Client implements JSONRPC10 {} +createAggregatedClient(commands, JSONRPC10); diff --git a/private/aws-protocoltests-json-10-schema/src/JSONRPC10Client.ts b/private/aws-protocoltests-json-10-schema/src/JSONRPC10Client.ts new file mode 100644 index 0000000000000..1e3feada88202 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/JSONRPC10Client.ts @@ -0,0 +1,418 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + ClientProtocol, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + HttpRequest, + HttpResponse, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + defaultJSONRPC10HttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { JsonUnionsCommandInput, JsonUnionsCommandOutput } from "./commands/JsonUnionsCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "./commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "./commands/NoInputAndOutputCommand"; +import { + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, +} from "./commands/OperationWithDefaultsCommand"; +import { + OperationWithNestedStructureCommandInput, + OperationWithNestedStructureCommandOutput, +} from "./commands/OperationWithNestedStructureCommand"; +import { + OperationWithRequiredMembersCommandInput, + OperationWithRequiredMembersCommandOutput, +} from "./commands/OperationWithRequiredMembersCommand"; +import { + OperationWithRequiredMembersWithDefaultsCommandInput, + OperationWithRequiredMembersWithDefaultsCommandOutput, +} from "./commands/OperationWithRequiredMembersWithDefaultsCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | ContentTypeParametersCommandInput + | EmptyInputAndEmptyOutputCommandInput + | EndpointOperationCommandInput + | EndpointWithHostLabelOperationCommandInput + | GreetingWithErrorsCommandInput + | HostWithPathOperationCommandInput + | JsonUnionsCommandInput + | NoInputAndNoOutputCommandInput + | NoInputAndOutputCommandInput + | OperationWithDefaultsCommandInput + | OperationWithNestedStructureCommandInput + | OperationWithRequiredMembersCommandInput + | OperationWithRequiredMembersWithDefaultsCommandInput + | PutWithContentEncodingCommandInput + | SimpleScalarPropertiesCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | ContentTypeParametersCommandOutput + | EmptyInputAndEmptyOutputCommandOutput + | EndpointOperationCommandOutput + | EndpointWithHostLabelOperationCommandOutput + | GreetingWithErrorsCommandOutput + | HostWithPathOperationCommandOutput + | JsonUnionsCommandOutput + | NoInputAndNoOutputCommandOutput + | NoInputAndOutputCommandOutput + | OperationWithDefaultsCommandOutput + | OperationWithNestedStructureCommandOutput + | OperationWithRequiredMembersCommandOutput + | OperationWithRequiredMembersWithDefaultsCommandOutput + | PutWithContentEncodingCommandOutput + | SimpleScalarPropertiesCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON) + * may be overridden. A default will always be set by the client. + * Available options depend on the service's supported protocols and will not be validated by + * the client. + * @alpha + * + */ + protocol?: ClientProtocol; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type JSONRPC10ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + CompressionInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of JSONRPC10Client class constructor that set the region, credentials and other options. + */ +export interface JSONRPC10ClientConfig extends JSONRPC10ClientConfigType {} + +/** + * @public + */ +export type JSONRPC10ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + CompressionResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of JSONRPC10Client class. This is resolved and normalized from the {@link JSONRPC10ClientConfig | constructor configuration interface}. + */ +export interface JSONRPC10ClientResolvedConfig extends JSONRPC10ClientResolvedConfigType {} + +/** + * @public + */ +export class JSONRPC10Client extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + JSONRPC10ClientResolvedConfig +> { + /** + * The resolved configuration of JSONRPC10Client class. This is resolved and normalized from the {@link JSONRPC10ClientConfig | constructor configuration interface}. + */ + readonly config: JSONRPC10ClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + super(_config_0 as any); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveCompressionConfig(_config_7); + const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []); + this.config = _config_9; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultJSONRPC10HttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: JSONRPC10ClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/private/aws-protocoltests-json-10-schema/src/auth/httpAuthExtensionConfiguration.ts b/private/aws-protocoltests-json-10-schema/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 0000000000000..eb2efa9f9c9a8 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { JSONRPC10HttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: JSONRPC10HttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): JSONRPC10HttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: JSONRPC10HttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: JSONRPC10HttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): JSONRPC10HttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/private/aws-protocoltests-json-10-schema/src/auth/httpAuthSchemeProvider.ts b/private/aws-protocoltests-json-10-schema/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 0000000000000..655669306c8d9 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,154 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, + Provider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { JSONRPC10ClientConfig, JSONRPC10ClientResolvedConfig } from "../JSONRPC10Client"; + +/** + * @internal + */ +export interface JSONRPC10HttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface JSONRPC10HttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + JSONRPC10ClientResolvedConfig, + HandlerExecutionContext, + JSONRPC10HttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultJSONRPC10HttpAuthSchemeParametersProvider = async ( + config: JSONRPC10ClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption(authParameters: JSONRPC10HttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "jsonrpc10", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface JSONRPC10HttpAuthSchemeProvider extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultJSONRPC10HttpAuthSchemeProvider: JSONRPC10HttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + authSchemePreference?: string[] | Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: JSONRPC10HttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + readonly authSchemePreference: Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: JSONRPC10HttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), + }) as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/private/aws-protocoltests-json-10-schema/src/commands/ContentTypeParametersCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/ContentTypeParametersCommand.ts new file mode 100644 index 0000000000000..4fc9b2504da42 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/ContentTypeParametersCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { ContentTypeParametersInput, ContentTypeParametersOutput } from "../models/models_0"; +import { ContentTypeParameters } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandInput extends ContentTypeParametersInput {} +/** + * @public + * + * The output of {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandOutput extends ContentTypeParametersOutput, __MetadataBearer {} + +/** + * The example tests how servers must support requests + * containing a `Content-Type` header with parameters. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, ContentTypeParametersCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, ContentTypeParametersCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // ContentTypeParametersInput + * value: Number("int"), + * }; + * const command = new ContentTypeParametersCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ContentTypeParametersCommandInput - {@link ContentTypeParametersCommandInput} + * @returns {@link ContentTypeParametersCommandOutput} + * @see {@link ContentTypeParametersCommandInput} for command's `input` shape. + * @see {@link ContentTypeParametersCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + * @public + */ +export class ContentTypeParametersCommand extends $Command + .classBuilder< + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "ContentTypeParameters", {}) + .n("JSONRPC10Client", "ContentTypeParametersCommand") + .f(void 0, void 0) + .sc(ContentTypeParameters) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ContentTypeParametersInput; + output: {}; + }; + sdk: { + input: ContentTypeParametersCommandInput; + output: ContentTypeParametersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts new file mode 100644 index 0000000000000..b1921f38a8950 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { EmptyInputAndEmptyOutputInput, EmptyInputAndEmptyOutputOutput } from "../models/models_0"; +import { EmptyInputAndEmptyOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandInput extends EmptyInputAndEmptyOutputInput {} +/** + * @public + * + * The output of {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandOutput extends EmptyInputAndEmptyOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has an empty input + * and empty output structure that reuses the same shape. While this should + * be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, EmptyInputAndEmptyOutputCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, EmptyInputAndEmptyOutputCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = {}; + * const command = new EmptyInputAndEmptyOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EmptyInputAndEmptyOutputCommandInput - {@link EmptyInputAndEmptyOutputCommandInput} + * @returns {@link EmptyInputAndEmptyOutputCommandOutput} + * @see {@link EmptyInputAndEmptyOutputCommandInput} for command's `input` shape. + * @see {@link EmptyInputAndEmptyOutputCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + * @public + */ +export class EmptyInputAndEmptyOutputCommand extends $Command + .classBuilder< + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "EmptyInputAndEmptyOutput", {}) + .n("JSONRPC10Client", "EmptyInputAndEmptyOutputCommand") + .f(void 0, void 0) + .sc(EmptyInputAndEmptyOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EmptyInputAndEmptyOutputCommandInput; + output: EmptyInputAndEmptyOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/EndpointOperationCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/EndpointOperationCommand.ts new file mode 100644 index 0000000000000..9a20547847911 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/EndpointOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { EndpointOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandInput {} +/** + * @public + * + * The output of {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, EndpointOperationCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, EndpointOperationCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = {}; + * const command = new EndpointOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointOperationCommandInput - {@link EndpointOperationCommandInput} + * @returns {@link EndpointOperationCommandOutput} + * @see {@link EndpointOperationCommandInput} for command's `input` shape. + * @see {@link EndpointOperationCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class EndpointOperationCommand extends $Command + .classBuilder< + EndpointOperationCommandInput, + EndpointOperationCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "EndpointOperation", {}) + .n("JSONRPC10Client", "EndpointOperationCommand") + .f(void 0, void 0) + .sc(EndpointOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EndpointOperationCommandInput; + output: EndpointOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/EndpointWithHostLabelOperationCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/EndpointWithHostLabelOperationCommand.ts new file mode 100644 index 0000000000000..cae32205bc5f7 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/EndpointWithHostLabelOperationCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { EndpointWithHostLabelOperationInput } from "../models/models_0"; +import { EndpointWithHostLabelOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandInput extends EndpointWithHostLabelOperationInput {} +/** + * @public + * + * The output of {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, EndpointWithHostLabelOperationCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, EndpointWithHostLabelOperationCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // EndpointWithHostLabelOperationInput + * label: "STRING_VALUE", // required + * }; + * const command = new EndpointWithHostLabelOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointWithHostLabelOperationCommandInput - {@link EndpointWithHostLabelOperationCommandInput} + * @returns {@link EndpointWithHostLabelOperationCommandOutput} + * @see {@link EndpointWithHostLabelOperationCommandInput} for command's `input` shape. + * @see {@link EndpointWithHostLabelOperationCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class EndpointWithHostLabelOperationCommand extends $Command + .classBuilder< + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "EndpointWithHostLabelOperation", {}) + .n("JSONRPC10Client", "EndpointWithHostLabelOperationCommand") + .f(void 0, void 0) + .sc(EndpointWithHostLabelOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: EndpointWithHostLabelOperationInput; + output: {}; + }; + sdk: { + input: EndpointWithHostLabelOperationCommandInput; + output: EndpointWithHostLabelOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/GreetingWithErrorsCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/GreetingWithErrorsCommand.ts new file mode 100644 index 0000000000000..69c5e46313a80 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/GreetingWithErrorsCommand.ts @@ -0,0 +1,105 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { GreetingWithErrorsInput, GreetingWithErrorsOutput } from "../models/models_0"; +import { GreetingWithErrors } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandInput extends GreetingWithErrorsInput {} +/** + * @public + * + * The output of {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {} + +/** + * This operation has three possible return values: + * + * 1. A successful response in the form of GreetingWithErrorsOutput + * 2. An InvalidGreeting error. + * 3. A ComplexError error. + * + * Implementations must be able to successfully take a response and + * properly deserialize successful and error responses. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, GreetingWithErrorsCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, GreetingWithErrorsCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // GreetingWithErrorsInput + * greeting: "STRING_VALUE", + * }; + * const command = new GreetingWithErrorsCommand(input); + * const response = await client.send(command); + * // { // GreetingWithErrorsOutput + * // greeting: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput} + * @returns {@link GreetingWithErrorsCommandOutput} + * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape. + * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link InvalidGreeting} (client fault) + * This error is thrown when an invalid greeting value is provided. + * + * @throws {@link ComplexError} (client fault) + * This error is thrown when a request is invalid. + * + * @throws {@link FooError} (server fault) + * This error has test cases that test some of the dark corners of Amazon service + * framework history. It should only be implemented by clients. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + * @public + */ +export class GreetingWithErrorsCommand extends $Command + .classBuilder< + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "GreetingWithErrors", {}) + .n("JSONRPC10Client", "GreetingWithErrorsCommand") + .f(void 0, void 0) + .sc(GreetingWithErrors) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GreetingWithErrorsInput; + output: GreetingWithErrorsOutput; + }; + sdk: { + input: GreetingWithErrorsCommandInput; + output: GreetingWithErrorsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/HostWithPathOperationCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/HostWithPathOperationCommand.ts new file mode 100644 index 0000000000000..702ca92dafe53 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/HostWithPathOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { HostWithPathOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandInput {} +/** + * @public + * + * The output of {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, HostWithPathOperationCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, HostWithPathOperationCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = {}; + * const command = new HostWithPathOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HostWithPathOperationCommandInput - {@link HostWithPathOperationCommandInput} + * @returns {@link HostWithPathOperationCommandOutput} + * @see {@link HostWithPathOperationCommandInput} for command's `input` shape. + * @see {@link HostWithPathOperationCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class HostWithPathOperationCommand extends $Command + .classBuilder< + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "HostWithPathOperation", {}) + .n("JSONRPC10Client", "HostWithPathOperationCommand") + .f(void 0, void 0) + .sc(HostWithPathOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: HostWithPathOperationCommandInput; + output: HostWithPathOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/JsonUnionsCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/JsonUnionsCommand.ts new file mode 100644 index 0000000000000..f68a55d9a0d41 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/JsonUnionsCommand.ts @@ -0,0 +1,122 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { JsonUnionsInput, JsonUnionsOutput } from "../models/models_0"; +import { JsonUnions } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonUnionsCommand}. + */ +export interface JsonUnionsCommandInput extends JsonUnionsInput {} +/** + * @public + * + * The output of {@link JsonUnionsCommand}. + */ +export interface JsonUnionsCommandOutput extends JsonUnionsOutput, __MetadataBearer {} + +/** + * This operation uses unions for inputs and outputs. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, JsonUnionsCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, JsonUnionsCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // JsonUnionsInput + * contents: { // MyUnion Union: only one key present + * stringValue: "STRING_VALUE", + * booleanValue: true || false, + * numberValue: Number("int"), + * blobValue: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * timestampValue: new Date("TIMESTAMP"), + * enumValue: "Foo" || "Baz" || "Bar" || "1" || "0", + * intEnumValue: 1 || 2 || 3, + * listValue: [ // StringList + * "STRING_VALUE", + * ], + * mapValue: { // StringMap + * "": "STRING_VALUE", + * }, + * structureValue: { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * }; + * const command = new JsonUnionsCommand(input); + * const response = await client.send(command); + * // { // JsonUnionsOutput + * // contents: { // MyUnion Union: only one key present + * // stringValue: "STRING_VALUE", + * // booleanValue: true || false, + * // numberValue: Number("int"), + * // blobValue: new Uint8Array(), + * // timestampValue: new Date("TIMESTAMP"), + * // enumValue: "Foo" || "Baz" || "Bar" || "1" || "0", + * // intEnumValue: 1 || 2 || 3, + * // listValue: [ // StringList + * // "STRING_VALUE", + * // ], + * // mapValue: { // StringMap + * // "": "STRING_VALUE", + * // }, + * // structureValue: { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param JsonUnionsCommandInput - {@link JsonUnionsCommandInput} + * @returns {@link JsonUnionsCommandOutput} + * @see {@link JsonUnionsCommandInput} for command's `input` shape. + * @see {@link JsonUnionsCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + * @public + */ +export class JsonUnionsCommand extends $Command + .classBuilder< + JsonUnionsCommandInput, + JsonUnionsCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "JsonUnions", {}) + .n("JSONRPC10Client", "JsonUnionsCommand") + .f(void 0, void 0) + .sc(JsonUnions) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonUnionsInput; + output: JsonUnionsOutput; + }; + sdk: { + input: JsonUnionsCommandInput; + output: JsonUnionsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/NoInputAndNoOutputCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/NoInputAndNoOutputCommand.ts new file mode 100644 index 0000000000000..b5415a2bf4a71 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/NoInputAndNoOutputCommand.ts @@ -0,0 +1,85 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { NoInputAndNoOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has no input or output. + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, NoInputAndNoOutputCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, NoInputAndNoOutputCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = {}; + * const command = new NoInputAndNoOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndNoOutputCommandInput - {@link NoInputAndNoOutputCommandInput} + * @returns {@link NoInputAndNoOutputCommandOutput} + * @see {@link NoInputAndNoOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndNoOutputCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + * @public + */ +export class NoInputAndNoOutputCommand extends $Command + .classBuilder< + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "NoInputAndNoOutput", {}) + .n("JSONRPC10Client", "NoInputAndNoOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndNoOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndNoOutputCommandInput; + output: NoInputAndNoOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/NoInputAndOutputCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/NoInputAndOutputCommand.ts new file mode 100644 index 0000000000000..9d1c792d86aae --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/NoInputAndOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { NoInputAndOutputOutput } from "../models/models_0"; +import { NoInputAndOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandOutput extends NoInputAndOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has no input and the + * output is empty. While this should be rare, code generators must support + * this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, NoInputAndOutputCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, NoInputAndOutputCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = {}; + * const command = new NoInputAndOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndOutputCommandInput - {@link NoInputAndOutputCommandInput} + * @returns {@link NoInputAndOutputCommandOutput} + * @see {@link NoInputAndOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndOutputCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + * @public + */ +export class NoInputAndOutputCommand extends $Command + .classBuilder< + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "NoInputAndOutput", {}) + .n("JSONRPC10Client", "NoInputAndOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndOutputCommandInput; + output: NoInputAndOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/OperationWithDefaultsCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithDefaultsCommand.ts new file mode 100644 index 0000000000000..945d6944170e6 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithDefaultsCommand.ts @@ -0,0 +1,157 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { OperationWithDefaultsInput, OperationWithDefaultsOutput } from "../models/models_0"; +import { OperationWithDefaults } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithDefaultsCommand}. + */ +export interface OperationWithDefaultsCommandInput extends OperationWithDefaultsInput {} +/** + * @public + * + * The output of {@link OperationWithDefaultsCommand}. + */ +export interface OperationWithDefaultsCommandOutput extends OperationWithDefaultsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, OperationWithDefaultsCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, OperationWithDefaultsCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // OperationWithDefaultsInput + * defaults: { // Defaults + * defaultString: "STRING_VALUE", + * defaultBoolean: true || false, + * defaultList: [ // TestStringList + * "STRING_VALUE", + * ], + * defaultDocumentMap: "DOCUMENT_VALUE", + * defaultDocumentString: "DOCUMENT_VALUE", + * defaultDocumentBoolean: "DOCUMENT_VALUE", + * defaultDocumentList: "DOCUMENT_VALUE", + * defaultNullDocument: "DOCUMENT_VALUE", + * defaultTimestamp: new Date("TIMESTAMP"), + * defaultBlob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * defaultByte: 0, // BYTE_VALUE + * defaultShort: Number("short"), + * defaultInteger: Number("int"), + * defaultLong: Number("long"), + * defaultFloat: Number("float"), + * defaultDouble: Number("double"), + * defaultMap: { // TestStringMap + * "": "STRING_VALUE", + * }, + * defaultEnum: "FOO" || "BAR" || "BAZ", + * defaultIntEnum: 1 || 2, + * emptyString: "STRING_VALUE", + * falseBoolean: true || false, + * emptyBlob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * zeroByte: 0, // BYTE_VALUE + * zeroShort: Number("short"), + * zeroInteger: Number("int"), + * zeroLong: Number("long"), + * zeroFloat: Number("float"), + * zeroDouble: Number("double"), + * }, + * clientOptionalDefaults: { // ClientOptionalDefaults + * member: Number("int"), + * }, + * topLevelDefault: "STRING_VALUE", + * otherTopLevelDefault: Number("int"), + * }; + * const command = new OperationWithDefaultsCommand(input); + * const response = await client.send(command); + * // { // OperationWithDefaultsOutput + * // defaultString: "STRING_VALUE", + * // defaultBoolean: true || false, + * // defaultList: [ // TestStringList + * // "STRING_VALUE", + * // ], + * // defaultDocumentMap: "DOCUMENT_VALUE", + * // defaultDocumentString: "DOCUMENT_VALUE", + * // defaultDocumentBoolean: "DOCUMENT_VALUE", + * // defaultDocumentList: "DOCUMENT_VALUE", + * // defaultNullDocument: "DOCUMENT_VALUE", + * // defaultTimestamp: new Date("TIMESTAMP"), + * // defaultBlob: new Uint8Array(), + * // defaultByte: 0, // BYTE_VALUE + * // defaultShort: Number("short"), + * // defaultInteger: Number("int"), + * // defaultLong: Number("long"), + * // defaultFloat: Number("float"), + * // defaultDouble: Number("double"), + * // defaultMap: { // TestStringMap + * // "": "STRING_VALUE", + * // }, + * // defaultEnum: "FOO" || "BAR" || "BAZ", + * // defaultIntEnum: 1 || 2, + * // emptyString: "STRING_VALUE", + * // falseBoolean: true || false, + * // emptyBlob: new Uint8Array(), + * // zeroByte: 0, // BYTE_VALUE + * // zeroShort: Number("short"), + * // zeroInteger: Number("int"), + * // zeroLong: Number("long"), + * // zeroFloat: Number("float"), + * // zeroDouble: Number("double"), + * // }; + * + * ``` + * + * @param OperationWithDefaultsCommandInput - {@link OperationWithDefaultsCommandInput} + * @returns {@link OperationWithDefaultsCommandOutput} + * @see {@link OperationWithDefaultsCommandInput} for command's `input` shape. + * @see {@link OperationWithDefaultsCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class OperationWithDefaultsCommand extends $Command + .classBuilder< + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "OperationWithDefaults", {}) + .n("JSONRPC10Client", "OperationWithDefaultsCommand") + .f(void 0, void 0) + .sc(OperationWithDefaults) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OperationWithDefaultsInput; + output: OperationWithDefaultsOutput; + }; + sdk: { + input: OperationWithDefaultsCommandInput; + output: OperationWithDefaultsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/OperationWithNestedStructureCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithNestedStructureCommand.ts new file mode 100644 index 0000000000000..8330fd5f31211 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithNestedStructureCommand.ts @@ -0,0 +1,140 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { OperationWithNestedStructureInput, OperationWithNestedStructureOutput } from "../models/models_0"; +import { OperationWithNestedStructure } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithNestedStructureCommand}. + */ +export interface OperationWithNestedStructureCommandInput extends OperationWithNestedStructureInput {} +/** + * @public + * + * The output of {@link OperationWithNestedStructureCommand}. + */ +export interface OperationWithNestedStructureCommandOutput + extends OperationWithNestedStructureOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, OperationWithNestedStructureCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, OperationWithNestedStructureCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // OperationWithNestedStructureInput + * topLevel: { // TopLevel + * dialog: { // Dialog + * language: "STRING_VALUE", + * greeting: "STRING_VALUE", + * farewell: { // Farewell + * phrase: "STRING_VALUE", + * }, + * }, + * dialogList: [ // DialogList + * { + * language: "STRING_VALUE", + * greeting: "STRING_VALUE", + * farewell: { + * phrase: "STRING_VALUE", + * }, + * }, + * ], + * dialogMap: { // DialogMap + * "": { + * language: "STRING_VALUE", + * greeting: "STRING_VALUE", + * farewell: { + * phrase: "STRING_VALUE", + * }, + * }, + * }, + * }, + * }; + * const command = new OperationWithNestedStructureCommand(input); + * const response = await client.send(command); + * // { // OperationWithNestedStructureOutput + * // dialog: { // Dialog + * // language: "STRING_VALUE", + * // greeting: "STRING_VALUE", + * // farewell: { // Farewell + * // phrase: "STRING_VALUE", + * // }, + * // }, + * // dialogList: [ // DialogList + * // { + * // language: "STRING_VALUE", + * // greeting: "STRING_VALUE", + * // farewell: { + * // phrase: "STRING_VALUE", + * // }, + * // }, + * // ], + * // dialogMap: { // DialogMap + * // "": { + * // 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 JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class OperationWithNestedStructureCommand extends $Command + .classBuilder< + OperationWithNestedStructureCommandInput, + OperationWithNestedStructureCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "OperationWithNestedStructure", {}) + .n("JSONRPC10Client", "OperationWithNestedStructureCommand") + .f(void 0, void 0) + .sc(OperationWithNestedStructure) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OperationWithNestedStructureInput; + output: OperationWithNestedStructureOutput; + }; + sdk: { + input: OperationWithNestedStructureCommandInput; + output: OperationWithNestedStructureCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/OperationWithRequiredMembersCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithRequiredMembersCommand.ts new file mode 100644 index 0000000000000..26995da9a822c --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithRequiredMembersCommand.ts @@ -0,0 +1,103 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { OperationWithRequiredMembersOutput } from "../models/models_0"; +import { OperationWithRequiredMembers } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithRequiredMembersCommand}. + */ +export interface OperationWithRequiredMembersCommandInput {} +/** + * @public + * + * The output of {@link OperationWithRequiredMembersCommand}. + */ +export interface OperationWithRequiredMembersCommandOutput + extends OperationWithRequiredMembersOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, OperationWithRequiredMembersCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, OperationWithRequiredMembersCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = {}; + * const command = new OperationWithRequiredMembersCommand(input); + * const response = await client.send(command); + * // { // OperationWithRequiredMembersOutput + * // requiredString: "STRING_VALUE", // required + * // requiredBoolean: true || false, // required + * // requiredList: [ // RequiredStringList // required + * // "STRING_VALUE", + * // ], + * // requiredTimestamp: new Date("TIMESTAMP"), // required + * // requiredBlob: new Uint8Array(), // required + * // requiredByte: 0, // BYTE_VALUE // required + * // requiredShort: Number("short"), // required + * // requiredInteger: Number("int"), // required + * // requiredLong: Number("long"), // required + * // requiredFloat: Number("float"), // required + * // requiredDouble: Number("double"), // required + * // requiredMap: { // RequiredStringMap // required + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param OperationWithRequiredMembersCommandInput - {@link OperationWithRequiredMembersCommandInput} + * @returns {@link OperationWithRequiredMembersCommandOutput} + * @see {@link OperationWithRequiredMembersCommandInput} for command's `input` shape. + * @see {@link OperationWithRequiredMembersCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class OperationWithRequiredMembersCommand extends $Command + .classBuilder< + OperationWithRequiredMembersCommandInput, + OperationWithRequiredMembersCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "OperationWithRequiredMembers", {}) + .n("JSONRPC10Client", "OperationWithRequiredMembersCommand") + .f(void 0, void 0) + .sc(OperationWithRequiredMembers) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: OperationWithRequiredMembersOutput; + }; + sdk: { + input: OperationWithRequiredMembersCommandInput; + output: OperationWithRequiredMembersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/OperationWithRequiredMembersWithDefaultsCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithRequiredMembersWithDefaultsCommand.ts new file mode 100644 index 0000000000000..d2b9e0a551f76 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/OperationWithRequiredMembersWithDefaultsCommand.ts @@ -0,0 +1,105 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { OperationWithRequiredMembersWithDefaultsOutput } from "../models/models_0"; +import { OperationWithRequiredMembersWithDefaults } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithRequiredMembersWithDefaultsCommand}. + */ +export interface OperationWithRequiredMembersWithDefaultsCommandInput {} +/** + * @public + * + * The output of {@link OperationWithRequiredMembersWithDefaultsCommand}. + */ +export interface OperationWithRequiredMembersWithDefaultsCommandOutput + extends OperationWithRequiredMembersWithDefaultsOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, OperationWithRequiredMembersWithDefaultsCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, OperationWithRequiredMembersWithDefaultsCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = {}; + * const command = new OperationWithRequiredMembersWithDefaultsCommand(input); + * const response = await client.send(command); + * // { // OperationWithRequiredMembersWithDefaultsOutput + * // requiredString: "STRING_VALUE", // required + * // requiredBoolean: true || false, // required + * // requiredList: [ // RequiredStringList // required + * // "STRING_VALUE", + * // ], + * // requiredTimestamp: new Date("TIMESTAMP"), // required + * // requiredBlob: new Uint8Array(), // required + * // requiredByte: 0, // BYTE_VALUE // required + * // requiredShort: Number("short"), // required + * // requiredInteger: Number("int"), // required + * // requiredLong: Number("long"), // required + * // requiredFloat: Number("float"), // required + * // requiredDouble: Number("double"), // required + * // requiredMap: { // RequiredStringMap // required + * // "": "STRING_VALUE", + * // }, + * // requiredEnum: "FOO" || "BAR" || "BAZ", // required + * // requiredIntEnum: 1 || 2, // required + * // }; + * + * ``` + * + * @param OperationWithRequiredMembersWithDefaultsCommandInput - {@link OperationWithRequiredMembersWithDefaultsCommandInput} + * @returns {@link OperationWithRequiredMembersWithDefaultsCommandOutput} + * @see {@link OperationWithRequiredMembersWithDefaultsCommandInput} for command's `input` shape. + * @see {@link OperationWithRequiredMembersWithDefaultsCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class OperationWithRequiredMembersWithDefaultsCommand extends $Command + .classBuilder< + OperationWithRequiredMembersWithDefaultsCommandInput, + OperationWithRequiredMembersWithDefaultsCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "OperationWithRequiredMembersWithDefaults", {}) + .n("JSONRPC10Client", "OperationWithRequiredMembersWithDefaultsCommand") + .f(void 0, void 0) + .sc(OperationWithRequiredMembersWithDefaults) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: OperationWithRequiredMembersWithDefaultsOutput; + }; + sdk: { + input: OperationWithRequiredMembersWithDefaultsCommandInput; + output: OperationWithRequiredMembersWithDefaultsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/PutWithContentEncodingCommand.ts new file mode 100644 index 0000000000000..938d24a0e5076 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/PutWithContentEncodingCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { PutWithContentEncodingInput } from "../models/models_0"; +import { PutWithContentEncoding } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandInput extends PutWithContentEncodingInput {} +/** + * @public + * + * The output of {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, PutWithContentEncodingCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, PutWithContentEncodingCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // PutWithContentEncodingInput + * encoding: "STRING_VALUE", + * data: "STRING_VALUE", + * }; + * const command = new PutWithContentEncodingCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param PutWithContentEncodingCommandInput - {@link PutWithContentEncodingCommandInput} + * @returns {@link PutWithContentEncodingCommandOutput} + * @see {@link PutWithContentEncodingCommandInput} for command's `input` shape. + * @see {@link PutWithContentEncodingCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class PutWithContentEncodingCommand extends $Command + .classBuilder< + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [ + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getCompressionPlugin(config, { + encodings: ["gzip"], + }), + ]; + }) + .s("JsonRpc10", "PutWithContentEncoding", {}) + .n("JSONRPC10Client", "PutWithContentEncodingCommand") + .f(void 0, void 0) + .sc(PutWithContentEncoding) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutWithContentEncodingInput; + output: {}; + }; + sdk: { + input: PutWithContentEncodingCommandInput; + output: PutWithContentEncodingCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/SimpleScalarPropertiesCommand.ts b/private/aws-protocoltests-json-10-schema/src/commands/SimpleScalarPropertiesCommand.ts new file mode 100644 index 0000000000000..da46f0fbe5100 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/SimpleScalarPropertiesCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JSONRPC10ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JSONRPC10Client"; +import { SimpleScalarPropertiesInput, SimpleScalarPropertiesOutput } from "../models/models_0"; +import { SimpleScalarProperties } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandInput extends SimpleScalarPropertiesInput {} +/** + * @public + * + * The output of {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandOutput extends SimpleScalarPropertiesOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JSONRPC10Client, SimpleScalarPropertiesCommand } from "@aws-sdk/aws-protocoltests-json-10-schema"; // ES Modules import + * // const { JSONRPC10Client, SimpleScalarPropertiesCommand } = require("@aws-sdk/aws-protocoltests-json-10-schema"); // CommonJS import + * const client = new JSONRPC10Client(config); + * const input = { // SimpleScalarPropertiesInput + * floatValue: Number("float"), + * doubleValue: Number("double"), + * }; + * const command = new SimpleScalarPropertiesCommand(input); + * const response = await client.send(command); + * // { // SimpleScalarPropertiesOutput + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }; + * + * ``` + * + * @param SimpleScalarPropertiesCommandInput - {@link SimpleScalarPropertiesCommandInput} + * @returns {@link SimpleScalarPropertiesCommandOutput} + * @see {@link SimpleScalarPropertiesCommandInput} for command's `input` shape. + * @see {@link SimpleScalarPropertiesCommandOutput} for command's `response` shape. + * @see {@link JSONRPC10ClientResolvedConfig | config} for JSONRPC10Client's `config` shape. + * + * @throws {@link JSONRPC10ServiceException} + *

Base exception class for all service exceptions from JSONRPC10 service.

+ * + * + */ +export class SimpleScalarPropertiesCommand extends $Command + .classBuilder< + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, + JSONRPC10ClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonRpc10", "SimpleScalarProperties", {}) + .n("JSONRPC10Client", "SimpleScalarPropertiesCommand") + .f(void 0, void 0) + .sc(SimpleScalarProperties) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleScalarPropertiesInput; + output: SimpleScalarPropertiesOutput; + }; + sdk: { + input: SimpleScalarPropertiesCommandInput; + output: SimpleScalarPropertiesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/commands/index.ts b/private/aws-protocoltests-json-10-schema/src/commands/index.ts new file mode 100644 index 0000000000000..62d4da9ffed0d --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/commands/index.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +export * from "./ContentTypeParametersCommand"; +export * from "./EmptyInputAndEmptyOutputCommand"; +export * from "./EndpointOperationCommand"; +export * from "./EndpointWithHostLabelOperationCommand"; +export * from "./GreetingWithErrorsCommand"; +export * from "./HostWithPathOperationCommand"; +export * from "./JsonUnionsCommand"; +export * from "./NoInputAndNoOutputCommand"; +export * from "./NoInputAndOutputCommand"; +export * from "./OperationWithDefaultsCommand"; +export * from "./OperationWithNestedStructureCommand"; +export * from "./OperationWithRequiredMembersCommand"; +export * from "./OperationWithRequiredMembersWithDefaultsCommand"; +export * from "./PutWithContentEncodingCommand"; +export * from "./SimpleScalarPropertiesCommand"; diff --git a/private/aws-protocoltests-json-10-schema/src/endpoint/EndpointParameters.ts b/private/aws-protocoltests-json-10-schema/src/endpoint/EndpointParameters.ts new file mode 100644 index 0000000000000..cab444798c536 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/endpoint/EndpointParameters.ts @@ -0,0 +1,29 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return Object.assign(options, { + defaultSigningName: "jsonrpc10", + }); +}; + +export const commonParams = { + endpoint: { type: "builtInParams", name: "endpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + endpoint?: string; +} diff --git a/private/aws-protocoltests-json-10-schema/src/endpoint/endpointResolver.ts b/private/aws-protocoltests-json-10-schema/src/endpoint/endpointResolver.ts new file mode 100644 index 0000000000000..8bb222967df85 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["endpoint"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/private/aws-protocoltests-json-10-schema/src/endpoint/ruleset.ts b/private/aws-protocoltests-json-10-schema/src/endpoint/ruleset.ts new file mode 100644 index 0000000000000..14416a50b2697 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/endpoint/ruleset.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { RuleSetObject } from "@smithy/types"; + +export const ruleSet: RuleSetObject = { + version: "1.0", + parameters: { + endpoint: { + type: "string", + builtIn: "SDK::Endpoint", + documentation: "Endpoint used for making requests. Should be formatted as a URI.", + }, + }, + rules: [ + { + conditions: [ + { + fn: "isSet", + argv: [ + { + ref: "endpoint", + }, + ], + }, + ], + endpoint: { + url: { + ref: "endpoint", + }, + }, + type: "endpoint", + }, + { + conditions: [], + error: "(default endpointRuleSet) endpoint is not set - you must configure an endpoint.", + type: "error", + }, + ], +}; diff --git a/private/aws-protocoltests-json-10-schema/src/extensionConfiguration.ts b/private/aws-protocoltests-json-10-schema/src/extensionConfiguration.ts new file mode 100644 index 0000000000000..3c838f213f87f --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface JSONRPC10ExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/private/aws-protocoltests-json-10-schema/src/index.ts b/private/aws-protocoltests-json-10-schema/src/index.ts new file mode 100644 index 0000000000000..7bf9ab4356205 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/index.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +/* eslint-disable */ +export * from "./JSONRPC10Client"; +export * from "./JSONRPC10"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { JSONRPC10ExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { JSONRPC10ServiceException } from "./models/JSONRPC10ServiceException"; diff --git a/private/aws-protocoltests-json-10-schema/src/models/JSONRPC10ServiceException.ts b/private/aws-protocoltests-json-10-schema/src/models/JSONRPC10ServiceException.ts new file mode 100644 index 0000000000000..9d4aa1fdb3ff6 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/models/JSONRPC10ServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from JSONRPC10 service. + */ +export class JSONRPC10ServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, JSONRPC10ServiceException.prototype); + } +} diff --git a/private/aws-protocoltests-json-10-schema/src/models/index.ts b/private/aws-protocoltests-json-10-schema/src/models/index.ts new file mode 100644 index 0000000000000..9eaceb12865f8 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/private/aws-protocoltests-json-10-schema/src/models/models_0.ts b/private/aws-protocoltests-json-10-schema/src/models/models_0.ts new file mode 100644 index 0000000000000..bcdd073298b85 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/models/models_0.ts @@ -0,0 +1,611 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; +import { DocumentType as __DocumentType } from "@smithy/types"; + +import { JSONRPC10ServiceException as __BaseException } from "./JSONRPC10ServiceException"; + +/** + * @public + */ +export interface GreetingStruct { + hi?: string | undefined; +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} + +/** + * @public + */ +export interface ClientOptionalDefaults { + member?: number | undefined; +} + +/** + * @public + */ +export interface ComplexNestedErrorData { + Foo?: string | undefined; +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name: "ComplexError" = "ComplexError"; + readonly $fault: "client" = "client"; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * @public + */ +export interface ContentTypeParametersInput { + value?: number | undefined; +} + +/** + * @public + */ +export interface ContentTypeParametersOutput {} + +/** + * @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 | undefined; + defaultBoolean?: boolean | undefined; + defaultList?: string[] | undefined; + defaultDocumentMap?: __DocumentType | undefined; + defaultDocumentString?: __DocumentType | undefined; + defaultDocumentBoolean?: __DocumentType | undefined; + defaultDocumentList?: __DocumentType | undefined; + defaultNullDocument?: __DocumentType | undefined; + defaultTimestamp?: Date | undefined; + defaultBlob?: Uint8Array | undefined; + defaultByte?: number | undefined; + defaultShort?: number | undefined; + defaultInteger?: number | undefined; + defaultLong?: number | undefined; + defaultFloat?: number | undefined; + defaultDouble?: number | undefined; + defaultMap?: Record | undefined; + defaultEnum?: TestEnum | undefined; + defaultIntEnum?: TestIntEnum | undefined; + emptyString?: string | undefined; + falseBoolean?: boolean | undefined; + emptyBlob?: Uint8Array | undefined; + zeroByte?: number | undefined; + zeroShort?: number | undefined; + zeroInteger?: number | undefined; + zeroLong?: number | undefined; + zeroFloat?: number | undefined; + zeroDouble?: number | undefined; +} + +/** + * @public + */ +export interface Farewell { + phrase?: string | undefined; +} + +/** + * @public + */ +export interface Dialog { + language?: string | undefined; + greeting?: string | undefined; + farewell?: Farewell | undefined; +} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputInput {} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputOutput {} + +/** + * @public + */ +export interface EndpointWithHostLabelOperationInput { + label: string | undefined; +} + +/** + * This error has test cases that test some of the dark corners of Amazon service + * framework history. It should only be implemented by clients. + * @public + */ +export class FooError extends __BaseException { + readonly name: "FooError" = "FooError"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "FooError", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, FooError.prototype); + } +} + +/** + * @public + */ +export interface GreetingWithErrorsInput { + greeting?: string | undefined; +} + +/** + * @public + */ +export interface GreetingWithErrorsOutput { + greeting?: string | undefined; +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name: "InvalidGreeting" = "InvalidGreeting"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} + +/** + * A union with a representative set of types for members. + * @public + */ +export type MyUnion = + | MyUnion.BlobValueMember + | MyUnion.BooleanValueMember + | MyUnion.EnumValueMember + | MyUnion.IntEnumValueMember + | MyUnion.ListValueMember + | MyUnion.MapValueMember + | MyUnion.NumberValueMember + | MyUnion.StringValueMember + | MyUnion.StructureValueMember + | MyUnion.TimestampValueMember + | MyUnion.$UnknownMember; + +/** + * @public + */ +export namespace MyUnion { + export interface StringValueMember { + stringValue: string; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface BooleanValueMember { + stringValue?: never; + booleanValue: boolean; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface NumberValueMember { + stringValue?: never; + booleanValue?: never; + numberValue: number; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface BlobValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue: Uint8Array; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface TimestampValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue: Date; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface EnumValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue: FooEnum; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface IntEnumValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue: IntegerEnum; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface ListValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue: string[]; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface MapValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue: Record; + structureValue?: never; + $unknown?: never; + } + + export interface StructureValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue: GreetingStruct; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + intEnumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown: [string, any]; + } + + export interface Visitor { + stringValue: (value: string) => T; + booleanValue: (value: boolean) => T; + numberValue: (value: number) => T; + blobValue: (value: Uint8Array) => T; + timestampValue: (value: Date) => T; + enumValue: (value: FooEnum) => T; + intEnumValue: (value: IntegerEnum) => T; + listValue: (value: string[]) => T; + mapValue: (value: Record) => T; + structureValue: (value: GreetingStruct) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: MyUnion, visitor: Visitor): T => { + if (value.stringValue !== undefined) return visitor.stringValue(value.stringValue); + if (value.booleanValue !== undefined) return visitor.booleanValue(value.booleanValue); + if (value.numberValue !== undefined) return visitor.numberValue(value.numberValue); + if (value.blobValue !== undefined) return visitor.blobValue(value.blobValue); + if (value.timestampValue !== undefined) return visitor.timestampValue(value.timestampValue); + if (value.enumValue !== undefined) return visitor.enumValue(value.enumValue); + if (value.intEnumValue !== undefined) return visitor.intEnumValue(value.intEnumValue); + if (value.listValue !== undefined) return visitor.listValue(value.listValue); + if (value.mapValue !== undefined) return visitor.mapValue(value.mapValue); + if (value.structureValue !== undefined) return visitor.structureValue(value.structureValue); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface JsonUnionsInput { + /** + * A union with a representative set of types for members. + * @public + */ + contents?: MyUnion | undefined; +} + +/** + * @public + */ +export interface JsonUnionsOutput { + /** + * A union with a representative set of types for members. + * @public + */ + contents?: MyUnion | undefined; +} + +/** + * @public + */ +export interface NoInputAndOutputOutput {} + +/** + * @public + */ +export interface OperationWithDefaultsInput { + defaults?: Defaults | undefined; + clientOptionalDefaults?: ClientOptionalDefaults | undefined; + topLevelDefault?: string | undefined; + otherTopLevelDefault?: number | undefined; +} + +/** + * @public + */ +export interface OperationWithDefaultsOutput { + defaultString?: string | undefined; + defaultBoolean?: boolean | undefined; + defaultList?: string[] | undefined; + defaultDocumentMap?: __DocumentType | undefined; + defaultDocumentString?: __DocumentType | undefined; + defaultDocumentBoolean?: __DocumentType | undefined; + defaultDocumentList?: __DocumentType | undefined; + defaultNullDocument?: __DocumentType | undefined; + defaultTimestamp?: Date | undefined; + defaultBlob?: Uint8Array | undefined; + defaultByte?: number | undefined; + defaultShort?: number | undefined; + defaultInteger?: number | undefined; + defaultLong?: number | undefined; + defaultFloat?: number | undefined; + defaultDouble?: number | undefined; + defaultMap?: Record | undefined; + defaultEnum?: TestEnum | undefined; + defaultIntEnum?: TestIntEnum | undefined; + emptyString?: string | undefined; + falseBoolean?: boolean | undefined; + emptyBlob?: Uint8Array | undefined; + zeroByte?: number | undefined; + zeroShort?: number | undefined; + zeroInteger?: number | undefined; + zeroLong?: number | undefined; + zeroFloat?: number | undefined; + zeroDouble?: number | undefined; +} + +/** + * @public + */ +export interface TopLevel { + dialog: Dialog | undefined; + dialogList?: Dialog[] | undefined; + dialogMap?: Record | undefined; +} + +/** + * @public + */ +export interface OperationWithNestedStructureInput { + topLevel: TopLevel | undefined; +} + +/** + * @public + */ +export interface OperationWithNestedStructureOutput { + dialog: Dialog | undefined; + dialogList?: Dialog[] | undefined; + dialogMap?: Record | undefined; +} + +/** + * @public + */ +export interface OperationWithRequiredMembersOutput { + requiredString: string | undefined; + requiredBoolean: boolean | undefined; + requiredList: string[] | undefined; + requiredTimestamp: Date | undefined; + requiredBlob: Uint8Array | undefined; + requiredByte: number | undefined; + requiredShort: number | undefined; + requiredInteger: number | undefined; + requiredLong: number | undefined; + requiredFloat: number | undefined; + requiredDouble: number | undefined; + requiredMap: Record | undefined; +} + +/** + * @public + * @enum + */ +export const RequiredEnum = { + BAR: "BAR", + BAZ: "BAZ", + FOO: "FOO", +} as const; +/** + * @public + */ +export type RequiredEnum = (typeof RequiredEnum)[keyof typeof RequiredEnum]; + +export enum RequiredIntEnum { + ONE = 1, + TWO = 2, +} + +/** + * @public + */ +export interface OperationWithRequiredMembersWithDefaultsOutput { + requiredString: string | undefined; + requiredBoolean: boolean | undefined; + requiredList: string[] | undefined; + requiredTimestamp: Date | undefined; + requiredBlob: Uint8Array | undefined; + requiredByte: number | undefined; + requiredShort: number | undefined; + requiredInteger: number | undefined; + requiredLong: number | undefined; + requiredFloat: number | undefined; + requiredDouble: number | undefined; + requiredMap: Record | undefined; + requiredEnum: RequiredEnum | undefined; + requiredIntEnum: RequiredIntEnum | undefined; +} + +/** + * @public + */ +export interface PutWithContentEncodingInput { + encoding?: string | undefined; + data?: string | undefined; +} + +/** + * @public + */ +export interface SimpleScalarPropertiesInput { + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export interface SimpleScalarPropertiesOutput { + floatValue?: number | undefined; + doubleValue?: number | undefined; +} diff --git a/private/aws-protocoltests-json-10-schema/src/protocols/Aws_json1_0.ts b/private/aws-protocoltests-json-10-schema/src/protocols/Aws_json1_0.ts new file mode 100644 index 0000000000000..7bd8fa7b2884b --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/protocols/Aws_json1_0.ts @@ -0,0 +1,1056 @@ +// smithy-typescript generated code +import { + awsExpectUnion as __expectUnion, + loadRestJsonErrorCode, + parseJsonBody as parseBody, + parseJsonErrorBody as parseErrorBody, +} from "@aws-sdk/core"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, + isValidHostname as __isValidHostname, +} from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, + expectByte as __expectByte, + expectInt32 as __expectInt32, + expectLong as __expectLong, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectShort as __expectShort, + expectString as __expectString, + limitedParseDouble as __limitedParseDouble, + limitedParseFloat32 as __limitedParseFloat32, + parseEpochTimestamp as __parseEpochTimestamp, + serializeFloat as __serializeFloat, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + DocumentType as __DocumentType, + Endpoint as __Endpoint, + HeaderBag as __HeaderBag, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "../commands/ContentTypeParametersCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "../commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "../commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "../commands/EndpointWithHostLabelOperationCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "../commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "../commands/HostWithPathOperationCommand"; +import { JsonUnionsCommandInput, JsonUnionsCommandOutput } from "../commands/JsonUnionsCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "../commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "../commands/NoInputAndOutputCommand"; +import { + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, +} from "../commands/OperationWithDefaultsCommand"; +import { + OperationWithNestedStructureCommandInput, + OperationWithNestedStructureCommandOutput, +} from "../commands/OperationWithNestedStructureCommand"; +import { + OperationWithRequiredMembersCommandInput, + OperationWithRequiredMembersCommandOutput, +} from "../commands/OperationWithRequiredMembersCommand"; +import { + OperationWithRequiredMembersWithDefaultsCommandInput, + OperationWithRequiredMembersWithDefaultsCommandOutput, +} from "../commands/OperationWithRequiredMembersWithDefaultsCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "../commands/PutWithContentEncodingCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "../commands/SimpleScalarPropertiesCommand"; +import { JSONRPC10ServiceException as __BaseException } from "../models/JSONRPC10ServiceException"; +import { + ClientOptionalDefaults, + ComplexError, + ComplexNestedErrorData, + ContentTypeParametersInput, + Defaults, + Dialog, + EmptyInputAndEmptyOutputInput, + EndpointWithHostLabelOperationInput, + Farewell, + FooError, + GreetingStruct, + GreetingWithErrorsInput, + InvalidGreeting, + JsonUnionsInput, + JsonUnionsOutput, + MyUnion, + OperationWithDefaultsInput, + OperationWithDefaultsOutput, + OperationWithNestedStructureInput, + OperationWithRequiredMembersOutput, + OperationWithRequiredMembersWithDefaultsOutput, + PutWithContentEncodingInput, + SimpleScalarPropertiesInput, + SimpleScalarPropertiesOutput, + TopLevel, +} from "../models/models_0"; + +/** + * serializeAws_json1_0ContentTypeParametersCommand + */ +export const se_ContentTypeParametersCommand = async ( + input: ContentTypeParametersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ContentTypeParameters"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0EmptyInputAndEmptyOutputCommand + */ +export const se_EmptyInputAndEmptyOutputCommand = async ( + input: EmptyInputAndEmptyOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("EmptyInputAndEmptyOutput"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0EndpointOperationCommand + */ +export const se_EndpointOperationCommand = async ( + input: EndpointOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("EndpointOperation"); + const body = "{}"; + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo." + resolvedHostname; + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_json1_0EndpointWithHostLabelOperationCommand + */ +export const se_EndpointWithHostLabelOperationCommand = async ( + input: EndpointWithHostLabelOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("EndpointWithHostLabelOperation"); + let body: any; + body = JSON.stringify(_json(input)); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo.{label}." + resolvedHostname; + if (input.label === undefined) { + throw new Error("Empty value provided for input host prefix: label."); + } + resolvedHostname = resolvedHostname.replace("{label}", input.label!); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_json1_0GreetingWithErrorsCommand + */ +export const se_GreetingWithErrorsCommand = async ( + input: GreetingWithErrorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GreetingWithErrors"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0HostWithPathOperationCommand + */ +export const se_HostWithPathOperationCommand = async ( + input: HostWithPathOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("HostWithPathOperation"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0JsonUnionsCommand + */ +export const se_JsonUnionsCommand = async ( + input: JsonUnionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("JsonUnions"); + let body: any; + body = JSON.stringify(se_JsonUnionsInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0NoInputAndNoOutputCommand + */ +export const se_NoInputAndNoOutputCommand = async ( + input: NoInputAndNoOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("NoInputAndNoOutput"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0NoInputAndOutputCommand + */ +export const se_NoInputAndOutputCommand = async ( + input: NoInputAndOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("NoInputAndOutput"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0OperationWithDefaultsCommand + */ +export const se_OperationWithDefaultsCommand = async ( + input: OperationWithDefaultsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("OperationWithDefaults"); + let body: any; + body = JSON.stringify(se_OperationWithDefaultsInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0OperationWithNestedStructureCommand + */ +export const se_OperationWithNestedStructureCommand = async ( + input: OperationWithNestedStructureCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("OperationWithNestedStructure"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0OperationWithRequiredMembersCommand + */ +export const se_OperationWithRequiredMembersCommand = async ( + input: OperationWithRequiredMembersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("OperationWithRequiredMembers"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0OperationWithRequiredMembersWithDefaultsCommand + */ +export const se_OperationWithRequiredMembersWithDefaultsCommand = async ( + input: OperationWithRequiredMembersWithDefaultsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("OperationWithRequiredMembersWithDefaults"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0PutWithContentEncodingCommand + */ +export const se_PutWithContentEncodingCommand = async ( + input: PutWithContentEncodingCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("PutWithContentEncoding"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0SimpleScalarPropertiesCommand + */ +export const se_SimpleScalarPropertiesCommand = async ( + input: SimpleScalarPropertiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("SimpleScalarProperties"); + let body: any; + body = JSON.stringify(se_SimpleScalarPropertiesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * deserializeAws_json1_0ContentTypeParametersCommand + */ +export const de_ContentTypeParametersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ContentTypeParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0EmptyInputAndEmptyOutputCommand + */ +export const de_EmptyInputAndEmptyOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: EmptyInputAndEmptyOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0EndpointOperationCommand + */ +export const de_EndpointOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_0EndpointWithHostLabelOperationCommand + */ +export const de_EndpointWithHostLabelOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointWithHostLabelOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_0GreetingWithErrorsCommand + */ +export const de_GreetingWithErrorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GreetingWithErrorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0HostWithPathOperationCommand + */ +export const de_HostWithPathOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: HostWithPathOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_0JsonUnionsCommand + */ +export const de_JsonUnionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_JsonUnionsOutput(data, context); + const response: JsonUnionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0NoInputAndNoOutputCommand + */ +export const de_NoInputAndNoOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: NoInputAndNoOutputCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_0NoInputAndOutputCommand + */ +export const de_NoInputAndOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: NoInputAndOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0OperationWithDefaultsCommand + */ +export const de_OperationWithDefaultsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OperationWithDefaultsOutput(data, context); + const response: OperationWithDefaultsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0OperationWithNestedStructureCommand + */ +export const de_OperationWithNestedStructureCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: OperationWithNestedStructureCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0OperationWithRequiredMembersCommand + */ +export const de_OperationWithRequiredMembersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OperationWithRequiredMembersOutput(data, context); + const response: OperationWithRequiredMembersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0OperationWithRequiredMembersWithDefaultsCommand + */ +export const de_OperationWithRequiredMembersWithDefaultsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OperationWithRequiredMembersWithDefaultsOutput(data, context); + const response: OperationWithRequiredMembersWithDefaultsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0PutWithContentEncodingCommand + */ +export const de_PutWithContentEncodingCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: PutWithContentEncodingCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_0SimpleScalarPropertiesCommand + */ +export const de_SimpleScalarPropertiesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SimpleScalarPropertiesOutput(data, context); + const response: SimpleScalarPropertiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Aws_json1_0CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.json10#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "FooError": + case "aws.protocoltests.json10#FooError": + throw await de_FooErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.json10#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } +}; + +/** + * deserializeAws_json1_0ComplexErrorRes + */ +const de_ComplexErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_ComplexError(body, context); + const exception = new ComplexError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0FooErrorRes + */ +const de_FooErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new FooError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0InvalidGreetingRes + */ +const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new InvalidGreeting({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +// se_ClientOptionalDefaults omitted. + +// se_ContentTypeParametersInput omitted. + +/** + * serializeAws_json1_0Defaults + */ +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_Dialog omitted. + +// se_DialogList omitted. + +// se_DialogMap omitted. + +// se_EmptyInputAndEmptyOutputInput omitted. + +// se_EndpointWithHostLabelOperationInput omitted. + +// se_Farewell omitted. + +// se_GreetingWithErrorsInput omitted. + +/** + * serializeAws_json1_0JsonUnionsInput + */ +const se_JsonUnionsInput = (input: JsonUnionsInput, context: __SerdeContext): any => { + return take(input, { + contents: (_) => se_MyUnion(_, context), + }); +}; + +/** + * serializeAws_json1_0MyUnion + */ +const se_MyUnion = (input: MyUnion, context: __SerdeContext): any => { + return MyUnion.visit(input, { + blobValue: (value) => ({ blobValue: context.base64Encoder(value) }), + booleanValue: (value) => ({ booleanValue: value }), + enumValue: (value) => ({ enumValue: value }), + intEnumValue: (value) => ({ intEnumValue: value }), + listValue: (value) => ({ listValue: _json(value) }), + mapValue: (value) => ({ mapValue: _json(value) }), + numberValue: (value) => ({ numberValue: value }), + stringValue: (value) => ({ stringValue: value }), + structureValue: (value) => ({ structureValue: _json(value) }), + timestampValue: (value) => ({ timestampValue: value.getTime() / 1_000 }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + +/** + * serializeAws_json1_0OperationWithDefaultsInput + */ +const se_OperationWithDefaultsInput = (input: OperationWithDefaultsInput, context: __SerdeContext): any => { + return take(input, { + clientOptionalDefaults: _json, + defaults: (_) => se_Defaults(_, context), + otherTopLevelDefault: [], + topLevelDefault: [], + }); +}; + +// se_OperationWithNestedStructureInput omitted. + +// se_PutWithContentEncodingInput omitted. + +/** + * serializeAws_json1_0SimpleScalarPropertiesInput + */ +const se_SimpleScalarPropertiesInput = (input: SimpleScalarPropertiesInput, context: __SerdeContext): any => { + return take(input, { + doubleValue: __serializeFloat, + floatValue: __serializeFloat, + }); +}; + +// se_TestStringList omitted. + +// se_TestStringMap omitted. + +// se_TopLevel omitted. + +// se_GreetingStruct omitted. + +// se_StringList omitted. + +// se_StringMap omitted. + +/** + * serializeAws_json1_0Document + */ +const se_Document = (input: __DocumentType, context: __SerdeContext): any => { + return input; +}; + +/** + * deserializeAws_json1_0ComplexError + */ +const de_ComplexError = (output: any, context: __SerdeContext): ComplexError => { + return take(output, { + Nested: (_: any) => de_ComplexNestedErrorData(_, context), + TopLevel: __expectString, + }) as any; +}; + +/** + * deserializeAws_json1_0ComplexNestedErrorData + */ +const de_ComplexNestedErrorData = (output: any, context: __SerdeContext): ComplexNestedErrorData => { + return take(output, { + Foo: [, __expectString, `Foo`], + }) as any; +}; + +// de_ContentTypeParametersOutput omitted. + +// de_Dialog omitted. + +// de_DialogList omitted. + +// de_DialogMap omitted. + +// de_EmptyInputAndEmptyOutputOutput omitted. + +// de_Farewell omitted. + +// de_FooError omitted. + +// de_GreetingWithErrorsOutput omitted. + +// de_InvalidGreeting omitted. + +/** + * deserializeAws_json1_0JsonUnionsOutput + */ +const de_JsonUnionsOutput = (output: any, context: __SerdeContext): JsonUnionsOutput => { + return take(output, { + contents: (_: any) => de_MyUnion(__expectUnion(_), context), + }) as any; +}; + +/** + * deserializeAws_json1_0MyUnion + */ +const de_MyUnion = (output: any, context: __SerdeContext): MyUnion => { + if (output.blobValue != null) { + return { + blobValue: context.base64Decoder(output.blobValue), + }; + } + if (__expectBoolean(output.booleanValue) !== undefined) { + return { booleanValue: __expectBoolean(output.booleanValue) as any }; + } + if (__expectString(output.enumValue) !== undefined) { + return { enumValue: __expectString(output.enumValue) as any }; + } + if (__expectInt32(output.intEnumValue) !== undefined) { + return { intEnumValue: __expectInt32(output.intEnumValue) as any }; + } + if (output.listValue != null) { + return { + listValue: _json(output.listValue), + }; + } + if (output.mapValue != null) { + return { + mapValue: _json(output.mapValue), + }; + } + if (__expectInt32(output.numberValue) !== undefined) { + return { numberValue: __expectInt32(output.numberValue) as any }; + } + if (__expectString(output.stringValue) !== undefined) { + return { stringValue: __expectString(output.stringValue) as any }; + } + if (output.structureValue != null) { + return { + structureValue: _json(output.structureValue), + }; + } + if (output.timestampValue != null) { + return { + timestampValue: __expectNonNull(__parseEpochTimestamp(__expectNumber(output.timestampValue))), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +// de_NoInputAndOutputOutput omitted. + +/** + * deserializeAws_json1_0OperationWithDefaultsOutput + */ +const de_OperationWithDefaultsOutput = (output: any, context: __SerdeContext): OperationWithDefaultsOutput => { + return take(output, { + defaultBlob: context.base64Decoder, + defaultBoolean: __expectBoolean, + defaultByte: __expectByte, + defaultDocumentBoolean: (_: any) => de_Document(_, context), + defaultDocumentList: (_: any) => de_Document(_, context), + defaultDocumentMap: (_: any) => de_Document(_, context), + defaultDocumentString: (_: any) => de_Document(_, context), + defaultDouble: __limitedParseDouble, + defaultEnum: __expectString, + defaultFloat: __limitedParseFloat32, + defaultIntEnum: __expectInt32, + defaultInteger: __expectInt32, + defaultList: _json, + defaultLong: __expectLong, + defaultMap: _json, + defaultNullDocument: (_: any) => de_Document(_, context), + defaultShort: __expectShort, + defaultString: __expectString, + defaultTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + emptyBlob: context.base64Decoder, + emptyString: __expectString, + falseBoolean: __expectBoolean, + zeroByte: __expectByte, + zeroDouble: __limitedParseDouble, + zeroFloat: __limitedParseFloat32, + zeroInteger: __expectInt32, + zeroLong: __expectLong, + zeroShort: __expectShort, + }) as any; +}; + +// de_OperationWithNestedStructureOutput omitted. + +/** + * deserializeAws_json1_0OperationWithRequiredMembersOutput + */ +const de_OperationWithRequiredMembersOutput = ( + output: any, + context: __SerdeContext +): OperationWithRequiredMembersOutput => { + return take(output, { + requiredBlob: context.base64Decoder, + requiredBoolean: __expectBoolean, + requiredByte: __expectByte, + requiredDouble: __limitedParseDouble, + requiredFloat: __limitedParseFloat32, + requiredInteger: __expectInt32, + requiredList: _json, + requiredLong: __expectLong, + requiredMap: _json, + requiredShort: __expectShort, + requiredString: __expectString, + requiredTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + +/** + * deserializeAws_json1_0OperationWithRequiredMembersWithDefaultsOutput + */ +const de_OperationWithRequiredMembersWithDefaultsOutput = ( + output: any, + context: __SerdeContext +): OperationWithRequiredMembersWithDefaultsOutput => { + return take(output, { + requiredBlob: context.base64Decoder, + requiredBoolean: __expectBoolean, + requiredByte: __expectByte, + requiredDouble: __limitedParseDouble, + requiredEnum: __expectString, + requiredFloat: __limitedParseFloat32, + requiredIntEnum: __expectInt32, + requiredInteger: __expectInt32, + requiredList: _json, + requiredLong: __expectLong, + requiredMap: _json, + requiredShort: __expectShort, + requiredString: __expectString, + requiredTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + +// de_RequiredStringList omitted. + +// de_RequiredStringMap omitted. + +/** + * deserializeAws_json1_0SimpleScalarPropertiesOutput + */ +const de_SimpleScalarPropertiesOutput = (output: any, context: __SerdeContext): SimpleScalarPropertiesOutput => { + return take(output, { + doubleValue: __limitedParseDouble, + floatValue: __limitedParseFloat32, + }) as any; +}; + +// de_TestStringList omitted. + +// de_TestStringMap omitted. + +// de_GreetingStruct omitted. + +// de_StringList omitted. + +// de_StringMap omitted. + +/** + * deserializeAws_json1_0Document + */ +const de_Document = (output: any, context: __SerdeContext): __DocumentType => { + return output; +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const throwDefaultError = withBaseException(__BaseException); +const buildHttpRpcRequest = async ( + context: __SerdeContext, + headers: __HeaderBag, + path: string, + resolvedHostname: string | undefined, + body: any +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents: any = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.0", + "x-amz-target": `JsonRpc10.${operation}`, + }; +} diff --git a/private/aws-protocoltests-json-10-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.browser.ts new file mode 100644 index 0000000000000..62f518266c807 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.browser.ts @@ -0,0 +1,51 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/private/aws-protocoltests-json-10-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.native.ts new file mode 100644 index 0000000000000..581e9b26f4d2a --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/private/aws-protocoltests-json-10-schema/src/runtimeConfig.shared.ts b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.shared.ts new file mode 100644 index 0000000000000..70fff70b46ac7 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.shared.ts @@ -0,0 +1,40 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { AwsJson1_0Protocol } from "@aws-sdk/core/protocols"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultJSONRPC10HttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { + return { + apiVersion: "2020-07-14", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultJSONRPC10HttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + protocol: config?.protocol ?? new AwsJson1_0Protocol({ defaultNamespace: "aws.protocoltests.json10" }), + serviceId: config?.serviceId ?? "JSON RPC 10", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/private/aws-protocoltests-json-10-schema/src/runtimeConfig.ts b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.ts new file mode 100644 index 0000000000000..6ebfe35f935b9 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/runtimeConfig.ts @@ -0,0 +1,81 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: + config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), + retryMode: + config?.retryMode ?? + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; diff --git a/private/aws-protocoltests-json-10-schema/src/runtimeExtensions.ts b/private/aws-protocoltests-json-10-schema/src/runtimeExtensions.ts new file mode 100644 index 0000000000000..b33c4d0a6d766 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/runtimeExtensions.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { JSONRPC10ExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: JSONRPC10ExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: JSONRPC10ExtensionConfiguration = Object.assign( + getAwsRegionExtensionConfiguration(runtimeConfig), + getDefaultExtensionConfiguration(runtimeConfig), + getHttpHandlerExtensionConfiguration(runtimeConfig), + getHttpAuthExtensionConfiguration(runtimeConfig) + ); + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return Object.assign( + runtimeConfig, + resolveAwsRegionExtensionConfiguration(extensionConfiguration), + resolveDefaultRuntimeConfig(extensionConfiguration), + resolveHttpHandlerRuntimeConfig(extensionConfiguration), + resolveHttpAuthRuntimeConfig(extensionConfiguration) + ); +}; diff --git a/private/aws-protocoltests-json-10-schema/src/schemas/schemas.ts b/private/aws-protocoltests-json-10-schema/src/schemas/schemas.ts new file mode 100644 index 0000000000000..33ff478a34e2b --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/src/schemas/schemas.ts @@ -0,0 +1,502 @@ +const _B = "Blob"; +const _Bo = "Boolean"; +const _By = "Byte"; +const _CE = "ComplexError"; +const _CE_ = "Content-Encoding"; +const _CNED = "ComplexNestedErrorData"; +const _COD = "ClientOptionalDefaults"; +const _CTP = "ContentTypeParameters"; +const _CTPI = "ContentTypeParametersInput"; +const _CTPO = "ContentTypeParametersOutput"; +const _D = "Double"; +const _DL = "DialogList"; +const _DM = "DialogMap"; +const _De = "Defaults"; +const _Di = "Dialog"; +const _EIAEO = "EmptyInputAndEmptyOutput"; +const _EIAEOI = "EmptyInputAndEmptyOutputInput"; +const _EIAEOO = "EmptyInputAndEmptyOutputOutput"; +const _EO = "EndpointOperation"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _EWHLOI = "EndpointWithHostLabelOperationInput"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FEo = "FooError"; +const _Fa = "Farewell"; +const _Fo = "Foo"; +const _Foo = "Fooooo"; +const _GS = "GreetingStruct"; +const _GWE = "GreetingWithErrors"; +const _GWEI = "GreetingWithErrorsInput"; +const _GWEO = "GreetingWithErrorsOutput"; +const _HWPO = "HostWithPathOperation"; +const _I = "Integer"; +const _IE = "IntegerEnum"; +const _IG = "InvalidGreeting"; +const _JU = "JsonUnions"; +const _JUI = "JsonUnionsInput"; +const _JUO = "JsonUnionsOutput"; +const _L = "Long"; +const _M = "Message"; +const _MU = "MyUnion"; +const _N = "Nested"; +const _NIANO = "NoInputAndNoOutput"; +const _NIAO = "NoInputAndOutput"; +const _NIAOO = "NoInputAndOutputOutput"; +const _OWD = "OperationWithDefaults"; +const _OWDI = "OperationWithDefaultsInput"; +const _OWDO = "OperationWithDefaultsOutput"; +const _OWNS = "OperationWithNestedStructure"; +const _OWNSI = "OperationWithNestedStructureInput"; +const _OWNSO = "OperationWithNestedStructureOutput"; +const _OWRM = "OperationWithRequiredMembers"; +const _OWRMO = "OperationWithRequiredMembersOutput"; +const _OWRMWD = "OperationWithRequiredMembersWithDefaults"; +const _OWRMWDO = "OperationWithRequiredMembersWithDefaultsOutput"; +const _PWCE = "PutWithContentEncoding"; +const _PWCEI = "PutWithContentEncodingInput"; +const _RE = "RequiredEnum"; +const _RIE = "RequiredIntEnum"; +const _RSL = "RequiredStringList"; +const _RSM = "RequiredStringMap"; +const _S = "String"; +const _SL = "StringList"; +const _SM = "StringMap"; +const _SSP = "SimpleScalarProperties"; +const _SSPI = "SimpleScalarPropertiesInput"; +const _SSPO = "SimpleScalarPropertiesOutput"; +const _Sh = "Short"; +const _T = "Timestamp"; +const _TE = "TestEnum"; +const _TIE = "TestIntEnum"; +const _TL = "TopLevel"; +const _TSL = "TestStringList"; +const _TSM = "TestStringMap"; +const _bV = "booleanValue"; +const _bVl = "blobValue"; +const _c = "client"; +const _cOD = "clientOptionalDefaults"; +const _co = "contents"; +const _d = "defaults"; +const _dB = "defaultBoolean"; +const _dBe = "defaultBlob"; +const _dBef = "defaultByte"; +const _dD = "defaultDouble"; +const _dDB = "defaultDocumentBoolean"; +const _dDL = "defaultDocumentList"; +const _dDM = "defaultDocumentMap"; +const _dDS = "defaultDocumentString"; +const _dE = "defaultEnum"; +const _dF = "defaultFloat"; +const _dI = "defaultInteger"; +const _dIE = "defaultIntEnum"; +const _dL = "defaultList"; +const _dLe = "defaultLong"; +const _dLi = "dialogList"; +const _dM = "defaultMap"; +const _dMi = "dialogMap"; +const _dND = "defaultNullDocument"; +const _dS = "defaultString"; +const _dSe = "defaultShort"; +const _dT = "defaultTimestamp"; +const _dV = "doubleValue"; +const _da = "data"; +const _di = "dialog"; +const _e = "error"; +const _eB = "emptyBlob"; +const _eS = "emptyString"; +const _eV = "enumValue"; +const _en = "encoding"; +const _end = "endpoint"; +const _f = "farewell"; +const _fB = "falseBoolean"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "hi"; +const _hH = "httpHeader"; +const _hL = "hostLabel"; +const _iEV = "intEnumValue"; +const _jN = "jsonName"; +const _l = "language"; +const _lV = "listValue"; +const _la = "label"; +const _m = "member"; +const _mV = "mapValue"; +const _nV = "numberValue"; +const _oTLD = "otherTopLevelDefault"; +const _p = "phrase"; +const _rB = "requiredBoolean"; +const _rBe = "requiredBlob"; +const _rBeq = "requiredByte"; +const _rD = "requiredDouble"; +const _rE = "requiredEnum"; +const _rF = "requiredFloat"; +const _rI = "requiredInteger"; +const _rIE = "requiredIntEnum"; +const _rL = "requiredList"; +const _rLe = "requiredLong"; +const _rM = "requiredMap"; +const _rS = "requiredString"; +const _rSe = "requiredShort"; +const _rT = "requiredTimestamp"; +const _s = "server"; +const _sV = "stringValue"; +const _sVt = "structureValue"; +const _tL = "topLevel"; +const _tLD = "topLevelDefault"; +const _tV = "timestampValue"; +const _v = "value"; +const _zB = "zeroByte"; +const _zD = "zeroDouble"; +const _zF = "zeroFloat"; +const _zI = "zeroInteger"; +const _zL = "zeroLong"; +const _zS = "zeroShort"; +const n0 = "aws.protocoltests.json10"; +const n1 = "aws.protocoltests.shared"; + +// smithy-typescript generated code +import { error, list, map, op, struct, struct as uni } from "@smithy/core/schema"; + +import { + ComplexError as __ComplexError, + FooError as __FooError, + InvalidGreeting as __InvalidGreeting, +} from "../models/index"; +import { JSONRPC10ServiceException as __JSONRPC10ServiceException } from "../models/JSONRPC10ServiceException"; + +/* eslint no-var: 0 */ + +export var ClientOptionalDefaults = struct(n0, _COD, 0, [_m], [1]); +export var ComplexError = error( + n0, + _CE, + { + [_e]: _c, + }, + [_TL, _N], + [0, [() => ComplexNestedErrorData, 0]], + + __ComplexError +); +export var ComplexNestedErrorData = struct( + n0, + _CNED, + 0, + [_Fo], + [ + [ + 0, + { + [_jN]: _Foo, + }, + ], + ] +); +export var ContentTypeParametersInput = struct(n0, _CTPI, 0, [_v], [1]); +export var ContentTypeParametersOutput = struct(n0, _CTPO, 0, [], []); +export var Defaults = struct( + n0, + _De, + 0, + [ + _dS, + _dB, + _dL, + _dDM, + _dDS, + _dDB, + _dDL, + _dND, + _dT, + _dBe, + _dBef, + _dSe, + _dI, + _dLe, + _dF, + _dD, + _dM, + _dE, + _dIE, + _eS, + _fB, + _eB, + _zB, + _zS, + _zI, + _zL, + _zF, + _zD, + ], + [0, 2, 64 | 0, 15, 15, 15, 15, 15, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] +); +export var Dialog = struct(n0, _Di, 0, [_l, _g, _f], [0, 0, () => Farewell]); +export var EmptyInputAndEmptyOutputInput = struct(n0, _EIAEOI, 0, [], []); +export var EmptyInputAndEmptyOutputOutput = struct(n0, _EIAEOO, 0, [], []); +export var EndpointWithHostLabelOperationInput = struct( + n0, + _EWHLOI, + 0, + [_la], + [ + [ + 0, + { + [_hL]: 1, + }, + ], + ] +); +export var Farewell = struct(n0, _Fa, 0, [_p], [0]); +export var FooError = error( + n0, + _FEo, + { + [_e]: _s, + }, + [], + [], + + __FooError +); +export var GreetingWithErrorsInput = struct(n0, _GWEI, 0, [_g], [0]); +export var GreetingWithErrorsOutput = struct(n0, _GWEO, 0, [_g], [0]); +export var InvalidGreeting = error( + n0, + _IG, + { + [_e]: _c, + }, + [_M], + [0], + + __InvalidGreeting +); +export var JsonUnionsInput = struct(n0, _JUI, 0, [_co], [() => MyUnion]); +export var JsonUnionsOutput = struct(n0, _JUO, 0, [_co], [() => MyUnion]); +export var NoInputAndOutputOutput = struct(n0, _NIAOO, 0, [], []); +export var OperationWithDefaultsInput = struct( + n0, + _OWDI, + 0, + [_d, _cOD, _tLD, _oTLD], + [() => Defaults, () => ClientOptionalDefaults, 0, 1] +); +export var OperationWithDefaultsOutput = struct( + n0, + _OWDO, + 0, + [ + _dS, + _dB, + _dL, + _dDM, + _dDS, + _dDB, + _dDL, + _dND, + _dT, + _dBe, + _dBef, + _dSe, + _dI, + _dLe, + _dF, + _dD, + _dM, + _dE, + _dIE, + _eS, + _fB, + _eB, + _zB, + _zS, + _zI, + _zL, + _zF, + _zD, + ], + [0, 2, 64 | 0, 15, 15, 15, 15, 15, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] +); +export var OperationWithNestedStructureInput = struct(n0, _OWNSI, 0, [_tL], [() => TopLevel]); +export var OperationWithNestedStructureOutput = struct( + n0, + _OWNSO, + 0, + [_di, _dLi, _dMi], + [() => Dialog, () => DialogList, () => DialogMap] +); +export var OperationWithRequiredMembersOutput = struct( + n0, + _OWRMO, + 0, + [_rS, _rB, _rL, _rT, _rBe, _rBeq, _rSe, _rI, _rLe, _rF, _rD, _rM], + [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0] +); +export var OperationWithRequiredMembersWithDefaultsOutput = struct( + n0, + _OWRMWDO, + 0, + [_rS, _rB, _rL, _rT, _rBe, _rBeq, _rSe, _rI, _rLe, _rF, _rD, _rM, _rE, _rIE], + [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1] +); +export var PutWithContentEncodingInput = struct( + n0, + _PWCEI, + 0, + [_en, _da], + [ + [ + 0, + { + [_hH]: _CE_, + }, + ], + 0, + ] +); +export var SimpleScalarPropertiesInput = struct(n0, _SSPI, 0, [_fV, _dV], [1, 1]); +export var SimpleScalarPropertiesOutput = struct(n0, _SSPO, 0, [_fV, _dV], [1, 1]); +export var TopLevel = struct(n0, _TL, 0, [_di, _dLi, _dMi], [() => Dialog, () => DialogList, () => DialogMap]); +export var GreetingStruct = struct(n1, _GS, 0, [_h], [0]); +export var Unit = "unit" as const; + +export var JSONRPC10ServiceException = error( + "smithy.ts.sdk.synthetic.aws.protocoltests.json10", + "JSONRPC10ServiceException", + 0, + [], + [], + __JSONRPC10ServiceException +); +export var DialogList = list(n0, _DL, 0, () => Dialog); +export var RequiredStringList = 64 | 0; + +export var TestStringList = 64 | 0; + +export var StringList = 64 | 0; + +export var DialogMap = map(n0, _DM, 0, 0, () => Dialog); +export var RequiredStringMap = 128 | 0; + +export var TestStringMap = 128 | 0; + +export var StringMap = 128 | 0; + +export var MyUnion = uni( + n0, + _MU, + 0, + [_sV, _bV, _nV, _bVl, _tV, _eV, _iEV, _lV, _mV, _sVt], + [0, 2, 1, 21, 4, 0, 1, 64 | 0, 128 | 0, () => GreetingStruct] +); +export var ContentTypeParameters = op( + n0, + _CTP, + 0, + () => ContentTypeParametersInput, + () => ContentTypeParametersOutput +); +export var EmptyInputAndEmptyOutput = op( + n0, + _EIAEO, + 0, + () => EmptyInputAndEmptyOutputInput, + () => EmptyInputAndEmptyOutputOutput +); +export var EndpointOperation = op( + n0, + _EO, + { + [_end]: ["foo."], + }, + () => Unit, + () => Unit +); +export var EndpointWithHostLabelOperation = op( + n0, + _EWHLO, + { + [_end]: ["foo.{label}."], + }, + () => EndpointWithHostLabelOperationInput, + () => Unit +); +export var GreetingWithErrors = op( + n0, + _GWE, + 2, + () => GreetingWithErrorsInput, + () => GreetingWithErrorsOutput +); +export var HostWithPathOperation = op( + n0, + _HWPO, + 0, + () => Unit, + () => Unit +); +export var JsonUnions = op( + n0, + _JU, + 2, + () => JsonUnionsInput, + () => JsonUnionsOutput +); +export var NoInputAndNoOutput = op( + n0, + _NIANO, + 0, + () => Unit, + () => Unit +); +export var NoInputAndOutput = op( + n0, + _NIAO, + 0, + () => Unit, + () => NoInputAndOutputOutput +); +export var OperationWithDefaults = op( + n0, + _OWD, + 0, + () => OperationWithDefaultsInput, + () => OperationWithDefaultsOutput +); +export var OperationWithNestedStructure = op( + n0, + _OWNS, + 0, + () => OperationWithNestedStructureInput, + () => OperationWithNestedStructureOutput +); +export var OperationWithRequiredMembers = op( + n0, + _OWRM, + 0, + () => Unit, + () => OperationWithRequiredMembersOutput +); +export var OperationWithRequiredMembersWithDefaults = op( + n0, + _OWRMWD, + 0, + () => Unit, + () => OperationWithRequiredMembersWithDefaultsOutput +); +export var PutWithContentEncoding = op( + n0, + _PWCE, + 0, + () => PutWithContentEncodingInput, + () => Unit +); +export var SimpleScalarProperties = op( + n0, + _SSP, + 0, + () => SimpleScalarPropertiesInput, + () => SimpleScalarPropertiesOutput +); diff --git a/private/aws-protocoltests-json-10-schema/test/functional/awsjson1_0.spec.ts b/private/aws-protocoltests-json-10-schema/test/functional/awsjson1_0.spec.ts new file mode 100644 index 0000000000000..f3ece6c069178 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/test/functional/awsjson1_0.spec.ts @@ -0,0 +1,3170 @@ +// smithy-typescript generated code +import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; +import { Encoder as __Encoder } from "@smithy/types"; +import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; +import { Readable } from "stream"; +import { expect, test as it } from "vitest"; + +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HostWithPathOperationCommand } from "../../src/commands/HostWithPathOperationCommand"; +import { JsonUnionsCommand } from "../../src/commands/JsonUnionsCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { OperationWithDefaultsCommand } from "../../src/commands/OperationWithDefaultsCommand"; +import { OperationWithNestedStructureCommand } from "../../src/commands/OperationWithNestedStructureCommand"; +import { OperationWithRequiredMembersCommand } from "../../src/commands/OperationWithRequiredMembersCommand"; +import { OperationWithRequiredMembersWithDefaultsCommand } from "../../src/commands/OperationWithRequiredMembersWithDefaultsCommand"; +import { PutWithContentEncodingCommand } from "../../src/commands/PutWithContentEncodingCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { JSONRPC10Client } from "../../src/JSONRPC10Client"; + +/** + * Throws an expected exception that contains the serialized request. + */ +class EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error { + constructor(readonly request: HttpRequest) { + super(); + } +} + +/** + * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a + * request. The thrown exception contains the serialized request. + */ +class RequestSerializationTestHandler implements HttpHandler { + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request)); + } + updateHttpClientConfig(key: never, value: never): void {} + httpHandlerConfigs() { + return {}; + } +} + +/** + * Returns a resolved Promise of the specified response contents. + */ +class ResponseDeserializationTestHandler implements HttpHandler { + isSuccess: boolean; + code: number; + headers: HeaderBag; + body: string | Uint8Array; + isBase64Body: boolean; + + constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) { + this.isSuccess = isSuccess; + this.code = code; + if (headers === undefined) { + this.headers = {}; + } else { + this.headers = headers; + } + if (body === undefined) { + body = ""; + } + this.body = body; + this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), "base64").toString("base64") === body; + } + + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.resolve({ + response: new HttpResponse({ + statusCode: this.code, + headers: this.headers, + body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]), + }), + }); + } + + updateHttpClientConfig(key: never, value: never): void {} + + httpHandlerConfigs() { + return {}; + } +} + +interface comparableParts { + [key: string]: string; +} + +/** + * Generates a standard map of un-equal values given input parts. + */ +const compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => { + const unequalParts: any = {}; + Object.keys(expectedParts).forEach((key) => { + if (generatedParts[key] === undefined) { + unequalParts[key] = { exp: expectedParts[key], gen: undefined }; + } else if (!equivalentContents(expectedParts[key], generatedParts[key])) { + unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] }; + } + }); + + Object.keys(generatedParts).forEach((key) => { + if (expectedParts[key] === undefined) { + unequalParts[key] = { exp: undefined, gen: generatedParts[key] }; + } + }); + + if (Object.keys(unequalParts).length !== 0) { + return unequalParts; + } + return undefined; +}; + +/** + * Compares all types for equivalent contents, doing nested + * equality checks based on non-`$metadata` + * properties that have defined values. + */ +const equivalentContents = (expected: any, generated: any): boolean => { + if (typeof (global as any).expect === "function") { + expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected)); + return true; + } + + const localExpected = expected; + + // Short circuit on equality. + if (localExpected == generated) { + return true; + } + + if (typeof expected !== "object") { + return expected === generated; + } + + // If a test fails with an issue in the below 6 lines, it's likely + // due to an issue in the nestedness or existence of the property + // being compared. + delete localExpected["$metadata"]; + delete generated["$metadata"]; + Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]); + Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]); + + const expectedProperties = Object.getOwnPropertyNames(localExpected); + const generatedProperties = Object.getOwnPropertyNames(generated); + + // Short circuit on different property counts. + if (expectedProperties.length != generatedProperties.length) { + return false; + } + + // Compare properties directly. + for (let index = 0; index < expectedProperties.length; index++) { + const propertyName = expectedProperties[index]; + if (!equivalentContents(localExpected[propertyName], generated[propertyName])) { + return false; + } + } + + return true; +}; + +const clientParams = { + region: "us-west-2", + credentials: { accessKeyId: "key", secretAccessKey: "secret" }, + endpoint: () => { + const url = new URL("https://localhost/"); + return Promise.resolve({ + hostname: url.hostname, + protocol: url.protocol, + path: url.pathname, + }) as Promise; + }, +}; + +/** + * A wrapper function that shadows `fail` from jest-jasmine2 + * (jasmine2 was replaced with circus in > v27 as the default test runner) + */ +const fail = (error?: any): never => { + throw new Error(error); +}; + +/** + * Hexadecimal to byteArray. + */ +const toBytes = (hex: string) => { + return Buffer.from(hex, "base64"); +}; + +function normalizeByteArrayType(data: any) { + // normalize float32 errors + if (typeof data === "number") { + const u = new Uint8Array(4); + const dv = new DataView(u.buffer, u.byteOffset, u.byteLength); + dv.setFloat32(0, data); + return dv.getFloat32(0); + } + if (!data || typeof data !== "object") { + return data; + } + if (data instanceof Uint8Array) { + return Uint8Array.from(data); + } + if (data instanceof String || data instanceof Boolean || data instanceof Number) { + return data.valueOf(); + } + const output = {} as any; + for (const key of Object.getOwnPropertyNames(data)) { + output[key] = normalizeByteArrayType(data[key]); + } + return output; +} + +/** + * Clients must always send an empty object if input is modeled. + */ +it("AwsJson10EmptyInputAndEmptyOutput:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyInputAndEmptyOutputCommand({} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.EmptyInputAndEmptyOutput"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * A service will always return a JSON object for operations with modeled output. + */ +it("AwsJson10EmptyInputAndEmptyOutputSendJsonObject:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new EmptyInputAndEmptyOutputCommand(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); +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait. + */ +it("AwsJson10EndpointTrait:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointOperationCommand({}); + 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("/"); + + expect(r.headers["host"]).toBe("foo.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait, and can use the host label trait to define + * further customization based on user input. + */ +it("AwsJson10EndpointTraitWithHostLabel:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointWithHostLabelOperationCommand({ + label: "bar", + } 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("/"); + + expect(r.headers["host"]).toBe("foo.bar.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"label\": \"bar\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Parses simple JSON errors + */ +it("AwsJson10InvalidGreetingError:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "__type": "aws.protocoltests.json10#InvalidGreeting", + "Message": "Hi" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "InvalidGreeting") { + console.log(err); + fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Parses a complex error with no message member + */ +it("AwsJson10ComplexError:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "__type": "aws.protocoltests.json10#ComplexError", + "TopLevel": "Top level", + "Nested": { + "Foo": "bar" + } + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + TopLevel: "Top level", + Nested: { + Foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Parses a complex error with an empty body + */ +it("AwsJson10EmptyComplexError:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "__type": "aws.protocoltests.json10#ComplexError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Serializes the X-Amzn-ErrorType header. For an example service, see Amazon EKS. + */ +it("AwsJson10FooErrorUsingXAmznErrorType:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": "FooError", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some X-Amzn-Errortype headers contain URLs. Clients need to split the URL on ':' and take only the first half of the string. For example, 'ValidationException:http://internal.amazon.com/coral/com.amazon.coral.validate/' + * is to be interpreted as 'ValidationException'. + * + * For an example service see Amazon Polly. + */ +it("AwsJson10FooErrorUsingXAmznErrorTypeWithUri:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * X-Amzn-Errortype might contain a URL and a namespace. Client should extract only the shape name. This is a pathalogical case that might not actually happen in any deployed AWS service. + */ +it("AwsJson10FooErrorUsingXAmznErrorTypeWithUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": + "aws.protocoltests.json10#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * This example uses the 'code' property in the output rather than X-Amzn-Errortype. Some services do this though it's preferable to send the X-Amzn-Errortype. Client implementations must first check for the X-Amzn-Errortype and then check for a top-level 'code' property. + * + * For example service see Amazon S3 Glacier. + */ +it("AwsJson10FooErrorUsingCode:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "code": "FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using code, and it might contain a namespace. Clients should just take the last part of the string after '#'. + */ +it("AwsJson10FooErrorUsingCodeAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "code": "aws.protocoltests.json10#FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using code, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service. + */ +it("AwsJson10FooErrorUsingCodeUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "code": "aws.protocoltests.json10#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type. + */ +it("AwsJson10FooErrorWithDunderType:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "__type": "FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type, and it might contain a namespace. Clients should just take the last part of the string after '#'. + */ +it("AwsJson10FooErrorWithDunderTypeAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "__type": "aws.protocoltests.json10#FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service. + */ +it("AwsJson10FooErrorWithDunderTypeUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "__type": "aws.protocoltests.json10#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Custom endpoints supplied by users can have paths + */ +it("AwsJson10HostWithPath:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + endpoint: "https://example.com/custom", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HostWithPathOperationCommand({}); + 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("/custom/"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a string union value + */ +it("AwsJson10SerializeStringUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + stringValue: "foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"stringValue\": \"foo\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a boolean union value + */ +it("AwsJson10SerializeBooleanUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + booleanValue: true, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"booleanValue\": true + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a number union value + */ +it("AwsJson10SerializeNumberUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + numberValue: 1, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"numberValue\": 1 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a blob union value + */ +it("AwsJson10SerializeBlobUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"blobValue\": \"Zm9v\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a timestamp union value + */ +it("AwsJson10SerializeTimestampUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + timestampValue: new Date(1398796238000), + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"timestampValue\": 1398796238 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an enum union value + */ +it("AwsJson10SerializeEnumUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + enumValue: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"enumValue\": \"Foo\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an intEnum union value + */ +it("AwsJson10SerializeIntEnumUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + intEnumValue: 1, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"intEnumValue\": 1 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a list union value + */ +it("AwsJson10SerializeListUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + listValue: ["foo", "bar"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"listValue\": [\"foo\", \"bar\"] + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a map union value + */ +it("AwsJson10SerializeMapUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + mapValue: { + foo: "bar", + spam: "eggs", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"mapValue\": { + \"foo\": \"bar\", + \"spam\": \"eggs\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure union value + */ +it("AwsJson10SerializeStructureUnionValue:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + structureValue: { + hi: "hello", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"structureValue\": { + \"hi\": \"hello\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes a string union value + */ +it("AwsJson10DeserializeStringUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "stringValue": "foo" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + stringValue: "foo", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a boolean union value + */ +it("AwsJson10DeserializeBooleanUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "booleanValue": true + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + booleanValue: true, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a number union value + */ +it("AwsJson10DeserializeNumberUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "numberValue": 1 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + numberValue: 1, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a blob union value + */ +it("AwsJson10DeserializeBlobUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "blobValue": "Zm9v" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a timestamp union value + */ +it("AwsJson10DeserializeTimestampUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "timestampValue": 1398796238 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + timestampValue: new Date(1398796238 * 1000), + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes an enum union value + */ +it("AwsJson10DeserializeEnumUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "enumValue": "Foo" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + enumValue: "Foo", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes an intEnum union value + */ +it("AwsJson10DeserializeIntEnumUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "intEnumValue": 1 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + intEnumValue: 1, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a list union value + */ +it("AwsJson10DeserializeListUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "listValue": ["foo", "bar"] + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + listValue: ["foo", "bar"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a map union value + */ +it("AwsJson10DeserializeMapUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "mapValue": { + "foo": "bar", + "spam": "eggs" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + mapValue: { + foo: "bar", + spam: "eggs", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a structure union value + */ +it("AwsJson10DeserializeStructureUnionValue:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "structureValue": { + "hi": "hello" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + structureValue: { + hi: "hello", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ignores an unrecognized __type property + */ +it("AwsJson10DeserializeIgnoreType:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "__type": "aws.protocoltests.json10#MyUnion", + "structureValue": { + "hi": "hello" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + structureValue: { + hi: "hello", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Allows for `: null` to be set for all unset fields + */ +it("AwsJson10DeserializeAllowNulls:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "contents": { + "stringValue": null, + "booleanValue": null, + "numberValue": null, + "blobValue": null, + "timestampValue": null, + "enumValue": null, + "intEnumValue": null, + "listValue": null, + "mapValue": null, + "structureValue": { + "hi": "hello" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + structureValue: { + hi: "hello", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Clients must always send an empty JSON object payload for + * operations with no input (that is, `{}`). While AWS service + * implementations support requests with no payload or requests + * that send `{}`, always sending `{}` from the client is + * preferred for forward compatibility in case input is ever + * added to an operation. + */ +it("AwsJson10MustAlwaysSendEmptyJsonPayload:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndNoOutputCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.NoInputAndNoOutput"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * When no output is defined, the service is expected to return + * an empty payload, however, client must ignore a JSON payload + * if one is returned. This ensures that if output is added later, + * then it will not break the client. + */ +it("AwsJson10HandlesEmptyOutputShape:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new NoInputAndNoOutputCommand(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); +}); + +/** + * This client-only test builds on handles_empty_output_shape, + * by including unexpected fields in the JSON. A client + * needs to ignore JSON output that is empty or that contains + * JSON object data. + */ +it("AwsJson10HandlesUnexpectedJsonOutput:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "foo": true + }` + ), + }); + + const params: any = {}; + const command = new NoInputAndNoOutputCommand(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); +}); + +/** + * When no output is defined, the service is expected to return + * an empty payload. Despite the lack of a payload, the service + * is expected to always send a Content-Type header. Clients must + * handle cases where a service returns a JSON object and where + * a service returns no JSON at all. + */ +it("AwsJson10ServiceRespondsWithNoPayload:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `` + ), + }); + + const params: any = {}; + const command = new NoInputAndNoOutputCommand(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); +}); + +/** + * A client should always send and empty JSON object payload. + */ +it("AwsJson10NoInputAndOutput:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndOutputCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.NoInputAndOutput"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Empty output always serializes an empty object payload. + */ +it("AwsJson10NoInputAndOutput:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new NoInputAndOutputCommand(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); +}); + +/** + * Client populates default values in input. + */ +it.skip("AwsJson10ClientPopulatesDefaultValuesInInput:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + defaults: {} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"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()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client skips top level default values in input. + */ +it.skip("AwsJson10ClientSkipsTopLevelDefaultValuesInInput:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client uses explicitly provided member values over defaults + */ +it.skip("AwsJson10ClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + 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 { + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"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()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * 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.skip("AwsJson10ClientUsesExplicitlyProvidedValuesInTopLevel:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + topLevelDefault: "hi", + otherTopLevelDefault: 0, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"topLevelDefault\": \"hi\", + \"otherTopLevelDefault\": 0 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored. + */ +it.skip("AwsJson10ClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + clientOptionalDefaults: {} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"clientOptionalDefaults\": {} + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client populates default values when missing in response. + */ +it.skip("AwsJson10ClientPopulatesDefaultsValuesWhenMissingInResponse:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new OperationWithDefaultsCommand(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 = [ + { + 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) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Client ignores default values if member values are present in the response. + */ +it.skip("AwsJson10ClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "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 OperationWithDefaultsCommand(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 = [ + { + defaultString: "bye", + defaultBoolean: false, + defaultList: ["a"], + defaultDocumentMap: { + name: "Jack", + }, + defaultDocumentString: "bye", + defaultDocumentBoolean: false, + defaultDocumentList: ["b"], + defaultNullDocument: "notNull", + defaultTimestamp: new Date(2 * 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) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Client populates nested default values when missing. + */ +it.skip("AwsJson10ClientPopulatesNestedDefaultValuesWhenMissing:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + + expect(r.body, `Body was undefined.`).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("AwsJson10ClientPopulatesNestedDefaultsWhenMissingInResponseBody:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "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], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Client error corrects when server fails to serialize required values. + */ +it.skip("AwsJson10ClientErrorCorrectsWhenServerFailsToSerializeRequiredValues:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new OperationWithRequiredMembersCommand(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 = [ + { + requiredString: "", + requiredBoolean: false, + requiredList: [], + requiredTimestamp: new Date(0 * 1000), + requiredBlob: Uint8Array.from("", (c) => c.charCodeAt(0)), + requiredByte: 0, + requiredShort: 0, + requiredInteger: 0, + requiredLong: 0, + requiredFloat: 0.0, + requiredDouble: 0.0, + requiredMap: {}, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Client error corrects with default values when server fails to serialize required values. + */ +it.skip("AwsJson10ClientErrorCorrectsWithDefaultValuesWhenServerFailsToSerializeRequiredValues:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new OperationWithRequiredMembersWithDefaultsCommand(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 = [ + { + requiredString: "hi", + requiredBoolean: true, + requiredList: [], + requiredTimestamp: new Date(1 * 1000), + requiredBlob: Uint8Array.from("blob", (c) => c.charCodeAt(0)), + requiredByte: 1, + requiredShort: 1, + requiredInteger: 10, + requiredLong: 100, + requiredFloat: 1.0, + requiredDouble: 1.0, + requiredMap: {}, + requiredEnum: "FOO", + requiredIntEnum: 1, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header. + */ +it("SDKAppliedContentEncoding_awsJson1_0:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header, and the + * user-provided content-encoding is NOT in the Content-Encoding header since HTTP binding + * traits are ignored in the awsJson1_0 protocol. + * + */ +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + encoding: "custom", + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Supports handling NaN float values. + */ +it("AwsJson10SupportsNaNFloatInputs:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: NaN, + doubleValue: NaN, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.SimpleScalarProperties"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"NaN\", + \"doubleValue\": \"NaN\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("AwsJson10SupportsInfinityFloatInputs:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: Infinity, + doubleValue: Infinity, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.SimpleScalarProperties"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"Infinity\", + \"doubleValue\": \"Infinity\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling -Infinity float values. + */ +it("AwsJson10SupportsNegativeInfinityFloatInputs:Request", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: -Infinity, + doubleValue: -Infinity, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); + expect(r.headers["x-amz-target"]).toBe("JsonRpc10.SimpleScalarProperties"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"-Infinity\", + \"doubleValue\": \"-Infinity\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling NaN float values. + */ +it("AwsJson10SupportsNaNFloatInputs:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "floatValue": "NaN", + "doubleValue": "NaN" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: NaN, + doubleValue: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float values. + */ +it("AwsJson10SupportsInfinityFloatInputs:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "floatValue": "Infinity", + "doubleValue": "Infinity" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: Infinity, + doubleValue: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float values. + */ +it("AwsJson10SupportsNegativeInfinityFloatInputs:Response", async () => { + const client = new JSONRPC10Client({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.0", + }, + `{ + "floatValue": "-Infinity", + "doubleValue": "-Infinity" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: -Infinity, + doubleValue: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentJsonBodies = (expectedBody: string, generatedBody: string): Object => { + const expectedParts = JSON.parse(expectedBody); + const generatedParts = JSON.parse(generatedBody); + + return compareParts(expectedParts, generatedParts); +}; + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentUnknownTypeBodies = ( + utf8Encoder: __Encoder, + expectedBody: string, + generatedBody: string | Uint8Array +): Object => { + const expectedParts = { Value: expectedBody }; + const generatedParts = { + Value: generatedBody instanceof Uint8Array ? utf8Encoder(generatedBody) : generatedBody, + }; + + return compareParts(expectedParts, generatedParts); +}; diff --git a/private/aws-protocoltests-json-10-schema/tsconfig.cjs.json b/private/aws-protocoltests-json-10-schema/tsconfig.cjs.json new file mode 100644 index 0000000000000..9224176da7f72 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-json-10-schema/tsconfig.es.json b/private/aws-protocoltests-json-10-schema/tsconfig.es.json new file mode 100644 index 0000000000000..5a76fb6593463 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "ESNext", + "moduleResolution": "bundler", + "outDir": "dist-es", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-json-10-schema/tsconfig.json b/private/aws-protocoltests-json-10-schema/tsconfig.json new file mode 100644 index 0000000000000..956bed461a6ce --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/private/aws-protocoltests-json-10-schema/tsconfig.types.json b/private/aws-protocoltests-json-10-schema/tsconfig.types.json new file mode 100644 index 0000000000000..b9a5eb7844868 --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/tsconfig.types.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true, + "noCheck": false + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/private/aws-protocoltests-json-10-schema/vite.config.js b/private/aws-protocoltests-json-10-schema/vite.config.js new file mode 100644 index 0000000000000..e7147d3ac9e1d --- /dev/null +++ b/private/aws-protocoltests-json-10-schema/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-json-schema/.gitignore b/private/aws-protocoltests-json-schema/.gitignore new file mode 100644 index 0000000000000..54f14c9aef253 --- /dev/null +++ b/private/aws-protocoltests-json-schema/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/private/aws-protocoltests-json-schema/LICENSE b/private/aws-protocoltests-json-schema/LICENSE new file mode 100644 index 0000000000000..ba9d6d1526906 --- /dev/null +++ b/private/aws-protocoltests-json-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/private/aws-protocoltests-json-schema/README.md b/private/aws-protocoltests-json-schema/README.md new file mode 100644 index 0000000000000..e7835f11d2aab --- /dev/null +++ b/private/aws-protocoltests-json-schema/README.md @@ -0,0 +1,2563 @@ + + +# @aws-sdk/aws-protocoltests-json-schema + +## Description + +AWS SDK for JavaScript JsonProtocol Client for Node.js, Browser and React Native. + +## Installing + +To install this package, simply type add or install @aws-sdk/aws-protocoltests-json-schema +using your favorite package manager: + +- `npm install @aws-sdk/aws-protocoltests-json-schema` +- `yarn add @aws-sdk/aws-protocoltests-json-schema` +- `pnpm add @aws-sdk/aws-protocoltests-json-schema` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `JsonProtocolClient` and +the commands you need, for example `JsonEnumsCommand`: + +```js +// ES5 example +const { JsonProtocolClient, JsonEnumsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); +``` + +```ts +// ES6+ example +import { JsonProtocolClient, JsonEnumsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new JsonProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new JsonEnumsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-protocoltests-json-schema"; +const client = new AWS.JsonProtocol({ region: "REGION" }); + +// async/await. +try { + const data = await client.jsonEnums(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .jsonEnums(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.jsonEnums(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-protocoltests-json-schema` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EmptyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyOperationCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +KitchenSinkOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/KitchenSinkOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/KitchenSinkOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/KitchenSinkOperationCommandOutput/) + +
+
+ +NullOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NullOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullOperationCommandOutput/) + +
+
+ +OperationWithOptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithOptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithOptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithOptionalInputOutputCommandOutput/) + +
+
+ +PutAndGetInlineDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PutAndGetInlineDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutAndGetInlineDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutAndGetInlineDocumentsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseNullsOperationCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +OperationWithRequiredMembers + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithRequiredMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithRequiredMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithRequiredMembersCommandOutput/) + +
+
+ +OperationWithRequiredMembersWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithRequiredMembersWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +AcceptHeaderStarService + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/AcceptHeaderStarServiceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/AcceptHeaderStarServiceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/AcceptHeaderStarServiceCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryMapsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +DocumentType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DocumentTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DocumentTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DocumentTypeCommandOutput/) + +
+
+ +DocumentTypeAsMapValue + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DocumentTypeAsMapValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DocumentTypeAsMapValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DocumentTypeAsMapValueCommandOutput/) + +
+
+ +DocumentTypeAsPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DocumentTypeAsPayloadCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +HttpChecksumRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpChecksumRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpChecksumRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpChecksumRequiredCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpPrefixHeadersInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPrefixHeadersInResponseCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpRequestWithRegexLiteral + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithRegexLiteralCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithRegexLiteralCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithRegexLiteralCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +JsonBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonBlobsCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonListsCommandOutput/) + +
+
+ +JsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonMapsCommandOutput/) + +
+
+ +JsonTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonTimestampsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +MalformedAcceptWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedAcceptWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedAcceptWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedAcceptWithBodyCommandOutput/) + +
+
+ +MalformedAcceptWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedAcceptWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedAcceptWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedAcceptWithGenericStringCommandOutput/) + +
+
+ +MalformedAcceptWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedAcceptWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedAcceptWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedAcceptWithPayloadCommandOutput/) + +
+
+ +MalformedBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedBlobCommandOutput/) + +
+
+ +MalformedBoolean + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedBooleanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedBooleanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedBooleanCommandOutput/) + +
+
+ +MalformedByte + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedByteCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedByteCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedByteCommandOutput/) + +
+
+ +MalformedContentTypeWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedContentTypeWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedContentTypeWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithGenericStringCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedContentTypeWithoutBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithoutBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithoutBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBodyEmptyInput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedContentTypeWithoutBodyEmptyInputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandOutput/) + +
+
+ +MalformedContentTypeWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedContentTypeWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedContentTypeWithPayloadCommandOutput/) + +
+
+ +MalformedDouble + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedDoubleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedDoubleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedDoubleCommandOutput/) + +
+
+ +MalformedFloat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedFloatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedFloatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedFloatCommandOutput/) + +
+
+ +MalformedInteger + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedIntegerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedIntegerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedIntegerCommandOutput/) + +
+
+ +MalformedList + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedListCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedListCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedListCommandOutput/) + +
+
+ +MalformedLong + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedLongCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLongCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLongCommandOutput/) + +
+
+ +MalformedMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedMapCommandOutput/) + +
+
+ +MalformedRequestBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedRequestBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRequestBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRequestBodyCommandOutput/) + +
+
+ +MalformedShort + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedShortCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedShortCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedShortCommandOutput/) + +
+
+ +MalformedString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedStringCommandOutput/) + +
+
+ +MalformedTimestampBodyDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampBodyDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampBodyDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampBodyDateTimeCommandOutput/) + +
+
+ +MalformedTimestampBodyDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampBodyDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampBodyDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampBodyDefaultCommandOutput/) + +
+
+ +MalformedTimestampBodyHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampBodyHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampBodyHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampBodyHttpDateCommandOutput/) + +
+
+ +MalformedTimestampHeaderDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampHeaderDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampHeaderDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampHeaderDateTimeCommandOutput/) + +
+
+ +MalformedTimestampHeaderDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampHeaderDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampHeaderDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampHeaderDefaultCommandOutput/) + +
+
+ +MalformedTimestampHeaderEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampHeaderEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampHeaderEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampHeaderEpochCommandOutput/) + +
+
+ +MalformedTimestampPathDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampPathDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampPathDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampPathDefaultCommandOutput/) + +
+
+ +MalformedTimestampPathEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampPathEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampPathEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampPathEpochCommandOutput/) + +
+
+ +MalformedTimestampPathHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampPathHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampPathHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampPathHttpDateCommandOutput/) + +
+
+ +MalformedTimestampQueryDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampQueryDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampQueryDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampQueryDefaultCommandOutput/) + +
+
+ +MalformedTimestampQueryEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampQueryEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampQueryEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampQueryEpochCommandOutput/) + +
+
+ +MalformedTimestampQueryHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedTimestampQueryHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampQueryHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedTimestampQueryHttpDateCommandOutput/) + +
+
+ +MalformedUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedUnionCommandOutput/) + +
+
+ +MediaTypeHeader + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MediaTypeHeaderCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MediaTypeHeaderCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MediaTypeHeaderCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +OmitsSerializingEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OmitsSerializingEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OmitsSerializingEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OmitsSerializingEmptyListsCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +PostPlayerAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PostPlayerActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PostPlayerActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PostPlayerActionCommandOutput/) + +
+
+ +PostUnionWithJsonName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PostUnionWithJsonNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PostUnionWithJsonNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PostUnionWithJsonNameCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +ResponseCodeHttpFallback + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ResponseCodeHttpFallbackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ResponseCodeHttpFallbackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ResponseCodeHttpFallbackCommandOutput/) + +
+
+ +ResponseCodeRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ResponseCodeRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ResponseCodeRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ResponseCodeRequiredCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseJsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SparseJsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseJsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseJsonListsCommandOutput/) + +
+
+ +SparseJsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SparseJsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseJsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseJsonMapsCommandOutput/) + +
+
+ +StreamingTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/StreamingTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/StreamingTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/StreamingTraitsCommandOutput/) + +
+
+ +StreamingTraitsRequireLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/StreamingTraitsRequireLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/StreamingTraitsRequireLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/StreamingTraitsRequireLengthCommandOutput/) + +
+
+ +StreamingTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/StreamingTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/StreamingTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/StreamingTraitsWithMediaTypeCommandOutput/) + +
+
+ +TestBodyStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TestBodyStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestBodyStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestBodyStructureCommandOutput/) + +
+
+ +TestGetNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TestGetNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestGetNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestGetNoInputNoPayloadCommandOutput/) + +
+
+ +TestGetNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TestGetNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestGetNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestGetNoPayloadCommandOutput/) + +
+
+ +TestPayloadBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TestPayloadBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPayloadBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPayloadBlobCommandOutput/) + +
+
+ +TestPayloadStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TestPayloadStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPayloadStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPayloadStructureCommandOutput/) + +
+
+ +TestPostNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TestPostNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPostNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPostNoInputNoPayloadCommandOutput/) + +
+
+ +TestPostNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TestPostNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPostNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TestPostNoPayloadCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +UnitInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/UnitInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/UnitInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/UnitInputAndOutputCommandOutput/) + +
+
+ +MalformedEnum + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedEnumCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedEnumCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedEnumCommandOutput/) + +
+
+ +MalformedLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLengthCommandOutput/) + +
+
+ +MalformedLengthOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedLengthOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLengthOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLengthOverrideCommandOutput/) + +
+
+ +MalformedLengthQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedLengthQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLengthQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedLengthQueryStringCommandOutput/) + +
+
+ +MalformedPattern + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedPatternCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedPatternCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedPatternCommandOutput/) + +
+
+ +MalformedPatternOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedPatternOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedPatternOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedPatternOverrideCommandOutput/) + +
+
+ +MalformedRange + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedRangeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRangeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRangeCommandOutput/) + +
+
+ +MalformedRangeOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedRangeOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRangeOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRangeOverrideCommandOutput/) + +
+
+ +MalformedRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedRequiredCommandOutput/) + +
+
+ +MalformedUniqueItems + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/MalformedUniqueItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedUniqueItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/MalformedUniqueItemsCommandOutput/) + +
+
+ +RecursiveStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RecursiveStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveStructuresCommandOutput/) + +
+
+ +SensitiveValidation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SensitiveValidationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SensitiveValidationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SensitiveValidationCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +BodyWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/BodyWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/BodyWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/BodyWithXmlNameCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelHeaderOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointWithHostLabelHeaderOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithMemberXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithMemberXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithMemberXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithMemberXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPayloadWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithXmlNamespaceCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespaceAndPrefix + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPayloadWithXmlNamespaceAndPrefixCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +NestedXmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NestedXmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedXmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedXmlMapsCommandOutput/) + +
+
+ +NestedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NestedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NestedXmlMapWithXmlNameCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +XmlAttributes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlAttributesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlAttributesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlAttributesCommandOutput/) + +
+
+ +XmlAttributesOnPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlAttributesOnPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlAttributesOnPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlAttributesOnPayloadCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEmptyStrings + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEmptyStringsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyStringsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEmptyStringsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +XmlUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/XmlUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/XmlUnionsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +GetRestApis + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GetRestApisCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GetRestApisCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GetRestApisCommandOutput/) + +
+
+ +UploadArchive + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/UploadArchiveCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/UploadArchiveCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/UploadArchiveCommandOutput/) + +
+
+ +UploadMultipartPart + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/UploadMultipartPartCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/UploadMultipartPartCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/UploadMultipartPartCommandOutput/) + +
+
+ +Predict + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/PredictCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PredictCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/PredictCommandOutput/) + +
+
+ +DeleteObjectTagging + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DeleteObjectTaggingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DeleteObjectTaggingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DeleteObjectTaggingCommandOutput/) + +
+
+ +GetBucketLocation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GetBucketLocationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GetBucketLocationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GetBucketLocationCommandOutput/) + +
+
+ +GetObject + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GetObjectCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GetObjectCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GetObjectCommandOutput/) + +
+
+ +ListObjectsV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/ListObjectsV2Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ListObjectsV2CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/ListObjectsV2CommandOutput/) + +
+
+ +EmptyInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/EmptyInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/EmptyInputOutputCommandOutput/) + +
+
+ +Float16 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/Float16Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/Float16CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/Float16CommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +NoInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/NoInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/NoInputOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OptionalInputOutputCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +RpcV2CborDenseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RpcV2CborDenseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RpcV2CborDenseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RpcV2CborDenseMapsCommandOutput/) + +
+
+ +RpcV2CborLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RpcV2CborListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RpcV2CborListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RpcV2CborListsCommandOutput/) + +
+
+ +RpcV2CborSparseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/RpcV2CborSparseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RpcV2CborSparseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/RpcV2CborSparseMapsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/SparseNullsOperationCommandOutput/) + +
diff --git a/private/aws-protocoltests-json-schema/api-extractor.json b/private/aws-protocoltests-json-schema/api-extractor.json new file mode 100644 index 0000000000000..d5bf5ffeee851 --- /dev/null +++ b/private/aws-protocoltests-json-schema/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/private/aws-protocoltests-json-schema/package.json b/private/aws-protocoltests-json-schema/package.json new file mode 100644 index 0000000000000..2cef08722fd8d --- /dev/null +++ b/private/aws-protocoltests-json-schema/package.json @@ -0,0 +1,104 @@ +{ + "name": "@aws-sdk/aws-protocoltests-json-schema", + "description": "@aws-sdk/aws-protocoltests-json-schema client", + "version": "1.0.0-alpha.1", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "test": "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.5.2", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-compression": "^4.1.10", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.10", + "@smithy/middleware-retry": "^4.1.11", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.2", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.18", + "@smithy/util-defaults-mode-node": "^4.0.18", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "@smithy/util-utf8": "^4.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@tsconfig/node18": "18.2.4", + "@types/node": "^18.19.69", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~5.8.3", + "vitest": "2.1.8" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "private": true, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-protocoltests-json-schema", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/aws-protocoltests-json-schema" + } +} diff --git a/private/aws-protocoltests-json-schema/src/JsonProtocol.ts b/private/aws-protocoltests-json-schema/src/JsonProtocol.ts new file mode 100644 index 0000000000000..bc2257cef4f96 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/JsonProtocol.ts @@ -0,0 +1,409 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + ContentTypeParametersCommand, + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { + DatetimeOffsetsCommand, + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, +} from "./commands/DatetimeOffsetsCommand"; +import { + EmptyOperationCommand, + EmptyOperationCommandInput, + EmptyOperationCommandOutput, +} from "./commands/EmptyOperationCommand"; +import { + EndpointOperationCommand, + EndpointOperationCommandInput, + EndpointOperationCommandOutput, +} from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommand, + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { + FractionalSecondsCommand, + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, +} from "./commands/FractionalSecondsCommand"; +import { + GreetingWithErrorsCommand, + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, +} from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommand, + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { JsonEnumsCommand, JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; +import { + JsonIntEnumsCommand, + JsonIntEnumsCommandInput, + JsonIntEnumsCommandOutput, +} from "./commands/JsonIntEnumsCommand"; +import { JsonUnionsCommand, JsonUnionsCommandInput, JsonUnionsCommandOutput } from "./commands/JsonUnionsCommand"; +import { + KitchenSinkOperationCommand, + KitchenSinkOperationCommandInput, + KitchenSinkOperationCommandOutput, +} from "./commands/KitchenSinkOperationCommand"; +import { + NullOperationCommand, + NullOperationCommandInput, + NullOperationCommandOutput, +} from "./commands/NullOperationCommand"; +import { + OperationWithOptionalInputOutputCommand, + OperationWithOptionalInputOutputCommandInput, + OperationWithOptionalInputOutputCommandOutput, +} from "./commands/OperationWithOptionalInputOutputCommand"; +import { + PutAndGetInlineDocumentsCommand, + PutAndGetInlineDocumentsCommandInput, + PutAndGetInlineDocumentsCommandOutput, +} from "./commands/PutAndGetInlineDocumentsCommand"; +import { + PutWithContentEncodingCommand, + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + SimpleScalarPropertiesCommand, + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + SparseNullsOperationCommand, + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, +} from "./commands/SparseNullsOperationCommand"; +import { JsonProtocolClient, JsonProtocolClientConfig } from "./JsonProtocolClient"; + +const commands = { + ContentTypeParametersCommand, + DatetimeOffsetsCommand, + EmptyOperationCommand, + EndpointOperationCommand, + EndpointWithHostLabelOperationCommand, + FractionalSecondsCommand, + GreetingWithErrorsCommand, + HostWithPathOperationCommand, + JsonEnumsCommand, + JsonIntEnumsCommand, + JsonUnionsCommand, + KitchenSinkOperationCommand, + NullOperationCommand, + OperationWithOptionalInputOutputCommand, + PutAndGetInlineDocumentsCommand, + PutWithContentEncodingCommand, + SimpleScalarPropertiesCommand, + SparseNullsOperationCommand, +}; + +export interface JsonProtocol { + /** + * @see {@link ContentTypeParametersCommand} + */ + contentTypeParameters(): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + + /** + * @see {@link DatetimeOffsetsCommand} + */ + datetimeOffsets(): Promise; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + datetimeOffsets(args: DatetimeOffsetsCommandInput, cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void): void; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void + ): void; + + /** + * @see {@link EmptyOperationCommand} + */ + emptyOperation(): Promise; + emptyOperation( + args: EmptyOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + emptyOperation(args: EmptyOperationCommandInput, cb: (err: any, data?: EmptyOperationCommandOutput) => void): void; + emptyOperation( + args: EmptyOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EmptyOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointOperationCommand} + */ + endpointOperation(): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + endpointOperation( + args: EndpointOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointWithHostLabelOperationCommand} + */ + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + + /** + * @see {@link FractionalSecondsCommand} + */ + fractionalSeconds(): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + + /** + * @see {@link GreetingWithErrorsCommand} + */ + greetingWithErrors(): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + + /** + * @see {@link HostWithPathOperationCommand} + */ + hostWithPathOperation(): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + + /** + * @see {@link JsonEnumsCommand} + */ + jsonEnums(): Promise; + jsonEnums(args: JsonEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonEnums(args: JsonEnumsCommandInput, cb: (err: any, data?: JsonEnumsCommandOutput) => void): void; + jsonEnums( + args: JsonEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonEnumsCommandOutput) => void + ): void; + + /** + * @see {@link JsonIntEnumsCommand} + */ + jsonIntEnums(): Promise; + jsonIntEnums(args: JsonIntEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonIntEnums(args: JsonIntEnumsCommandInput, cb: (err: any, data?: JsonIntEnumsCommandOutput) => void): void; + jsonIntEnums( + args: JsonIntEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonIntEnumsCommandOutput) => void + ): void; + + /** + * @see {@link JsonUnionsCommand} + */ + jsonUnions(): Promise; + jsonUnions(args: JsonUnionsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonUnions(args: JsonUnionsCommandInput, cb: (err: any, data?: JsonUnionsCommandOutput) => void): void; + jsonUnions( + args: JsonUnionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonUnionsCommandOutput) => void + ): void; + + /** + * @see {@link KitchenSinkOperationCommand} + */ + kitchenSinkOperation(): Promise; + kitchenSinkOperation( + args: KitchenSinkOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + kitchenSinkOperation( + args: KitchenSinkOperationCommandInput, + cb: (err: any, data?: KitchenSinkOperationCommandOutput) => void + ): void; + kitchenSinkOperation( + args: KitchenSinkOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: KitchenSinkOperationCommandOutput) => void + ): void; + + /** + * @see {@link NullOperationCommand} + */ + nullOperation(): Promise; + nullOperation(args: NullOperationCommandInput, options?: __HttpHandlerOptions): Promise; + nullOperation(args: NullOperationCommandInput, cb: (err: any, data?: NullOperationCommandOutput) => void): void; + nullOperation( + args: NullOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NullOperationCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithOptionalInputOutputCommand} + */ + operationWithOptionalInputOutput(): Promise; + operationWithOptionalInputOutput( + args: OperationWithOptionalInputOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithOptionalInputOutput( + args: OperationWithOptionalInputOutputCommandInput, + cb: (err: any, data?: OperationWithOptionalInputOutputCommandOutput) => void + ): void; + operationWithOptionalInputOutput( + args: OperationWithOptionalInputOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithOptionalInputOutputCommandOutput) => void + ): void; + + /** + * @see {@link PutAndGetInlineDocumentsCommand} + */ + putAndGetInlineDocuments(): Promise; + putAndGetInlineDocuments( + args: PutAndGetInlineDocumentsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putAndGetInlineDocuments( + args: PutAndGetInlineDocumentsCommandInput, + cb: (err: any, data?: PutAndGetInlineDocumentsCommandOutput) => void + ): void; + putAndGetInlineDocuments( + args: PutAndGetInlineDocumentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutAndGetInlineDocumentsCommandOutput) => void + ): void; + + /** + * @see {@link PutWithContentEncodingCommand} + */ + putWithContentEncoding(): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + + /** + * @see {@link SimpleScalarPropertiesCommand} + */ + simpleScalarProperties(): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + + /** + * @see {@link SparseNullsOperationCommand} + */ + sparseNullsOperation(): Promise; + sparseNullsOperation( + args: SparseNullsOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + sparseNullsOperation( + args: SparseNullsOperationCommandInput, + cb: (err: any, data?: SparseNullsOperationCommandOutput) => void + ): void; + sparseNullsOperation( + args: SparseNullsOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SparseNullsOperationCommandOutput) => void + ): void; +} + +/** + * @public + */ +export class JsonProtocol extends JsonProtocolClient implements JsonProtocol {} +createAggregatedClient(commands, JsonProtocol); diff --git a/private/aws-protocoltests-json-schema/src/JsonProtocolClient.ts b/private/aws-protocoltests-json-schema/src/JsonProtocolClient.ts new file mode 100644 index 0000000000000..9387bd19b73a2 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/JsonProtocolClient.ts @@ -0,0 +1,424 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + ClientProtocol, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + HttpRequest, + HttpResponse, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + defaultJsonProtocolHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "./commands/DatetimeOffsetsCommand"; +import { EmptyOperationCommandInput, EmptyOperationCommandOutput } from "./commands/EmptyOperationCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "./commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; +import { JsonIntEnumsCommandInput, JsonIntEnumsCommandOutput } from "./commands/JsonIntEnumsCommand"; +import { JsonUnionsCommandInput, JsonUnionsCommandOutput } from "./commands/JsonUnionsCommand"; +import { + KitchenSinkOperationCommandInput, + KitchenSinkOperationCommandOutput, +} from "./commands/KitchenSinkOperationCommand"; +import { NullOperationCommandInput, NullOperationCommandOutput } from "./commands/NullOperationCommand"; +import { + OperationWithOptionalInputOutputCommandInput, + OperationWithOptionalInputOutputCommandOutput, +} from "./commands/OperationWithOptionalInputOutputCommand"; +import { + PutAndGetInlineDocumentsCommandInput, + PutAndGetInlineDocumentsCommandOutput, +} from "./commands/PutAndGetInlineDocumentsCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, +} from "./commands/SparseNullsOperationCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | ContentTypeParametersCommandInput + | DatetimeOffsetsCommandInput + | EmptyOperationCommandInput + | EndpointOperationCommandInput + | EndpointWithHostLabelOperationCommandInput + | FractionalSecondsCommandInput + | GreetingWithErrorsCommandInput + | HostWithPathOperationCommandInput + | JsonEnumsCommandInput + | JsonIntEnumsCommandInput + | JsonUnionsCommandInput + | KitchenSinkOperationCommandInput + | NullOperationCommandInput + | OperationWithOptionalInputOutputCommandInput + | PutAndGetInlineDocumentsCommandInput + | PutWithContentEncodingCommandInput + | SimpleScalarPropertiesCommandInput + | SparseNullsOperationCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | ContentTypeParametersCommandOutput + | DatetimeOffsetsCommandOutput + | EmptyOperationCommandOutput + | EndpointOperationCommandOutput + | EndpointWithHostLabelOperationCommandOutput + | FractionalSecondsCommandOutput + | GreetingWithErrorsCommandOutput + | HostWithPathOperationCommandOutput + | JsonEnumsCommandOutput + | JsonIntEnumsCommandOutput + | JsonUnionsCommandOutput + | KitchenSinkOperationCommandOutput + | NullOperationCommandOutput + | OperationWithOptionalInputOutputCommandOutput + | PutAndGetInlineDocumentsCommandOutput + | PutWithContentEncodingCommandOutput + | SimpleScalarPropertiesCommandOutput + | SparseNullsOperationCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON) + * may be overridden. A default will always be set by the client. + * Available options depend on the service's supported protocols and will not be validated by + * the client. + * @alpha + * + */ + protocol?: ClientProtocol; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type JsonProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + CompressionInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of JsonProtocolClient class constructor that set the region, credentials and other options. + */ +export interface JsonProtocolClientConfig extends JsonProtocolClientConfigType {} + +/** + * @public + */ +export type JsonProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + CompressionResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of JsonProtocolClient class. This is resolved and normalized from the {@link JsonProtocolClientConfig | constructor configuration interface}. + */ +export interface JsonProtocolClientResolvedConfig extends JsonProtocolClientResolvedConfigType {} + +/** + * @public + */ +export class JsonProtocolClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + JsonProtocolClientResolvedConfig +> { + /** + * The resolved configuration of JsonProtocolClient class. This is resolved and normalized from the {@link JsonProtocolClientConfig | constructor configuration interface}. + */ + readonly config: JsonProtocolClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + super(_config_0 as any); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveCompressionConfig(_config_7); + const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []); + this.config = _config_9; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultJsonProtocolHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: JsonProtocolClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/private/aws-protocoltests-json-schema/src/auth/httpAuthExtensionConfiguration.ts b/private/aws-protocoltests-json-schema/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 0000000000000..8646f4b7092dc --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { JsonProtocolHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: JsonProtocolHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): JsonProtocolHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: JsonProtocolHttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: JsonProtocolHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): JsonProtocolHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/private/aws-protocoltests-json-schema/src/auth/httpAuthSchemeProvider.ts b/private/aws-protocoltests-json-schema/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 0000000000000..7130e8f049c76 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,155 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, + Provider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { JsonProtocolClientConfig, JsonProtocolClientResolvedConfig } from "../JsonProtocolClient"; + +/** + * @internal + */ +export interface JsonProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface JsonProtocolHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + JsonProtocolClientResolvedConfig, + HandlerExecutionContext, + JsonProtocolHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultJsonProtocolHttpAuthSchemeParametersProvider = async ( + config: JsonProtocolClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption(authParameters: JsonProtocolHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "jsonprotocol", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface JsonProtocolHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultJsonProtocolHttpAuthSchemeProvider: JsonProtocolHttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + authSchemePreference?: string[] | Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: JsonProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + readonly authSchemePreference: Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: JsonProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), + }) as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/private/aws-protocoltests-json-schema/src/commands/ContentTypeParametersCommand.ts b/private/aws-protocoltests-json-schema/src/commands/ContentTypeParametersCommand.ts new file mode 100644 index 0000000000000..10f3342bae989 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/ContentTypeParametersCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { ContentTypeParametersInput, ContentTypeParametersOutput } from "../models/models_0"; +import { ContentTypeParameters } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandInput extends ContentTypeParametersInput {} +/** + * @public + * + * The output of {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandOutput extends ContentTypeParametersOutput, __MetadataBearer {} + +/** + * The example tests how servers must support requests + * containing a `Content-Type` header with parameters. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, ContentTypeParametersCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, ContentTypeParametersCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // ContentTypeParametersInput + * value: Number("int"), + * }; + * const command = new ContentTypeParametersCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ContentTypeParametersCommandInput - {@link ContentTypeParametersCommandInput} + * @returns {@link ContentTypeParametersCommandOutput} + * @see {@link ContentTypeParametersCommandInput} for command's `input` shape. + * @see {@link ContentTypeParametersCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + * @public + */ +export class ContentTypeParametersCommand extends $Command + .classBuilder< + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "ContentTypeParameters", {}) + .n("JsonProtocolClient", "ContentTypeParametersCommand") + .f(void 0, void 0) + .sc(ContentTypeParameters) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ContentTypeParametersInput; + output: {}; + }; + sdk: { + input: ContentTypeParametersCommandInput; + output: ContentTypeParametersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/DatetimeOffsetsCommand.ts b/private/aws-protocoltests-json-schema/src/commands/DatetimeOffsetsCommand.ts new file mode 100644 index 0000000000000..669b0d3407ff8 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/DatetimeOffsetsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { DatetimeOffsetsOutput } from "../models/models_0"; +import { DatetimeOffsets } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandInput {} +/** + * @public + * + * The output of {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandOutput extends DatetimeOffsetsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, DatetimeOffsetsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, DatetimeOffsetsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = {}; + * const command = new DatetimeOffsetsCommand(input); + * const response = await client.send(command); + * // { // DatetimeOffsetsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param DatetimeOffsetsCommandInput - {@link DatetimeOffsetsCommandInput} + * @returns {@link DatetimeOffsetsCommandOutput} + * @see {@link DatetimeOffsetsCommandInput} for command's `input` shape. + * @see {@link DatetimeOffsetsCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class DatetimeOffsetsCommand extends $Command + .classBuilder< + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "DatetimeOffsets", {}) + .n("JsonProtocolClient", "DatetimeOffsetsCommand") + .f(void 0, void 0) + .sc(DatetimeOffsets) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: DatetimeOffsetsOutput; + }; + sdk: { + input: DatetimeOffsetsCommandInput; + output: DatetimeOffsetsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/EmptyOperationCommand.ts b/private/aws-protocoltests-json-schema/src/commands/EmptyOperationCommand.ts new file mode 100644 index 0000000000000..4553cac251f3f --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/EmptyOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { EmptyOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EmptyOperationCommand}. + */ +export interface EmptyOperationCommandInput {} +/** + * @public + * + * The output of {@link EmptyOperationCommand}. + */ +export interface EmptyOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, EmptyOperationCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, EmptyOperationCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = {}; + * const command = new EmptyOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EmptyOperationCommandInput - {@link EmptyOperationCommandInput} + * @returns {@link EmptyOperationCommandOutput} + * @see {@link EmptyOperationCommandInput} for command's `input` shape. + * @see {@link EmptyOperationCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class EmptyOperationCommand extends $Command + .classBuilder< + EmptyOperationCommandInput, + EmptyOperationCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "EmptyOperation", {}) + .n("JsonProtocolClient", "EmptyOperationCommand") + .f(void 0, void 0) + .sc(EmptyOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EmptyOperationCommandInput; + output: EmptyOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/EndpointOperationCommand.ts b/private/aws-protocoltests-json-schema/src/commands/EndpointOperationCommand.ts new file mode 100644 index 0000000000000..b31286a28c6e2 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/EndpointOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { EndpointOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandInput {} +/** + * @public + * + * The output of {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, EndpointOperationCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, EndpointOperationCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = {}; + * const command = new EndpointOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointOperationCommandInput - {@link EndpointOperationCommandInput} + * @returns {@link EndpointOperationCommandOutput} + * @see {@link EndpointOperationCommandInput} for command's `input` shape. + * @see {@link EndpointOperationCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class EndpointOperationCommand extends $Command + .classBuilder< + EndpointOperationCommandInput, + EndpointOperationCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "EndpointOperation", {}) + .n("JsonProtocolClient", "EndpointOperationCommand") + .f(void 0, void 0) + .sc(EndpointOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EndpointOperationCommandInput; + output: EndpointOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/EndpointWithHostLabelOperationCommand.ts b/private/aws-protocoltests-json-schema/src/commands/EndpointWithHostLabelOperationCommand.ts new file mode 100644 index 0000000000000..0b32f67405af4 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/EndpointWithHostLabelOperationCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { HostLabelInput } from "../models/models_0"; +import { EndpointWithHostLabelOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandInput extends HostLabelInput {} +/** + * @public + * + * The output of {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, EndpointWithHostLabelOperationCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, EndpointWithHostLabelOperationCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // HostLabelInput + * label: "STRING_VALUE", // required + * }; + * const command = new EndpointWithHostLabelOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointWithHostLabelOperationCommandInput - {@link EndpointWithHostLabelOperationCommandInput} + * @returns {@link EndpointWithHostLabelOperationCommandOutput} + * @see {@link EndpointWithHostLabelOperationCommandInput} for command's `input` shape. + * @see {@link EndpointWithHostLabelOperationCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class EndpointWithHostLabelOperationCommand extends $Command + .classBuilder< + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "EndpointWithHostLabelOperation", {}) + .n("JsonProtocolClient", "EndpointWithHostLabelOperationCommand") + .f(void 0, void 0) + .sc(EndpointWithHostLabelOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HostLabelInput; + output: {}; + }; + sdk: { + input: EndpointWithHostLabelOperationCommandInput; + output: EndpointWithHostLabelOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/FractionalSecondsCommand.ts b/private/aws-protocoltests-json-schema/src/commands/FractionalSecondsCommand.ts new file mode 100644 index 0000000000000..9947ac8dbdf68 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/FractionalSecondsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { FractionalSecondsOutput } from "../models/models_0"; +import { FractionalSeconds } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandInput {} +/** + * @public + * + * The output of {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, FractionalSecondsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, FractionalSecondsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = {}; + * const command = new FractionalSecondsCommand(input); + * const response = await client.send(command); + * // { // FractionalSecondsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput} + * @returns {@link FractionalSecondsCommandOutput} + * @see {@link FractionalSecondsCommandInput} for command's `input` shape. + * @see {@link FractionalSecondsCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class FractionalSecondsCommand extends $Command + .classBuilder< + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "FractionalSeconds", {}) + .n("JsonProtocolClient", "FractionalSecondsCommand") + .f(void 0, void 0) + .sc(FractionalSeconds) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FractionalSecondsOutput; + }; + sdk: { + input: FractionalSecondsCommandInput; + output: FractionalSecondsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/GreetingWithErrorsCommand.ts b/private/aws-protocoltests-json-schema/src/commands/GreetingWithErrorsCommand.ts new file mode 100644 index 0000000000000..3d33332572c50 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/GreetingWithErrorsCommand.ts @@ -0,0 +1,103 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { GreetingWithErrorsOutput } from "../models/models_0"; +import { GreetingWithErrors } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandInput {} +/** + * @public + * + * The output of {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {} + +/** + * This operation has three possible return values: + * + * 1. A successful response in the form of GreetingWithErrorsOutput + * 2. An InvalidGreeting error. + * 3. A ComplexError error. + * + * Implementations must be able to successfully take a response and + * properly deserialize successful and error responses. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, GreetingWithErrorsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, GreetingWithErrorsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = {}; + * const command = new GreetingWithErrorsCommand(input); + * const response = await client.send(command); + * // { // GreetingWithErrorsOutput + * // greeting: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput} + * @returns {@link GreetingWithErrorsCommandOutput} + * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape. + * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link InvalidGreeting} (client fault) + * This error is thrown when an invalid greeting value is provided. + * + * @throws {@link ComplexError} (client fault) + * This error is thrown when a request is invalid. + * + * @throws {@link FooError} (server fault) + * This error has test cases that test some of the dark corners of Amazon service + * framework history. It should only be implemented by clients. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + * @public + */ +export class GreetingWithErrorsCommand extends $Command + .classBuilder< + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "GreetingWithErrors", {}) + .n("JsonProtocolClient", "GreetingWithErrorsCommand") + .f(void 0, void 0) + .sc(GreetingWithErrors) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: GreetingWithErrorsOutput; + }; + sdk: { + input: GreetingWithErrorsCommandInput; + output: GreetingWithErrorsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/HostWithPathOperationCommand.ts b/private/aws-protocoltests-json-schema/src/commands/HostWithPathOperationCommand.ts new file mode 100644 index 0000000000000..681462a13cfd1 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/HostWithPathOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { HostWithPathOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandInput {} +/** + * @public + * + * The output of {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, HostWithPathOperationCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, HostWithPathOperationCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = {}; + * const command = new HostWithPathOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HostWithPathOperationCommandInput - {@link HostWithPathOperationCommandInput} + * @returns {@link HostWithPathOperationCommandOutput} + * @see {@link HostWithPathOperationCommandInput} for command's `input` shape. + * @see {@link HostWithPathOperationCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class HostWithPathOperationCommand extends $Command + .classBuilder< + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "HostWithPathOperation", {}) + .n("JsonProtocolClient", "HostWithPathOperationCommand") + .f(void 0, void 0) + .sc(HostWithPathOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: HostWithPathOperationCommandInput; + output: HostWithPathOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/JsonEnumsCommand.ts b/private/aws-protocoltests-json-schema/src/commands/JsonEnumsCommand.ts new file mode 100644 index 0000000000000..32cc78242075a --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/JsonEnumsCommand.ts @@ -0,0 +1,110 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { JsonEnumsInputOutput } from "../models/models_0"; +import { JsonEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonEnumsCommand}. + */ +export interface JsonEnumsCommandInput extends JsonEnumsInputOutput {} +/** + * @public + * + * The output of {@link JsonEnumsCommand}. + */ +export interface JsonEnumsCommandOutput extends JsonEnumsInputOutput, __MetadataBearer {} + +/** + * This example serializes enums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, JsonEnumsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, JsonEnumsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // JsonEnumsInputOutput + * fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * fooEnumSet: [ // FooEnumSet + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * fooEnumMap: { // FooEnumMap + * "": "Foo" || "Baz" || "Bar" || "1" || "0", + * }, + * }; + * const command = new JsonEnumsCommand(input); + * const response = await client.send(command); + * // { // JsonEnumsInputOutput + * // fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumSet: [ // FooEnumSet + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumMap: { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }; + * + * ``` + * + * @param JsonEnumsCommandInput - {@link JsonEnumsCommandInput} + * @returns {@link JsonEnumsCommandOutput} + * @see {@link JsonEnumsCommandInput} for command's `input` shape. + * @see {@link JsonEnumsCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + * @public + */ +export class JsonEnumsCommand extends $Command + .classBuilder< + JsonEnumsCommandInput, + JsonEnumsCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "JsonEnums", {}) + .n("JsonProtocolClient", "JsonEnumsCommand") + .f(void 0, void 0) + .sc(JsonEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonEnumsInputOutput; + output: JsonEnumsInputOutput; + }; + sdk: { + input: JsonEnumsCommandInput; + output: JsonEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/JsonIntEnumsCommand.ts b/private/aws-protocoltests-json-schema/src/commands/JsonIntEnumsCommand.ts new file mode 100644 index 0000000000000..c81b70aa27e7a --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/JsonIntEnumsCommand.ts @@ -0,0 +1,110 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { JsonIntEnumsInputOutput } from "../models/models_0"; +import { JsonIntEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonIntEnumsCommand}. + */ +export interface JsonIntEnumsCommandInput extends JsonIntEnumsInputOutput {} +/** + * @public + * + * The output of {@link JsonIntEnumsCommand}. + */ +export interface JsonIntEnumsCommandOutput extends JsonIntEnumsInputOutput, __MetadataBearer {} + +/** + * This example serializes intEnums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, JsonIntEnumsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, JsonIntEnumsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // JsonIntEnumsInputOutput + * intEnum1: 1 || 2 || 3, + * intEnum2: 1 || 2 || 3, + * intEnum3: 1 || 2 || 3, + * intEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * intEnumSet: [ // IntegerEnumSet + * 1 || 2 || 3, + * ], + * intEnumMap: { // IntegerEnumMap + * "": 1 || 2 || 3, + * }, + * }; + * const command = new JsonIntEnumsCommand(input); + * const response = await client.send(command); + * // { // JsonIntEnumsInputOutput + * // intEnum1: 1 || 2 || 3, + * // intEnum2: 1 || 2 || 3, + * // intEnum3: 1 || 2 || 3, + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // intEnumSet: [ // IntegerEnumSet + * // 1 || 2 || 3, + * // ], + * // intEnumMap: { // IntegerEnumMap + * // "": 1 || 2 || 3, + * // }, + * // }; + * + * ``` + * + * @param JsonIntEnumsCommandInput - {@link JsonIntEnumsCommandInput} + * @returns {@link JsonIntEnumsCommandOutput} + * @see {@link JsonIntEnumsCommandInput} for command's `input` shape. + * @see {@link JsonIntEnumsCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + * @public + */ +export class JsonIntEnumsCommand extends $Command + .classBuilder< + JsonIntEnumsCommandInput, + JsonIntEnumsCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "JsonIntEnums", {}) + .n("JsonProtocolClient", "JsonIntEnumsCommand") + .f(void 0, void 0) + .sc(JsonIntEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonIntEnumsInputOutput; + output: JsonIntEnumsInputOutput; + }; + sdk: { + input: JsonIntEnumsCommandInput; + output: JsonIntEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/JsonUnionsCommand.ts b/private/aws-protocoltests-json-schema/src/commands/JsonUnionsCommand.ts new file mode 100644 index 0000000000000..beab9889604fb --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/JsonUnionsCommand.ts @@ -0,0 +1,120 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { UnionInputOutput } from "../models/models_0"; +import { JsonUnions } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonUnionsCommand}. + */ +export interface JsonUnionsCommandInput extends UnionInputOutput {} +/** + * @public + * + * The output of {@link JsonUnionsCommand}. + */ +export interface JsonUnionsCommandOutput extends UnionInputOutput, __MetadataBearer {} + +/** + * This operation uses unions for inputs and outputs. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, JsonUnionsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, JsonUnionsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // UnionInputOutput + * contents: { // MyUnion Union: only one key present + * stringValue: "STRING_VALUE", + * booleanValue: true || false, + * numberValue: Number("int"), + * blobValue: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * timestampValue: new Date("TIMESTAMP"), + * enumValue: "Foo" || "Baz" || "Bar" || "1" || "0", + * listValue: [ // StringList + * "STRING_VALUE", + * ], + * mapValue: { // StringMap + * "": "STRING_VALUE", + * }, + * structureValue: { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * }; + * const command = new JsonUnionsCommand(input); + * const response = await client.send(command); + * // { // UnionInputOutput + * // contents: { // MyUnion Union: only one key present + * // stringValue: "STRING_VALUE", + * // booleanValue: true || false, + * // numberValue: Number("int"), + * // blobValue: new Uint8Array(), + * // timestampValue: new Date("TIMESTAMP"), + * // enumValue: "Foo" || "Baz" || "Bar" || "1" || "0", + * // listValue: [ // StringList + * // "STRING_VALUE", + * // ], + * // mapValue: { // StringMap + * // "": "STRING_VALUE", + * // }, + * // structureValue: { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param JsonUnionsCommandInput - {@link JsonUnionsCommandInput} + * @returns {@link JsonUnionsCommandOutput} + * @see {@link JsonUnionsCommandInput} for command's `input` shape. + * @see {@link JsonUnionsCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + * @public + */ +export class JsonUnionsCommand extends $Command + .classBuilder< + JsonUnionsCommandInput, + JsonUnionsCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "JsonUnions", {}) + .n("JsonProtocolClient", "JsonUnionsCommand") + .f(void 0, void 0) + .sc(JsonUnions) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UnionInputOutput; + output: UnionInputOutput; + }; + sdk: { + input: JsonUnionsCommandInput; + output: JsonUnionsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/KitchenSinkOperationCommand.ts b/private/aws-protocoltests-json-schema/src/commands/KitchenSinkOperationCommand.ts new file mode 100644 index 0000000000000..8f40f40d6d07e --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/KitchenSinkOperationCommand.ts @@ -0,0 +1,308 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { KitchenSink } from "../models/models_0"; +import { KitchenSinkOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link KitchenSinkOperationCommand}. + */ +export interface KitchenSinkOperationCommandInput extends KitchenSink {} +/** + * @public + * + * The output of {@link KitchenSinkOperationCommand}. + */ +export interface KitchenSinkOperationCommandOutput extends KitchenSink, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, KitchenSinkOperationCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, KitchenSinkOperationCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // KitchenSink + * Blob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * Boolean: true || false, + * Double: Number("double"), + * EmptyStruct: {}, + * Float: Number("float"), + * HttpdateTimestamp: new Date("TIMESTAMP"), + * Integer: Number("int"), + * Iso8601Timestamp: new Date("TIMESTAMP"), + * JsonValue: "STRING_VALUE", + * ListOfLists: [ // ListOfListOfStrings + * [ // ListOfStrings + * "STRING_VALUE", + * ], + * ], + * ListOfMapsOfStrings: [ // ListOfMapsOfStrings + * { // MapOfStrings + * "": "STRING_VALUE", + * }, + * ], + * ListOfStrings: [ + * "STRING_VALUE", + * ], + * ListOfStructs: [ // ListOfStructs + * { // SimpleStruct + * Value: "STRING_VALUE", + * }, + * ], + * Long: Number("long"), + * MapOfListsOfStrings: { // MapOfListsOfStrings + * "": [ + * "STRING_VALUE", + * ], + * }, + * MapOfMaps: { // MapOfMapOfStrings + * "": { + * "": "STRING_VALUE", + * }, + * }, + * MapOfStrings: { + * "": "STRING_VALUE", + * }, + * MapOfStructs: { // MapOfStructs + * "": { + * Value: "STRING_VALUE", + * }, + * }, + * RecursiveList: [ // ListOfKitchenSinks + * { + * Blob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * Boolean: true || false, + * Double: Number("double"), + * EmptyStruct: {}, + * Float: Number("float"), + * HttpdateTimestamp: new Date("TIMESTAMP"), + * Integer: Number("int"), + * Iso8601Timestamp: new Date("TIMESTAMP"), + * JsonValue: "STRING_VALUE", + * ListOfLists: [ + * "", + * ], + * ListOfMapsOfStrings: [ + * "", + * ], + * ListOfStrings: "", + * ListOfStructs: [ + * { + * Value: "STRING_VALUE", + * }, + * ], + * Long: Number("long"), + * MapOfListsOfStrings: { + * "": "", + * }, + * MapOfMaps: { + * "": "", + * }, + * MapOfStrings: "", + * MapOfStructs: { + * "": { + * Value: "STRING_VALUE", + * }, + * }, + * RecursiveList: [ + * "", + * ], + * RecursiveMap: { // MapOfKitchenSinks + * "": "", + * }, + * RecursiveStruct: "", + * SimpleStruct: "", + * String: "STRING_VALUE", + * StructWithJsonName: { // StructWithJsonName + * Value: "STRING_VALUE", + * }, + * Timestamp: new Date("TIMESTAMP"), + * UnixTimestamp: new Date("TIMESTAMP"), + * }, + * ], + * RecursiveMap: { + * "": "", + * }, + * RecursiveStruct: "", + * SimpleStruct: "", + * String: "STRING_VALUE", + * StructWithJsonName: { + * Value: "STRING_VALUE", + * }, + * Timestamp: new Date("TIMESTAMP"), + * UnixTimestamp: new Date("TIMESTAMP"), + * }; + * const command = new KitchenSinkOperationCommand(input); + * const response = await client.send(command); + * // { // KitchenSink + * // Blob: new Uint8Array(), + * // Boolean: true || false, + * // Double: Number("double"), + * // EmptyStruct: {}, + * // Float: Number("float"), + * // HttpdateTimestamp: new Date("TIMESTAMP"), + * // Integer: Number("int"), + * // Iso8601Timestamp: new Date("TIMESTAMP"), + * // JsonValue: "STRING_VALUE", + * // ListOfLists: [ // ListOfListOfStrings + * // [ // ListOfStrings + * // "STRING_VALUE", + * // ], + * // ], + * // ListOfMapsOfStrings: [ // ListOfMapsOfStrings + * // { // MapOfStrings + * // "": "STRING_VALUE", + * // }, + * // ], + * // ListOfStrings: [ + * // "STRING_VALUE", + * // ], + * // ListOfStructs: [ // ListOfStructs + * // { // SimpleStruct + * // Value: "STRING_VALUE", + * // }, + * // ], + * // Long: Number("long"), + * // MapOfListsOfStrings: { // MapOfListsOfStrings + * // "": [ + * // "STRING_VALUE", + * // ], + * // }, + * // MapOfMaps: { // MapOfMapOfStrings + * // "": { + * // "": "STRING_VALUE", + * // }, + * // }, + * // MapOfStrings: { + * // "": "STRING_VALUE", + * // }, + * // MapOfStructs: { // MapOfStructs + * // "": { + * // Value: "STRING_VALUE", + * // }, + * // }, + * // RecursiveList: [ // ListOfKitchenSinks + * // { + * // Blob: new Uint8Array(), + * // Boolean: true || false, + * // Double: Number("double"), + * // EmptyStruct: {}, + * // Float: Number("float"), + * // HttpdateTimestamp: new Date("TIMESTAMP"), + * // Integer: Number("int"), + * // Iso8601Timestamp: new Date("TIMESTAMP"), + * // JsonValue: "STRING_VALUE", + * // ListOfLists: [ + * // "", + * // ], + * // ListOfMapsOfStrings: [ + * // "", + * // ], + * // ListOfStrings: "", + * // ListOfStructs: [ + * // { + * // Value: "STRING_VALUE", + * // }, + * // ], + * // Long: Number("long"), + * // MapOfListsOfStrings: { + * // "": "", + * // }, + * // MapOfMaps: { + * // "": "", + * // }, + * // MapOfStrings: "", + * // MapOfStructs: { + * // "": { + * // Value: "STRING_VALUE", + * // }, + * // }, + * // RecursiveList: [ + * // "", + * // ], + * // RecursiveMap: { // MapOfKitchenSinks + * // "": "", + * // }, + * // RecursiveStruct: "", + * // SimpleStruct: "", + * // String: "STRING_VALUE", + * // StructWithJsonName: { // StructWithJsonName + * // Value: "STRING_VALUE", + * // }, + * // Timestamp: new Date("TIMESTAMP"), + * // UnixTimestamp: new Date("TIMESTAMP"), + * // }, + * // ], + * // RecursiveMap: { + * // "": "", + * // }, + * // RecursiveStruct: "", + * // SimpleStruct: "", + * // String: "STRING_VALUE", + * // StructWithJsonName: { + * // Value: "STRING_VALUE", + * // }, + * // Timestamp: new Date("TIMESTAMP"), + * // UnixTimestamp: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param KitchenSinkOperationCommandInput - {@link KitchenSinkOperationCommandInput} + * @returns {@link KitchenSinkOperationCommandOutput} + * @see {@link KitchenSinkOperationCommandInput} for command's `input` shape. + * @see {@link KitchenSinkOperationCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link ErrorWithMembers} (client fault) + * + * @throws {@link ErrorWithoutMembers} (server fault) + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class KitchenSinkOperationCommand extends $Command + .classBuilder< + KitchenSinkOperationCommandInput, + KitchenSinkOperationCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "KitchenSinkOperation", {}) + .n("JsonProtocolClient", "KitchenSinkOperationCommand") + .f(void 0, void 0) + .sc(KitchenSinkOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: KitchenSink; + output: KitchenSink; + }; + sdk: { + input: KitchenSinkOperationCommandInput; + output: KitchenSinkOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/NullOperationCommand.ts b/private/aws-protocoltests-json-schema/src/commands/NullOperationCommand.ts new file mode 100644 index 0000000000000..60ff0ed67f5c5 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/NullOperationCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { NullOperationInputOutput } from "../models/models_0"; +import { NullOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NullOperationCommand}. + */ +export interface NullOperationCommandInput extends NullOperationInputOutput {} +/** + * @public + * + * The output of {@link NullOperationCommand}. + */ +export interface NullOperationCommandOutput extends NullOperationInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, NullOperationCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, NullOperationCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // NullOperationInputOutput + * string: "STRING_VALUE", + * }; + * const command = new NullOperationCommand(input); + * const response = await client.send(command); + * // { // NullOperationInputOutput + * // string: "STRING_VALUE", + * // }; + * + * ``` + * + * @param NullOperationCommandInput - {@link NullOperationCommandInput} + * @returns {@link NullOperationCommandOutput} + * @see {@link NullOperationCommandInput} for command's `input` shape. + * @see {@link NullOperationCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class NullOperationCommand extends $Command + .classBuilder< + NullOperationCommandInput, + NullOperationCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "NullOperation", {}) + .n("JsonProtocolClient", "NullOperationCommand") + .f(void 0, void 0) + .sc(NullOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NullOperationInputOutput; + output: NullOperationInputOutput; + }; + sdk: { + input: NullOperationCommandInput; + output: NullOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/OperationWithOptionalInputOutputCommand.ts b/private/aws-protocoltests-json-schema/src/commands/OperationWithOptionalInputOutputCommand.ts new file mode 100644 index 0000000000000..8aecfc204513d --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/OperationWithOptionalInputOutputCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { OperationWithOptionalInputOutputInput, OperationWithOptionalInputOutputOutput } from "../models/models_0"; +import { OperationWithOptionalInputOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithOptionalInputOutputCommand}. + */ +export interface OperationWithOptionalInputOutputCommandInput extends OperationWithOptionalInputOutputInput {} +/** + * @public + * + * The output of {@link OperationWithOptionalInputOutputCommand}. + */ +export interface OperationWithOptionalInputOutputCommandOutput + extends OperationWithOptionalInputOutputOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, OperationWithOptionalInputOutputCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, OperationWithOptionalInputOutputCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // OperationWithOptionalInputOutputInput + * Value: "STRING_VALUE", + * }; + * const command = new OperationWithOptionalInputOutputCommand(input); + * const response = await client.send(command); + * // { // OperationWithOptionalInputOutputOutput + * // Value: "STRING_VALUE", + * // }; + * + * ``` + * + * @param OperationWithOptionalInputOutputCommandInput - {@link OperationWithOptionalInputOutputCommandInput} + * @returns {@link OperationWithOptionalInputOutputCommandOutput} + * @see {@link OperationWithOptionalInputOutputCommandInput} for command's `input` shape. + * @see {@link OperationWithOptionalInputOutputCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class OperationWithOptionalInputOutputCommand extends $Command + .classBuilder< + OperationWithOptionalInputOutputCommandInput, + OperationWithOptionalInputOutputCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "OperationWithOptionalInputOutput", {}) + .n("JsonProtocolClient", "OperationWithOptionalInputOutputCommand") + .f(void 0, void 0) + .sc(OperationWithOptionalInputOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OperationWithOptionalInputOutputInput; + output: OperationWithOptionalInputOutputOutput; + }; + sdk: { + input: OperationWithOptionalInputOutputCommandInput; + output: OperationWithOptionalInputOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/PutAndGetInlineDocumentsCommand.ts b/private/aws-protocoltests-json-schema/src/commands/PutAndGetInlineDocumentsCommand.ts new file mode 100644 index 0000000000000..e20cd97d0a01b --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/PutAndGetInlineDocumentsCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { PutAndGetInlineDocumentsInputOutput } from "../models/models_0"; +import { PutAndGetInlineDocuments } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutAndGetInlineDocumentsCommand}. + */ +export interface PutAndGetInlineDocumentsCommandInput extends PutAndGetInlineDocumentsInputOutput {} +/** + * @public + * + * The output of {@link PutAndGetInlineDocumentsCommand}. + */ +export interface PutAndGetInlineDocumentsCommandOutput extends PutAndGetInlineDocumentsInputOutput, __MetadataBearer {} + +/** + * This example serializes an inline document as part of the payload. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, PutAndGetInlineDocumentsCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, PutAndGetInlineDocumentsCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // PutAndGetInlineDocumentsInputOutput + * inlineDocument: "DOCUMENT_VALUE", + * }; + * const command = new PutAndGetInlineDocumentsCommand(input); + * const response = await client.send(command); + * // { // PutAndGetInlineDocumentsInputOutput + * // inlineDocument: "DOCUMENT_VALUE", + * // }; + * + * ``` + * + * @param PutAndGetInlineDocumentsCommandInput - {@link PutAndGetInlineDocumentsCommandInput} + * @returns {@link PutAndGetInlineDocumentsCommandOutput} + * @see {@link PutAndGetInlineDocumentsCommandInput} for command's `input` shape. + * @see {@link PutAndGetInlineDocumentsCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + * @public + */ +export class PutAndGetInlineDocumentsCommand extends $Command + .classBuilder< + PutAndGetInlineDocumentsCommandInput, + PutAndGetInlineDocumentsCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "PutAndGetInlineDocuments", {}) + .n("JsonProtocolClient", "PutAndGetInlineDocumentsCommand") + .f(void 0, void 0) + .sc(PutAndGetInlineDocuments) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutAndGetInlineDocumentsInputOutput; + output: PutAndGetInlineDocumentsInputOutput; + }; + sdk: { + input: PutAndGetInlineDocumentsCommandInput; + output: PutAndGetInlineDocumentsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-json-schema/src/commands/PutWithContentEncodingCommand.ts new file mode 100644 index 0000000000000..c1dc567f3a620 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/PutWithContentEncodingCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { PutWithContentEncodingInput } from "../models/models_0"; +import { PutWithContentEncoding } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandInput extends PutWithContentEncodingInput {} +/** + * @public + * + * The output of {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, PutWithContentEncodingCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, PutWithContentEncodingCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // PutWithContentEncodingInput + * encoding: "STRING_VALUE", + * data: "STRING_VALUE", + * }; + * const command = new PutWithContentEncodingCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param PutWithContentEncodingCommandInput - {@link PutWithContentEncodingCommandInput} + * @returns {@link PutWithContentEncodingCommandOutput} + * @see {@link PutWithContentEncodingCommandInput} for command's `input` shape. + * @see {@link PutWithContentEncodingCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class PutWithContentEncodingCommand extends $Command + .classBuilder< + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [ + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getCompressionPlugin(config, { + encodings: ["gzip"], + }), + ]; + }) + .s("JsonProtocol", "PutWithContentEncoding", {}) + .n("JsonProtocolClient", "PutWithContentEncodingCommand") + .f(void 0, void 0) + .sc(PutWithContentEncoding) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutWithContentEncodingInput; + output: {}; + }; + sdk: { + input: PutWithContentEncodingCommandInput; + output: PutWithContentEncodingCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/SimpleScalarPropertiesCommand.ts b/private/aws-protocoltests-json-schema/src/commands/SimpleScalarPropertiesCommand.ts new file mode 100644 index 0000000000000..873e3f2f81b95 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/SimpleScalarPropertiesCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { SimpleScalarPropertiesInputOutput } from "../models/models_0"; +import { SimpleScalarProperties } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandInput extends SimpleScalarPropertiesInputOutput {} +/** + * @public + * + * The output of {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandOutput extends SimpleScalarPropertiesInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, SimpleScalarPropertiesCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, SimpleScalarPropertiesCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // SimpleScalarPropertiesInputOutput + * floatValue: Number("float"), + * doubleValue: Number("double"), + * }; + * const command = new SimpleScalarPropertiesCommand(input); + * const response = await client.send(command); + * // { // SimpleScalarPropertiesInputOutput + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }; + * + * ``` + * + * @param SimpleScalarPropertiesCommandInput - {@link SimpleScalarPropertiesCommandInput} + * @returns {@link SimpleScalarPropertiesCommandOutput} + * @see {@link SimpleScalarPropertiesCommandInput} for command's `input` shape. + * @see {@link SimpleScalarPropertiesCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class SimpleScalarPropertiesCommand extends $Command + .classBuilder< + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "SimpleScalarProperties", {}) + .n("JsonProtocolClient", "SimpleScalarPropertiesCommand") + .f(void 0, void 0) + .sc(SimpleScalarProperties) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleScalarPropertiesInputOutput; + output: SimpleScalarPropertiesInputOutput; + }; + sdk: { + input: SimpleScalarPropertiesCommandInput; + output: SimpleScalarPropertiesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/SparseNullsOperationCommand.ts b/private/aws-protocoltests-json-schema/src/commands/SparseNullsOperationCommand.ts new file mode 100644 index 0000000000000..7bd76f969f608 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/SparseNullsOperationCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../JsonProtocolClient"; +import { SparseNullsOperationInputOutput } from "../models/models_0"; +import { SparseNullsOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SparseNullsOperationCommand}. + */ +export interface SparseNullsOperationCommandInput extends SparseNullsOperationInputOutput {} +/** + * @public + * + * The output of {@link SparseNullsOperationCommand}. + */ +export interface SparseNullsOperationCommandOutput extends SparseNullsOperationInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { JsonProtocolClient, SparseNullsOperationCommand } from "@aws-sdk/aws-protocoltests-json-schema"; // ES Modules import + * // const { JsonProtocolClient, SparseNullsOperationCommand } = require("@aws-sdk/aws-protocoltests-json-schema"); // CommonJS import + * const client = new JsonProtocolClient(config); + * const input = { // SparseNullsOperationInputOutput + * sparseStringList: [ // SparseStringList + * "STRING_VALUE", + * ], + * sparseStringMap: { // SparseStringMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new SparseNullsOperationCommand(input); + * const response = await client.send(command); + * // { // SparseNullsOperationInputOutput + * // sparseStringList: [ // SparseStringList + * // "STRING_VALUE", + * // ], + * // sparseStringMap: { // SparseStringMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param SparseNullsOperationCommandInput - {@link SparseNullsOperationCommandInput} + * @returns {@link SparseNullsOperationCommandOutput} + * @see {@link SparseNullsOperationCommandInput} for command's `input` shape. + * @see {@link SparseNullsOperationCommandOutput} for command's `response` shape. + * @see {@link JsonProtocolClientResolvedConfig | config} for JsonProtocolClient's `config` shape. + * + * @throws {@link JsonProtocolServiceException} + *

Base exception class for all service exceptions from JsonProtocol service.

+ * + * + */ +export class SparseNullsOperationCommand extends $Command + .classBuilder< + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, + JsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("JsonProtocol", "SparseNullsOperation", {}) + .n("JsonProtocolClient", "SparseNullsOperationCommand") + .f(void 0, void 0) + .sc(SparseNullsOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SparseNullsOperationInputOutput; + output: SparseNullsOperationInputOutput; + }; + sdk: { + input: SparseNullsOperationCommandInput; + output: SparseNullsOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-json-schema/src/commands/index.ts b/private/aws-protocoltests-json-schema/src/commands/index.ts new file mode 100644 index 0000000000000..746b42f15764c --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/commands/index.ts @@ -0,0 +1,19 @@ +// smithy-typescript generated code +export * from "./ContentTypeParametersCommand"; +export * from "./DatetimeOffsetsCommand"; +export * from "./EmptyOperationCommand"; +export * from "./EndpointOperationCommand"; +export * from "./EndpointWithHostLabelOperationCommand"; +export * from "./FractionalSecondsCommand"; +export * from "./GreetingWithErrorsCommand"; +export * from "./HostWithPathOperationCommand"; +export * from "./JsonEnumsCommand"; +export * from "./JsonIntEnumsCommand"; +export * from "./JsonUnionsCommand"; +export * from "./KitchenSinkOperationCommand"; +export * from "./NullOperationCommand"; +export * from "./OperationWithOptionalInputOutputCommand"; +export * from "./PutAndGetInlineDocumentsCommand"; +export * from "./PutWithContentEncodingCommand"; +export * from "./SimpleScalarPropertiesCommand"; +export * from "./SparseNullsOperationCommand"; diff --git a/private/aws-protocoltests-json-schema/src/endpoint/EndpointParameters.ts b/private/aws-protocoltests-json-schema/src/endpoint/EndpointParameters.ts new file mode 100644 index 0000000000000..953d271a04532 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/endpoint/EndpointParameters.ts @@ -0,0 +1,29 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return Object.assign(options, { + defaultSigningName: "jsonprotocol", + }); +}; + +export const commonParams = { + endpoint: { type: "builtInParams", name: "endpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + endpoint?: string; +} diff --git a/private/aws-protocoltests-json-schema/src/endpoint/endpointResolver.ts b/private/aws-protocoltests-json-schema/src/endpoint/endpointResolver.ts new file mode 100644 index 0000000000000..8bb222967df85 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["endpoint"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/private/aws-protocoltests-json-schema/src/endpoint/ruleset.ts b/private/aws-protocoltests-json-schema/src/endpoint/ruleset.ts new file mode 100644 index 0000000000000..14416a50b2697 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/endpoint/ruleset.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { RuleSetObject } from "@smithy/types"; + +export const ruleSet: RuleSetObject = { + version: "1.0", + parameters: { + endpoint: { + type: "string", + builtIn: "SDK::Endpoint", + documentation: "Endpoint used for making requests. Should be formatted as a URI.", + }, + }, + rules: [ + { + conditions: [ + { + fn: "isSet", + argv: [ + { + ref: "endpoint", + }, + ], + }, + ], + endpoint: { + url: { + ref: "endpoint", + }, + }, + type: "endpoint", + }, + { + conditions: [], + error: "(default endpointRuleSet) endpoint is not set - you must configure an endpoint.", + type: "error", + }, + ], +}; diff --git a/private/aws-protocoltests-json-schema/src/extensionConfiguration.ts b/private/aws-protocoltests-json-schema/src/extensionConfiguration.ts new file mode 100644 index 0000000000000..a96412e43b1d0 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface JsonProtocolExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/private/aws-protocoltests-json-schema/src/index.ts b/private/aws-protocoltests-json-schema/src/index.ts new file mode 100644 index 0000000000000..251b5177ab8ee --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/index.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +/* eslint-disable */ +export * from "./JsonProtocolClient"; +export * from "./JsonProtocol"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { JsonProtocolExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { JsonProtocolServiceException } from "./models/JsonProtocolServiceException"; diff --git a/private/aws-protocoltests-json-schema/src/models/JsonProtocolServiceException.ts b/private/aws-protocoltests-json-schema/src/models/JsonProtocolServiceException.ts new file mode 100644 index 0000000000000..da46d9fc65ea3 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/models/JsonProtocolServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from JsonProtocol service. + */ +export class JsonProtocolServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, JsonProtocolServiceException.prototype); + } +} diff --git a/private/aws-protocoltests-json-schema/src/models/index.ts b/private/aws-protocoltests-json-schema/src/models/index.ts new file mode 100644 index 0000000000000..9eaceb12865f8 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/private/aws-protocoltests-json-schema/src/models/models_0.ts b/private/aws-protocoltests-json-schema/src/models/models_0.ts new file mode 100644 index 0000000000000..b977bd944e518 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/models/models_0.ts @@ -0,0 +1,526 @@ +// smithy-typescript generated code +import { + AutomaticJsonStringConversion as __AutomaticJsonStringConversion, + ExceptionOptionType as __ExceptionOptionType, +} from "@smithy/smithy-client"; +import { DocumentType as __DocumentType } from "@smithy/types"; + +import { JsonProtocolServiceException as __BaseException } from "./JsonProtocolServiceException"; + +/** + * @public + */ +export interface GreetingStruct { + hi?: string | undefined; +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} + +/** + * @public + */ +export interface ComplexNestedErrorData { + Foo?: string | undefined; +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name: "ComplexError" = "ComplexError"; + readonly $fault: "client" = "client"; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * @public + */ +export interface ContentTypeParametersInput { + value?: number | undefined; +} + +/** + * @public + */ +export interface ContentTypeParametersOutput {} + +/** + * @public + */ +export interface DatetimeOffsetsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface EmptyStruct {} + +/** + * @public + */ +export interface HostLabelInput { + label: string | undefined; +} + +/** + * @public + */ +export interface SimpleStruct { + Value?: string | undefined; +} + +/** + * @public + */ +export interface StructWithJsonName { + Value?: string | undefined; +} + +/** + * @public + */ +export class ErrorWithoutMembers extends __BaseException { + readonly name: "ErrorWithoutMembers" = "ErrorWithoutMembers"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ErrorWithoutMembers", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, ErrorWithoutMembers.prototype); + } +} + +/** + * This error has test cases that test some of the dark corners of Amazon service + * framework history. It should only be implemented by clients. + * @public + */ +export class FooError extends __BaseException { + readonly name: "FooError" = "FooError"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "FooError", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, FooError.prototype); + } +} + +/** + * @public + */ +export interface FractionalSecondsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface GreetingWithErrorsOutput { + greeting?: string | undefined; +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name: "InvalidGreeting" = "InvalidGreeting"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface JsonEnumsInputOutput { + fooEnum1?: FooEnum | undefined; + fooEnum2?: FooEnum | undefined; + fooEnum3?: FooEnum | undefined; + fooEnumList?: FooEnum[] | undefined; + fooEnumSet?: FooEnum[] | undefined; + fooEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface JsonIntEnumsInputOutput { + intEnum1?: IntegerEnum | undefined; + intEnum2?: IntegerEnum | undefined; + intEnum3?: IntegerEnum | undefined; + intEnumList?: IntegerEnum[] | undefined; + intEnumSet?: IntegerEnum[] | undefined; + intEnumMap?: Record | undefined; +} + +/** + * A union with a representative set of types for members. + * @public + */ +export type MyUnion = + | MyUnion.BlobValueMember + | MyUnion.BooleanValueMember + | MyUnion.EnumValueMember + | MyUnion.ListValueMember + | MyUnion.MapValueMember + | MyUnion.NumberValueMember + | MyUnion.StringValueMember + | MyUnion.StructureValueMember + | MyUnion.TimestampValueMember + | MyUnion.$UnknownMember; + +/** + * @public + */ +export namespace MyUnion { + export interface StringValueMember { + stringValue: string; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface BooleanValueMember { + stringValue?: never; + booleanValue: boolean; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface NumberValueMember { + stringValue?: never; + booleanValue?: never; + numberValue: number; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface BlobValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue: Uint8Array; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface TimestampValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue: Date; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface EnumValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue: FooEnum; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface ListValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue: string[]; + mapValue?: never; + structureValue?: never; + $unknown?: never; + } + + export interface MapValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue: Record; + structureValue?: never; + $unknown?: never; + } + + export interface StructureValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue: GreetingStruct; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + $unknown: [string, any]; + } + + export interface Visitor { + stringValue: (value: string) => T; + booleanValue: (value: boolean) => T; + numberValue: (value: number) => T; + blobValue: (value: Uint8Array) => T; + timestampValue: (value: Date) => T; + enumValue: (value: FooEnum) => T; + listValue: (value: string[]) => T; + mapValue: (value: Record) => T; + structureValue: (value: GreetingStruct) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: MyUnion, visitor: Visitor): T => { + if (value.stringValue !== undefined) return visitor.stringValue(value.stringValue); + if (value.booleanValue !== undefined) return visitor.booleanValue(value.booleanValue); + if (value.numberValue !== undefined) return visitor.numberValue(value.numberValue); + if (value.blobValue !== undefined) return visitor.blobValue(value.blobValue); + if (value.timestampValue !== undefined) return visitor.timestampValue(value.timestampValue); + if (value.enumValue !== undefined) return visitor.enumValue(value.enumValue); + if (value.listValue !== undefined) return visitor.listValue(value.listValue); + if (value.mapValue !== undefined) return visitor.mapValue(value.mapValue); + if (value.structureValue !== undefined) return visitor.structureValue(value.structureValue); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * A shared structure that contains a single union member. + * @public + */ +export interface UnionInputOutput { + /** + * A union with a representative set of types for members. + * @public + */ + contents?: MyUnion | undefined; +} + +/** + * @public + */ +export interface NullOperationInputOutput { + string?: string | undefined; +} + +/** + * @public + */ +export interface OperationWithOptionalInputOutputInput { + Value?: string | undefined; +} + +/** + * @public + */ +export interface OperationWithOptionalInputOutputOutput { + Value?: string | undefined; +} + +/** + * @public + */ +export interface PutAndGetInlineDocumentsInputOutput { + inlineDocument?: __DocumentType | undefined; +} + +/** + * @public + */ +export interface PutWithContentEncodingInput { + encoding?: string | undefined; + data?: string | undefined; +} + +/** + * @public + */ +export interface SimpleScalarPropertiesInputOutput { + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export interface SparseNullsOperationInputOutput { + sparseStringList?: string[] | undefined; + sparseStringMap?: Record | undefined; +} + +/** + * @public + */ +export interface KitchenSink { + Blob?: Uint8Array | undefined; + Boolean?: boolean | undefined; + Double?: number | undefined; + EmptyStruct?: EmptyStruct | undefined; + Float?: number | undefined; + HttpdateTimestamp?: Date | undefined; + Integer?: number | undefined; + Iso8601Timestamp?: Date | undefined; + JsonValue?: __AutomaticJsonStringConversion | string | undefined; + ListOfLists?: string[][] | undefined; + ListOfMapsOfStrings?: Record[] | undefined; + ListOfStrings?: string[] | undefined; + ListOfStructs?: SimpleStruct[] | undefined; + Long?: number | undefined; + MapOfListsOfStrings?: Record | undefined; + MapOfMaps?: Record> | undefined; + MapOfStrings?: Record | undefined; + MapOfStructs?: Record | undefined; + RecursiveList?: KitchenSink[] | undefined; + RecursiveMap?: Record | undefined; + RecursiveStruct?: KitchenSink | undefined; + SimpleStruct?: SimpleStruct | undefined; + String?: string | undefined; + StructWithJsonName?: StructWithJsonName | undefined; + Timestamp?: Date | undefined; + UnixTimestamp?: Date | undefined; +} + +/** + * @public + */ +export class ErrorWithMembers extends __BaseException { + readonly name: "ErrorWithMembers" = "ErrorWithMembers"; + readonly $fault: "client" = "client"; + Code?: string | undefined; + ComplexData?: KitchenSink | undefined; + IntegerField?: number | undefined; + ListField?: string[] | undefined; + MapField?: Record | undefined; + Message?: string | undefined; + /** + * abc + * @public + */ + StringField?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ErrorWithMembers", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ErrorWithMembers.prototype); + this.Code = opts.Code; + this.ComplexData = opts.ComplexData; + this.IntegerField = opts.IntegerField; + this.ListField = opts.ListField; + this.MapField = opts.MapField; + this.Message = opts.Message; + this.StringField = opts.StringField; + } +} diff --git a/private/aws-protocoltests-json-schema/src/protocols/Aws_json1_1.ts b/private/aws-protocoltests-json-schema/src/protocols/Aws_json1_1.ts new file mode 100644 index 0000000000000..bfc1a63573028 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/protocols/Aws_json1_1.ts @@ -0,0 +1,1360 @@ +// smithy-typescript generated code +import { + awsExpectUnion as __expectUnion, + loadRestJsonErrorCode, + parseJsonBody as parseBody, + parseJsonErrorBody as parseErrorBody, +} from "@aws-sdk/core"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, + isValidHostname as __isValidHostname, +} from "@smithy/protocol-http"; +import { + _json, + collectBody, + dateToUtcString as __dateToUtcString, + decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, + expectInt32 as __expectInt32, + expectLong as __expectLong, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectString as __expectString, + LazyJsonString as __LazyJsonString, + limitedParseDouble as __limitedParseDouble, + limitedParseFloat32 as __limitedParseFloat32, + parseEpochTimestamp as __parseEpochTimestamp, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime as __parseRfc7231DateTime, + serializeDateTime as __serializeDateTime, + serializeFloat as __serializeFloat, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + DocumentType as __DocumentType, + Endpoint as __Endpoint, + HeaderBag as __HeaderBag, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "../commands/ContentTypeParametersCommand"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "../commands/DatetimeOffsetsCommand"; +import { EmptyOperationCommandInput, EmptyOperationCommandOutput } from "../commands/EmptyOperationCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "../commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "../commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "../commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "../commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "../commands/HostWithPathOperationCommand"; +import { JsonEnumsCommandInput, JsonEnumsCommandOutput } from "../commands/JsonEnumsCommand"; +import { JsonIntEnumsCommandInput, JsonIntEnumsCommandOutput } from "../commands/JsonIntEnumsCommand"; +import { JsonUnionsCommandInput, JsonUnionsCommandOutput } from "../commands/JsonUnionsCommand"; +import { + KitchenSinkOperationCommandInput, + KitchenSinkOperationCommandOutput, +} from "../commands/KitchenSinkOperationCommand"; +import { NullOperationCommandInput, NullOperationCommandOutput } from "../commands/NullOperationCommand"; +import { + OperationWithOptionalInputOutputCommandInput, + OperationWithOptionalInputOutputCommandOutput, +} from "../commands/OperationWithOptionalInputOutputCommand"; +import { + PutAndGetInlineDocumentsCommandInput, + PutAndGetInlineDocumentsCommandOutput, +} from "../commands/PutAndGetInlineDocumentsCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "../commands/PutWithContentEncodingCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "../commands/SimpleScalarPropertiesCommand"; +import { + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, +} from "../commands/SparseNullsOperationCommand"; +import { JsonProtocolServiceException as __BaseException } from "../models/JsonProtocolServiceException"; +import { + ComplexError, + ComplexNestedErrorData, + ContentTypeParametersInput, + DatetimeOffsetsOutput, + EmptyStruct, + ErrorWithMembers, + ErrorWithoutMembers, + FooEnum, + FooError, + FractionalSecondsOutput, + GreetingStruct, + HostLabelInput, + IntegerEnum, + InvalidGreeting, + JsonEnumsInputOutput, + JsonIntEnumsInputOutput, + KitchenSink, + MyUnion, + NullOperationInputOutput, + OperationWithOptionalInputOutputInput, + PutAndGetInlineDocumentsInputOutput, + PutWithContentEncodingInput, + SimpleScalarPropertiesInputOutput, + SimpleStruct, + SparseNullsOperationInputOutput, + StructWithJsonName, + UnionInputOutput, +} from "../models/models_0"; + +/** + * serializeAws_json1_1ContentTypeParametersCommand + */ +export const se_ContentTypeParametersCommand = async ( + input: ContentTypeParametersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ContentTypeParameters"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1DatetimeOffsetsCommand + */ +export const se_DatetimeOffsetsCommand = async ( + input: DatetimeOffsetsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DatetimeOffsets"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1EmptyOperationCommand + */ +export const se_EmptyOperationCommand = async ( + input: EmptyOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("EmptyOperation"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1EndpointOperationCommand + */ +export const se_EndpointOperationCommand = async ( + input: EndpointOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("EndpointOperation"); + const body = "{}"; + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo." + resolvedHostname; + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_json1_1EndpointWithHostLabelOperationCommand + */ +export const se_EndpointWithHostLabelOperationCommand = async ( + input: EndpointWithHostLabelOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("EndpointWithHostLabelOperation"); + let body: any; + body = JSON.stringify(_json(input)); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo.{label}." + resolvedHostname; + if (input.label === undefined) { + throw new Error("Empty value provided for input host prefix: label."); + } + resolvedHostname = resolvedHostname.replace("{label}", input.label!); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_json1_1FractionalSecondsCommand + */ +export const se_FractionalSecondsCommand = async ( + input: FractionalSecondsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("FractionalSeconds"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1GreetingWithErrorsCommand + */ +export const se_GreetingWithErrorsCommand = async ( + input: GreetingWithErrorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GreetingWithErrors"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1HostWithPathOperationCommand + */ +export const se_HostWithPathOperationCommand = async ( + input: HostWithPathOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("HostWithPathOperation"); + const body = "{}"; + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1JsonEnumsCommand + */ +export const se_JsonEnumsCommand = async ( + input: JsonEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("JsonEnums"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1JsonIntEnumsCommand + */ +export const se_JsonIntEnumsCommand = async ( + input: JsonIntEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("JsonIntEnums"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1JsonUnionsCommand + */ +export const se_JsonUnionsCommand = async ( + input: JsonUnionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("JsonUnions"); + let body: any; + body = JSON.stringify(se_UnionInputOutput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1KitchenSinkOperationCommand + */ +export const se_KitchenSinkOperationCommand = async ( + input: KitchenSinkOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("KitchenSinkOperation"); + let body: any; + body = JSON.stringify(se_KitchenSink(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1NullOperationCommand + */ +export const se_NullOperationCommand = async ( + input: NullOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("NullOperation"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1OperationWithOptionalInputOutputCommand + */ +export const se_OperationWithOptionalInputOutputCommand = async ( + input: OperationWithOptionalInputOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("OperationWithOptionalInputOutput"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1PutAndGetInlineDocumentsCommand + */ +export const se_PutAndGetInlineDocumentsCommand = async ( + input: PutAndGetInlineDocumentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("PutAndGetInlineDocuments"); + let body: any; + body = JSON.stringify(se_PutAndGetInlineDocumentsInputOutput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1PutWithContentEncodingCommand + */ +export const se_PutWithContentEncodingCommand = async ( + input: PutWithContentEncodingCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("PutWithContentEncoding"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1SimpleScalarPropertiesCommand + */ +export const se_SimpleScalarPropertiesCommand = async ( + input: SimpleScalarPropertiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("SimpleScalarProperties"); + let body: any; + body = JSON.stringify(se_SimpleScalarPropertiesInputOutput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_1SparseNullsOperationCommand + */ +export const se_SparseNullsOperationCommand = async ( + input: SparseNullsOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("SparseNullsOperation"); + let body: any; + body = JSON.stringify(se_SparseNullsOperationInputOutput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * deserializeAws_json1_1ContentTypeParametersCommand + */ +export const de_ContentTypeParametersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ContentTypeParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1DatetimeOffsetsCommand + */ +export const de_DatetimeOffsetsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DatetimeOffsetsOutput(data, context); + const response: DatetimeOffsetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1EmptyOperationCommand + */ +export const de_EmptyOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EmptyOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1EndpointOperationCommand + */ +export const de_EndpointOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1EndpointWithHostLabelOperationCommand + */ +export const de_EndpointWithHostLabelOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointWithHostLabelOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1FractionalSecondsCommand + */ +export const de_FractionalSecondsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FractionalSecondsOutput(data, context); + const response: FractionalSecondsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1GreetingWithErrorsCommand + */ +export const de_GreetingWithErrorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GreetingWithErrorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1HostWithPathOperationCommand + */ +export const de_HostWithPathOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: HostWithPathOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1JsonEnumsCommand + */ +export const de_JsonEnumsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: JsonEnumsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1JsonIntEnumsCommand + */ +export const de_JsonIntEnumsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: JsonIntEnumsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1JsonUnionsCommand + */ +export const de_JsonUnionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UnionInputOutput(data, context); + const response: JsonUnionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1KitchenSinkOperationCommand + */ +export const de_KitchenSinkOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_KitchenSink(data, context); + const response: KitchenSinkOperationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1NullOperationCommand + */ +export const de_NullOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: NullOperationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1OperationWithOptionalInputOutputCommand + */ +export const de_OperationWithOptionalInputOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: OperationWithOptionalInputOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1PutAndGetInlineDocumentsCommand + */ +export const de_PutAndGetInlineDocumentsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PutAndGetInlineDocumentsInputOutput(data, context); + const response: PutAndGetInlineDocumentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1PutWithContentEncodingCommand + */ +export const de_PutWithContentEncodingCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: PutWithContentEncodingCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1SimpleScalarPropertiesCommand + */ +export const de_SimpleScalarPropertiesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SimpleScalarPropertiesInputOutput(data, context); + const response: SimpleScalarPropertiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1SparseNullsOperationCommand + */ +export const de_SparseNullsOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SparseNullsOperationInputOutput(data, context); + const response: SparseNullsOperationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Aws_json1_1CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.json#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "FooError": + case "aws.protocoltests.json#FooError": + throw await de_FooErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.json#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + case "ErrorWithMembers": + case "aws.protocoltests.json#ErrorWithMembers": + throw await de_ErrorWithMembersRes(parsedOutput, context); + case "ErrorWithoutMembers": + case "aws.protocoltests.json#ErrorWithoutMembers": + throw await de_ErrorWithoutMembersRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } +}; + +/** + * deserializeAws_json1_1ComplexErrorRes + */ +const de_ComplexErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_ComplexError(body, context); + const exception = new ComplexError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1ErrorWithMembersRes + */ +const de_ErrorWithMembersRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_ErrorWithMembers(body, context); + const exception = new ErrorWithMembers({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1ErrorWithoutMembersRes + */ +const de_ErrorWithoutMembersRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ErrorWithoutMembers({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1FooErrorRes + */ +const de_FooErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new FooError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1InvalidGreetingRes + */ +const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new InvalidGreeting({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +// se_ContentTypeParametersInput omitted. + +/** + * serializeAws_json1_1Document + */ +const se_Document = (input: __DocumentType, context: __SerdeContext): any => { + return input; +}; + +// se_EmptyStruct omitted. + +// se_HostLabelInput omitted. + +// se_JsonEnumsInputOutput omitted. + +// se_JsonIntEnumsInputOutput omitted. + +/** + * serializeAws_json1_1KitchenSink + */ +const se_KitchenSink = (input: KitchenSink, context: __SerdeContext): any => { + return take(input, { + Blob: context.base64Encoder, + Boolean: [], + Double: __serializeFloat, + EmptyStruct: _json, + Float: __serializeFloat, + HttpdateTimestamp: __dateToUtcString, + Integer: [], + Iso8601Timestamp: __serializeDateTime, + JsonValue: __LazyJsonString.from, + ListOfLists: _json, + ListOfMapsOfStrings: _json, + ListOfStrings: _json, + ListOfStructs: _json, + Long: [], + MapOfListsOfStrings: _json, + MapOfMaps: _json, + MapOfStrings: _json, + MapOfStructs: _json, + RecursiveList: (_) => se_ListOfKitchenSinks(_, context), + RecursiveMap: (_) => se_MapOfKitchenSinks(_, context), + RecursiveStruct: (_) => se_KitchenSink(_, context), + SimpleStruct: _json, + String: [], + StructWithJsonName: (_) => se_StructWithJsonName(_, context), + Timestamp: (_) => _.getTime() / 1_000, + UnixTimestamp: (_) => _.getTime() / 1_000, + }); +}; + +/** + * serializeAws_json1_1ListOfKitchenSinks + */ +const se_ListOfKitchenSinks = (input: KitchenSink[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_KitchenSink(entry, context); + }); +}; + +// se_ListOfListOfStrings omitted. + +// se_ListOfMapsOfStrings omitted. + +// se_ListOfStrings omitted. + +// se_ListOfStructs omitted. + +/** + * serializeAws_json1_1MapOfKitchenSinks + */ +const se_MapOfKitchenSinks = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + acc[key] = se_KitchenSink(value, context); + return acc; + }, {}); +}; + +// se_MapOfListsOfStrings omitted. + +// se_MapOfMapOfStrings omitted. + +// se_MapOfStrings omitted. + +// se_MapOfStructs omitted. + +/** + * serializeAws_json1_1MyUnion + */ +const se_MyUnion = (input: MyUnion, context: __SerdeContext): any => { + return MyUnion.visit(input, { + blobValue: (value) => ({ blobValue: context.base64Encoder(value) }), + booleanValue: (value) => ({ booleanValue: value }), + enumValue: (value) => ({ enumValue: value }), + listValue: (value) => ({ listValue: _json(value) }), + mapValue: (value) => ({ mapValue: _json(value) }), + numberValue: (value) => ({ numberValue: value }), + stringValue: (value) => ({ stringValue: value }), + structureValue: (value) => ({ structureValue: _json(value) }), + timestampValue: (value) => ({ timestampValue: value.getTime() / 1_000 }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + +// se_NullOperationInputOutput omitted. + +// se_OperationWithOptionalInputOutputInput omitted. + +/** + * serializeAws_json1_1PutAndGetInlineDocumentsInputOutput + */ +const se_PutAndGetInlineDocumentsInputOutput = ( + input: PutAndGetInlineDocumentsInputOutput, + context: __SerdeContext +): any => { + return take(input, { + inlineDocument: (_) => se_Document(_, context), + }); +}; + +// se_PutWithContentEncodingInput omitted. + +/** + * serializeAws_json1_1SimpleScalarPropertiesInputOutput + */ +const se_SimpleScalarPropertiesInputOutput = ( + input: SimpleScalarPropertiesInputOutput, + context: __SerdeContext +): any => { + return take(input, { + doubleValue: __serializeFloat, + floatValue: __serializeFloat, + }); +}; + +// se_SimpleStruct omitted. + +/** + * serializeAws_json1_1SparseNullsOperationInputOutput + */ +const se_SparseNullsOperationInputOutput = (input: SparseNullsOperationInputOutput, context: __SerdeContext): any => { + return take(input, { + sparseStringList: (_) => se_SparseStringList(_, context), + sparseStringMap: (_) => se_SparseStringMap(_, context), + }); +}; + +/** + * serializeAws_json1_1StructWithJsonName + */ +const se_StructWithJsonName = (input: StructWithJsonName, context: __SerdeContext): any => { + return take(input, { + Value: [, , `Value`], + }); +}; + +/** + * serializeAws_json1_1UnionInputOutput + */ +const se_UnionInputOutput = (input: UnionInputOutput, context: __SerdeContext): any => { + return take(input, { + contents: (_) => se_MyUnion(_, context), + }); +}; + +// se_FooEnumList omitted. + +// se_FooEnumMap omitted. + +// se_FooEnumSet omitted. + +// se_GreetingStruct omitted. + +// se_IntegerEnumList omitted. + +// se_IntegerEnumMap omitted. + +// se_IntegerEnumSet omitted. + +/** + * serializeAws_json1_1SparseStringList + */ +const se_SparseStringList = (input: string[], context: __SerdeContext): any => { + return input; +}; + +/** + * serializeAws_json1_1SparseStringMap + */ +const se_SparseStringMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key] = null as any; + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; + +// se_StringList omitted. + +// se_StringMap omitted. + +/** + * deserializeAws_json1_1ComplexError + */ +const de_ComplexError = (output: any, context: __SerdeContext): ComplexError => { + return take(output, { + Nested: (_: any) => de_ComplexNestedErrorData(_, context), + TopLevel: __expectString, + }) as any; +}; + +/** + * deserializeAws_json1_1ComplexNestedErrorData + */ +const de_ComplexNestedErrorData = (output: any, context: __SerdeContext): ComplexNestedErrorData => { + return take(output, { + Foo: [, __expectString, `Foo`], + }) as any; +}; + +// de_ContentTypeParametersOutput omitted. + +/** + * deserializeAws_json1_1DatetimeOffsetsOutput + */ +const de_DatetimeOffsetsOutput = (output: any, context: __SerdeContext): DatetimeOffsetsOutput => { + return take(output, { + datetime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_json1_1Document + */ +const de_Document = (output: any, context: __SerdeContext): __DocumentType => { + return output; +}; + +// de_EmptyStruct omitted. + +/** + * deserializeAws_json1_1ErrorWithMembers + */ +const de_ErrorWithMembers = (output: any, context: __SerdeContext): ErrorWithMembers => { + return take(output, { + Code: __expectString, + ComplexData: (_: any) => de_KitchenSink(_, context), + IntegerField: __expectInt32, + ListField: _json, + MapField: _json, + Message: __expectString, + StringField: __expectString, + }) as any; +}; + +// de_ErrorWithoutMembers omitted. + +// de_FooError omitted. + +/** + * deserializeAws_json1_1FractionalSecondsOutput + */ +const de_FractionalSecondsOutput = (output: any, context: __SerdeContext): FractionalSecondsOutput => { + return take(output, { + datetime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +// de_GreetingWithErrorsOutput omitted. + +// de_InvalidGreeting omitted. + +// de_JsonEnumsInputOutput omitted. + +// de_JsonIntEnumsInputOutput omitted. + +/** + * deserializeAws_json1_1KitchenSink + */ +const de_KitchenSink = (output: any, context: __SerdeContext): KitchenSink => { + return take(output, { + Blob: context.base64Decoder, + Boolean: __expectBoolean, + Double: __limitedParseDouble, + EmptyStruct: _json, + Float: __limitedParseFloat32, + HttpdateTimestamp: (_: any) => __expectNonNull(__parseRfc7231DateTime(_)), + Integer: __expectInt32, + Iso8601Timestamp: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + JsonValue: __LazyJsonString.from, + ListOfLists: _json, + ListOfMapsOfStrings: _json, + ListOfStrings: _json, + ListOfStructs: _json, + Long: __expectLong, + MapOfListsOfStrings: _json, + MapOfMaps: _json, + MapOfStrings: _json, + MapOfStructs: _json, + RecursiveList: (_: any) => de_ListOfKitchenSinks(_, context), + RecursiveMap: (_: any) => de_MapOfKitchenSinks(_, context), + RecursiveStruct: (_: any) => de_KitchenSink(_, context), + SimpleStruct: _json, + String: __expectString, + StructWithJsonName: (_: any) => de_StructWithJsonName(_, context), + Timestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + UnixTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + +/** + * deserializeAws_json1_1ListOfKitchenSinks + */ +const de_ListOfKitchenSinks = (output: any, context: __SerdeContext): KitchenSink[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_KitchenSink(entry, context); + }); + return retVal; +}; + +// de_ListOfListOfStrings omitted. + +// de_ListOfMapsOfStrings omitted. + +// de_ListOfStrings omitted. + +// de_ListOfStructs omitted. + +/** + * deserializeAws_json1_1MapOfKitchenSinks + */ +const de_MapOfKitchenSinks = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + acc[key as string] = de_KitchenSink(value, context); + return acc; + }, {} as Record); +}; + +// de_MapOfListsOfStrings omitted. + +// de_MapOfMapOfStrings omitted. + +// de_MapOfStrings omitted. + +// de_MapOfStructs omitted. + +/** + * deserializeAws_json1_1MyUnion + */ +const de_MyUnion = (output: any, context: __SerdeContext): MyUnion => { + if (output.blobValue != null) { + return { + blobValue: context.base64Decoder(output.blobValue), + }; + } + if (__expectBoolean(output.booleanValue) !== undefined) { + return { booleanValue: __expectBoolean(output.booleanValue) as any }; + } + if (__expectString(output.enumValue) !== undefined) { + return { enumValue: __expectString(output.enumValue) as any }; + } + if (output.listValue != null) { + return { + listValue: _json(output.listValue), + }; + } + if (output.mapValue != null) { + return { + mapValue: _json(output.mapValue), + }; + } + if (__expectInt32(output.numberValue) !== undefined) { + return { numberValue: __expectInt32(output.numberValue) as any }; + } + if (__expectString(output.stringValue) !== undefined) { + return { stringValue: __expectString(output.stringValue) as any }; + } + if (output.structureValue != null) { + return { + structureValue: _json(output.structureValue), + }; + } + if (output.timestampValue != null) { + return { + timestampValue: __expectNonNull(__parseEpochTimestamp(__expectNumber(output.timestampValue))), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +// de_NullOperationInputOutput omitted. + +// de_OperationWithOptionalInputOutputOutput omitted. + +/** + * deserializeAws_json1_1PutAndGetInlineDocumentsInputOutput + */ +const de_PutAndGetInlineDocumentsInputOutput = ( + output: any, + context: __SerdeContext +): PutAndGetInlineDocumentsInputOutput => { + return take(output, { + inlineDocument: (_: any) => de_Document(_, context), + }) as any; +}; + +/** + * deserializeAws_json1_1SimpleScalarPropertiesInputOutput + */ +const de_SimpleScalarPropertiesInputOutput = ( + output: any, + context: __SerdeContext +): SimpleScalarPropertiesInputOutput => { + return take(output, { + doubleValue: __limitedParseDouble, + floatValue: __limitedParseFloat32, + }) as any; +}; + +// de_SimpleStruct omitted. + +/** + * deserializeAws_json1_1SparseNullsOperationInputOutput + */ +const de_SparseNullsOperationInputOutput = (output: any, context: __SerdeContext): SparseNullsOperationInputOutput => { + return take(output, { + sparseStringList: (_: any) => de_SparseStringList(_, context), + sparseStringMap: (_: any) => de_SparseStringMap(_, context), + }) as any; +}; + +/** + * deserializeAws_json1_1StructWithJsonName + */ +const de_StructWithJsonName = (output: any, context: __SerdeContext): StructWithJsonName => { + return take(output, { + Value: [, __expectString, `Value`], + }) as any; +}; + +/** + * deserializeAws_json1_1UnionInputOutput + */ +const de_UnionInputOutput = (output: any, context: __SerdeContext): UnionInputOutput => { + return take(output, { + contents: (_: any) => de_MyUnion(__expectUnion(_), context), + }) as any; +}; + +// de_FooEnumList omitted. + +// de_FooEnumMap omitted. + +// de_FooEnumSet omitted. + +// de_GreetingStruct omitted. + +// de_IntegerEnumList omitted. + +// de_IntegerEnumMap omitted. + +// de_IntegerEnumSet omitted. + +/** + * deserializeAws_json1_1SparseStringList + */ +const de_SparseStringList = (output: any, context: __SerdeContext): string[] => { + const retVal = (output || []).map((entry: any) => { + if (entry === null) { + return null as any; + } + return __expectString(entry) as any; + }); + return retVal; +}; + +/** + * deserializeAws_json1_1SparseStringMap + */ +const de_SparseStringMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key as string] = null as any; + return acc; + } + acc[key as string] = __expectString(value) as any; + return acc; + }, {} as Record); +}; + +// de_StringList omitted. + +// de_StringMap omitted. + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const throwDefaultError = withBaseException(__BaseException); +const buildHttpRpcRequest = async ( + context: __SerdeContext, + headers: __HeaderBag, + path: string, + resolvedHostname: string | undefined, + body: any +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents: any = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +function sharedHeaders(operation: string): __HeaderBag { + return { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": `JsonProtocol.${operation}`, + }; +} diff --git a/private/aws-protocoltests-json-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-json-schema/src/runtimeConfig.browser.ts new file mode 100644 index 0000000000000..941fd6d793027 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/runtimeConfig.browser.ts @@ -0,0 +1,51 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { JsonProtocolClientConfig } from "./JsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/private/aws-protocoltests-json-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-json-schema/src/runtimeConfig.native.ts new file mode 100644 index 0000000000000..d0afa6531faf1 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { JsonProtocolClientConfig } from "./JsonProtocolClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/private/aws-protocoltests-json-schema/src/runtimeConfig.shared.ts b/private/aws-protocoltests-json-schema/src/runtimeConfig.shared.ts new file mode 100644 index 0000000000000..02dfd0e73f90a --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/runtimeConfig.shared.ts @@ -0,0 +1,40 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { AwsJson1_1Protocol } from "@aws-sdk/core/protocols"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultJsonProtocolHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { JsonProtocolClientConfig } from "./JsonProtocolClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { + return { + apiVersion: "2018-01-01", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultJsonProtocolHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + protocol: config?.protocol ?? new AwsJson1_1Protocol({ defaultNamespace: "aws.protocoltests.json" }), + serviceId: config?.serviceId ?? "Json Protocol", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/private/aws-protocoltests-json-schema/src/runtimeConfig.ts b/private/aws-protocoltests-json-schema/src/runtimeConfig.ts new file mode 100644 index 0000000000000..89195e5203049 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/runtimeConfig.ts @@ -0,0 +1,81 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { JsonProtocolClientConfig } from "./JsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: + config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), + retryMode: + config?.retryMode ?? + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; diff --git a/private/aws-protocoltests-json-schema/src/runtimeExtensions.ts b/private/aws-protocoltests-json-schema/src/runtimeExtensions.ts new file mode 100644 index 0000000000000..8a29ded30626f --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/runtimeExtensions.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { JsonProtocolExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: JsonProtocolExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: JsonProtocolExtensionConfiguration = Object.assign( + getAwsRegionExtensionConfiguration(runtimeConfig), + getDefaultExtensionConfiguration(runtimeConfig), + getHttpHandlerExtensionConfiguration(runtimeConfig), + getHttpAuthExtensionConfiguration(runtimeConfig) + ); + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return Object.assign( + runtimeConfig, + resolveAwsRegionExtensionConfiguration(extensionConfiguration), + resolveDefaultRuntimeConfig(extensionConfiguration), + resolveHttpHandlerRuntimeConfig(extensionConfiguration), + resolveHttpAuthRuntimeConfig(extensionConfiguration) + ); +}; diff --git a/private/aws-protocoltests-json-schema/src/schemas/schemas.ts b/private/aws-protocoltests-json-schema/src/schemas/schemas.ts new file mode 100644 index 0000000000000..0eeda0f2b57c6 --- /dev/null +++ b/private/aws-protocoltests-json-schema/src/schemas/schemas.ts @@ -0,0 +1,568 @@ +const _B = "Blob"; +const _Bo = "Boolean"; +const _C = "Code"; +const _CD = "ComplexData"; +const _CE = "ComplexError"; +const _CE_ = "Content-Encoding"; +const _CNED = "ComplexNestedErrorData"; +const _CTP = "ContentTypeParameters"; +const _CTPI = "ContentTypeParametersInput"; +const _CTPO = "ContentTypeParametersOutput"; +const _D = "Double"; +const _DO = "DatetimeOffsets"; +const _DOO = "DatetimeOffsetsOutput"; +const _DT = "DateTime"; +const _EO = "EmptyOperation"; +const _EOn = "EndpointOperation"; +const _ES = "EmptyStruct"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _EWM = "ErrorWithMembers"; +const _EWMr = "ErrorWithoutMembers"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FEL = "FooEnumList"; +const _FEM = "FooEnumMap"; +const _FES = "FooEnumSet"; +const _FEo = "FooError"; +const _FS = "FractionalSeconds"; +const _FSO = "FractionalSecondsOutput"; +const _Fo = "Foo"; +const _Foo = "Fooooo"; +const _GS = "GreetingStruct"; +const _GWE = "GreetingWithErrors"; +const _GWEO = "GreetingWithErrorsOutput"; +const _HLI = "HostLabelInput"; +const _HT = "HttpdateTimestamp"; +const _HWPO = "HostWithPathOperation"; +const _I = "Integer"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IEM = "IntegerEnumMap"; +const _IES = "IntegerEnumSet"; +const _IF = "IntegerField"; +const _IG = "InvalidGreeting"; +const _IT = "Iso8601Timestamp"; +const _JE = "JsonEnums"; +const _JEIO = "JsonEnumsInputOutput"; +const _JIE = "JsonIntEnums"; +const _JIEIO = "JsonIntEnumsInputOutput"; +const _JU = "JsonUnions"; +const _JV = "JsonValue"; +const _KS = "KitchenSink"; +const _KSO = "KitchenSinkOperation"; +const _L = "Long"; +const _LF = "ListField"; +const _LOKS = "ListOfKitchenSinks"; +const _LOL = "ListOfLists"; +const _LOLOS = "ListOfListOfStrings"; +const _LOMOS = "ListOfMapsOfStrings"; +const _LOS = "ListOfStrings"; +const _LOSi = "ListOfStructs"; +const _M = "Message"; +const _MF = "MapField"; +const _MOKS = "MapOfKitchenSinks"; +const _MOLOS = "MapOfListsOfStrings"; +const _MOM = "MapOfMaps"; +const _MOMOS = "MapOfMapOfStrings"; +const _MOS = "MapOfStrings"; +const _MOSa = "MapOfStructs"; +const _MU = "MyUnion"; +const _N = "Nested"; +const _NO = "NullOperation"; +const _NOIO = "NullOperationInputOutput"; +const _OWOIO = "OperationWithOptionalInputOutput"; +const _OWOIOI = "OperationWithOptionalInputOutputInput"; +const _OWOIOO = "OperationWithOptionalInputOutputOutput"; +const _PAGID = "PutAndGetInlineDocuments"; +const _PAGIDIO = "PutAndGetInlineDocumentsInputOutput"; +const _PWCE = "PutWithContentEncoding"; +const _PWCEI = "PutWithContentEncodingInput"; +const _RL = "RecursiveList"; +const _RM = "RecursiveMap"; +const _RMe = "RenamedMember"; +const _RS = "RecursiveStruct"; +const _S = "String"; +const _SF = "StringField"; +const _SL = "StringList"; +const _SM = "StringMap"; +const _SNO = "SparseNullsOperation"; +const _SNOIO = "SparseNullsOperationInputOutput"; +const _SS = "SimpleStruct"; +const _SSL = "SparseStringList"; +const _SSM = "SparseStringMap"; +const _SSP = "SimpleScalarProperties"; +const _SSPIO = "SimpleScalarPropertiesInputOutput"; +const _SWJN = "StructWithJsonName"; +const _T = "Timestamp"; +const _TL = "TopLevel"; +const _UIO = "UnionInputOutput"; +const _UT = "UnixTimestamp"; +const _V = "Value"; +const _a = "application/json"; +const _bV = "booleanValue"; +const _bVl = "blobValue"; +const _c = "client"; +const _co = "contents"; +const _d = "datetime"; +const _dV = "doubleValue"; +const _da = "data"; +const _e = "error"; +const _eV = "enumValue"; +const _en = "encoding"; +const _end = "endpoint"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "hi"; +const _hH = "httpHeader"; +const _hL = "hostLabel"; +const _iD = "inlineDocument"; +const _iE = "intEnum1"; +const _iEL = "intEnumList"; +const _iEM = "intEnumMap"; +const _iES = "intEnumSet"; +const _iEn = "intEnum2"; +const _iEnt = "intEnum3"; +const _jN = "jsonName"; +const _l = "label"; +const _lV = "listValue"; +const _mT = "mediaType"; +const _mV = "mapValue"; +const _nV = "numberValue"; +const _s = "server"; +const _sSL = "sparseStringList"; +const _sSM = "sparseStringMap"; +const _sV = "stringValue"; +const _sVt = "structureValue"; +const _sp = "sparse"; +const _st = "string"; +const _tV = "timestampValue"; +const _v = "value"; +const n0 = "aws.protocoltests.json"; +const n1 = "aws.protocoltests.shared"; + +// smithy-typescript generated code +import { error, list, map, op, sim, struct, struct as uni } from "@smithy/core/schema"; + +import { + ComplexError as __ComplexError, + ErrorWithMembers as __ErrorWithMembers, + ErrorWithoutMembers as __ErrorWithoutMembers, + FooError as __FooError, + InvalidGreeting as __InvalidGreeting, +} from "../models/index"; +import { JsonProtocolServiceException as __JsonProtocolServiceException } from "../models/JsonProtocolServiceException"; + +/* eslint no-var: 0 */ + +export var JsonValue = sim(n0, _JV, 0, { + [_mT]: _a, +}); +export var ComplexError = error( + n0, + _CE, + { + [_e]: _c, + }, + [_TL, _N], + [0, [() => ComplexNestedErrorData, 0]], + + __ComplexError +); +export var ComplexNestedErrorData = struct( + n0, + _CNED, + 0, + [_Fo], + [ + [ + 0, + { + [_jN]: _Foo, + }, + ], + ] +); +export var ContentTypeParametersInput = struct(n0, _CTPI, 0, [_v], [1]); +export var ContentTypeParametersOutput = struct(n0, _CTPO, 0, [], []); +export var DatetimeOffsetsOutput = struct(n0, _DOO, 0, [_d], [5]); +export var EmptyStruct = struct(n0, _ES, 0, [], []); +export var ErrorWithMembers = error( + n0, + _EWM, + { + [_e]: _c, + }, + [_C, _CD, _IF, _LF, _MF, _M, _SF], + [0, [() => KitchenSink, 0], 1, 64 | 0, 128 | 0, 0, 0], + + __ErrorWithMembers +); +export var ErrorWithoutMembers = error( + n0, + _EWMr, + { + [_e]: _s, + }, + [], + [], + + __ErrorWithoutMembers +); +export var FooError = error( + n0, + _FEo, + { + [_e]: _s, + }, + [], + [], + + __FooError +); +export var FractionalSecondsOutput = struct(n0, _FSO, 0, [_d], [5]); +export var GreetingWithErrorsOutput = struct(n0, _GWEO, 0, [_g], [0]); +export var HostLabelInput = struct( + n0, + _HLI, + 0, + [_l], + [ + [ + 0, + { + [_hL]: 1, + }, + ], + ] +); +export var InvalidGreeting = error( + n0, + _IG, + { + [_e]: _c, + }, + [_M], + [0], + + __InvalidGreeting +); +export var JsonEnumsInputOutput = struct( + n0, + _JEIO, + 0, + [_fE, _fEo, _fEoo, _fEL, _fES, _fEM], + [0, 0, 0, 64 | 0, 64 | 0, 128 | 0] +); +export var JsonIntEnumsInputOutput = struct( + n0, + _JIEIO, + 0, + [_iE, _iEn, _iEnt, _iEL, _iES, _iEM], + [1, 1, 1, 64 | 1, 64 | 1, 128 | 1] +); +export var KitchenSink = struct( + n0, + _KS, + 0, + [ + _B, + _Bo, + _D, + _ES, + _F, + _HT, + _I, + _IT, + _JV, + _LOL, + _LOMOS, + _LOS, + _LOSi, + _L, + _MOLOS, + _MOM, + _MOS, + _MOSa, + _RL, + _RM, + _RS, + _SS, + _S, + _SWJN, + _T, + _UT, + ], + [ + 21, + 2, + 1, + () => EmptyStruct, + 1, + 6, + 1, + 5, + [() => JsonValue, 0], + list(n0, _LOLOS, 0, 64 | 0), + list(n0, _LOMOS, 0, 128 | 0), + 64 | 0, + () => ListOfStructs, + 1, + map(n0, _MOLOS, 0, 0, 64 | 0), + map(n0, _MOMOS, 0, 0, 128 | 0), + 128 | 0, + () => MapOfStructs, + [() => ListOfKitchenSinks, 0], + [() => MapOfKitchenSinks, 0], + [() => KitchenSink, 0], + () => SimpleStruct, + 0, + [() => StructWithJsonName, 0], + 4, + 7, + ] +); +export var NullOperationInputOutput = struct(n0, _NOIO, 0, [_st], [0]); +export var OperationWithOptionalInputOutputInput = struct(n0, _OWOIOI, 0, [_V], [0]); +export var OperationWithOptionalInputOutputOutput = struct(n0, _OWOIOO, 0, [_V], [0]); +export var PutAndGetInlineDocumentsInputOutput = struct(n0, _PAGIDIO, 0, [_iD], [15]); +export var PutWithContentEncodingInput = struct( + n0, + _PWCEI, + 0, + [_en, _da], + [ + [ + 0, + { + [_hH]: _CE_, + }, + ], + 0, + ] +); +export var SimpleScalarPropertiesInputOutput = struct(n0, _SSPIO, 0, [_fV, _dV], [1, 1]); +export var SimpleStruct = struct(n0, _SS, 0, [_V], [0]); +export var SparseNullsOperationInputOutput = struct( + n0, + _SNOIO, + 0, + [_sSL, _sSM], + [ + [() => SparseStringList, 0], + [() => SparseStringMap, 0], + ] +); +export var StructWithJsonName = struct( + n0, + _SWJN, + 0, + [_V], + [ + [ + 0, + { + [_jN]: _RMe, + }, + ], + ] +); +export var UnionInputOutput = struct(n0, _UIO, 0, [_co], [() => MyUnion]); +export var GreetingStruct = struct(n1, _GS, 0, [_h], [0]); +export var Unit = "unit" as const; + +export var JsonProtocolServiceException = error( + "smithy.ts.sdk.synthetic.aws.protocoltests.json", + "JsonProtocolServiceException", + 0, + [], + [], + __JsonProtocolServiceException +); +export var ListOfKitchenSinks = list(n0, _LOKS, 0, [() => KitchenSink, 0]); +export var ListOfListOfStrings = list(n0, _LOLOS, 0, 64 | 0); +export var ListOfMapsOfStrings = list(n0, _LOMOS, 0, 128 | 0); +export var ListOfStrings = 64 | 0; + +export var ListOfStructs = list(n0, _LOSi, 0, () => SimpleStruct); +export var FooEnumList = 64 | 0; + +export var FooEnumSet = 64 | 0; + +export var IntegerEnumList = 64 | 1; + +export var IntegerEnumSet = 64 | 1; + +export var SparseStringList = list( + n1, + _SSL, + { + [_sp]: 1, + }, + 0 +); +export var StringList = 64 | 0; + +export var MapOfKitchenSinks = map(n0, _MOKS, 0, [0, 0], [() => KitchenSink, 0]); +export var MapOfListsOfStrings = map(n0, _MOLOS, 0, 0, 64 | 0); +export var MapOfMapOfStrings = map(n0, _MOMOS, 0, 0, 128 | 0); +export var MapOfStrings = 128 | 0; + +export var MapOfStructs = map(n0, _MOSa, 0, 0, () => SimpleStruct); +export var FooEnumMap = 128 | 0; + +export var IntegerEnumMap = 128 | 1; + +export var SparseStringMap = map( + n1, + _SSM, + { + [_sp]: 1, + }, + 0, + 0 +); +export var StringMap = 128 | 0; + +export var MyUnion = uni( + n0, + _MU, + 0, + [_sV, _bV, _nV, _bVl, _tV, _eV, _lV, _mV, _sVt], + [0, 2, 1, 21, 4, 0, 64 | 0, 128 | 0, () => GreetingStruct] +); +export var ContentTypeParameters = op( + n0, + _CTP, + 0, + () => ContentTypeParametersInput, + () => ContentTypeParametersOutput +); +export var DatetimeOffsets = op( + n0, + _DO, + 0, + () => Unit, + () => DatetimeOffsetsOutput +); +export var EmptyOperation = op( + n0, + _EO, + 0, + () => Unit, + () => Unit +); +export var EndpointOperation = op( + n0, + _EOn, + { + [_end]: ["foo."], + }, + () => Unit, + () => Unit +); +export var EndpointWithHostLabelOperation = op( + n0, + _EWHLO, + { + [_end]: ["foo.{label}."], + }, + () => HostLabelInput, + () => Unit +); +export var FractionalSeconds = op( + n0, + _FS, + 0, + () => Unit, + () => FractionalSecondsOutput +); +export var GreetingWithErrors = op( + n0, + _GWE, + 2, + () => Unit, + () => GreetingWithErrorsOutput +); +export var HostWithPathOperation = op( + n0, + _HWPO, + 0, + () => Unit, + () => Unit +); +export var JsonEnums = op( + n0, + _JE, + 2, + () => JsonEnumsInputOutput, + () => JsonEnumsInputOutput +); +export var JsonIntEnums = op( + n0, + _JIE, + 2, + () => JsonIntEnumsInputOutput, + () => JsonIntEnumsInputOutput +); +export var JsonUnions = op( + n0, + _JU, + 2, + () => UnionInputOutput, + () => UnionInputOutput +); +export var KitchenSinkOperation = op( + n0, + _KSO, + 0, + () => KitchenSink, + () => KitchenSink +); +export var NullOperation = op( + n0, + _NO, + 0, + () => NullOperationInputOutput, + () => NullOperationInputOutput +); +export var OperationWithOptionalInputOutput = op( + n0, + _OWOIO, + 0, + () => OperationWithOptionalInputOutputInput, + () => OperationWithOptionalInputOutputOutput +); +export var PutAndGetInlineDocuments = op( + n0, + _PAGID, + 0, + () => PutAndGetInlineDocumentsInputOutput, + () => PutAndGetInlineDocumentsInputOutput +); +export var PutWithContentEncoding = op( + n0, + _PWCE, + 0, + () => PutWithContentEncodingInput, + () => Unit +); +export var SimpleScalarProperties = op( + n0, + _SSP, + 0, + () => SimpleScalarPropertiesInputOutput, + () => SimpleScalarPropertiesInputOutput +); +export var SparseNullsOperation = op( + n0, + _SNO, + 0, + () => SparseNullsOperationInputOutput, + () => SparseNullsOperationInputOutput +); diff --git a/private/aws-protocoltests-json-schema/test/functional/awsjson1_1.spec.ts b/private/aws-protocoltests-json-schema/test/functional/awsjson1_1.spec.ts new file mode 100644 index 0000000000000..0c730031b8cf4 --- /dev/null +++ b/private/aws-protocoltests-json-schema/test/functional/awsjson1_1.spec.ts @@ -0,0 +1,5158 @@ +// smithy-typescript generated code +import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; +import { Encoder as __Encoder } from "@smithy/types"; +import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; +import { Readable } from "stream"; +import { expect, test as it } from "vitest"; + +import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; +import { EmptyOperationCommand } from "../../src/commands/EmptyOperationCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommand } from "../../src/commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HostWithPathOperationCommand } from "../../src/commands/HostWithPathOperationCommand"; +import { JsonEnumsCommand } from "../../src/commands/JsonEnumsCommand"; +import { JsonIntEnumsCommand } from "../../src/commands/JsonIntEnumsCommand"; +import { JsonUnionsCommand } from "../../src/commands/JsonUnionsCommand"; +import { KitchenSinkOperationCommand } from "../../src/commands/KitchenSinkOperationCommand"; +import { NullOperationCommand } from "../../src/commands/NullOperationCommand"; +import { OperationWithOptionalInputOutputCommand } from "../../src/commands/OperationWithOptionalInputOutputCommand"; +import { PutAndGetInlineDocumentsCommand } from "../../src/commands/PutAndGetInlineDocumentsCommand"; +import { PutWithContentEncodingCommand } from "../../src/commands/PutWithContentEncodingCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { SparseNullsOperationCommand } from "../../src/commands/SparseNullsOperationCommand"; +import { JsonProtocolClient } from "../../src/JsonProtocolClient"; + +/** + * Throws an expected exception that contains the serialized request. + */ +class EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error { + constructor(readonly request: HttpRequest) { + super(); + } +} + +/** + * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a + * request. The thrown exception contains the serialized request. + */ +class RequestSerializationTestHandler implements HttpHandler { + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request)); + } + updateHttpClientConfig(key: never, value: never): void {} + httpHandlerConfigs() { + return {}; + } +} + +/** + * Returns a resolved Promise of the specified response contents. + */ +class ResponseDeserializationTestHandler implements HttpHandler { + isSuccess: boolean; + code: number; + headers: HeaderBag; + body: string | Uint8Array; + isBase64Body: boolean; + + constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) { + this.isSuccess = isSuccess; + this.code = code; + if (headers === undefined) { + this.headers = {}; + } else { + this.headers = headers; + } + if (body === undefined) { + body = ""; + } + this.body = body; + this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), "base64").toString("base64") === body; + } + + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.resolve({ + response: new HttpResponse({ + statusCode: this.code, + headers: this.headers, + body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]), + }), + }); + } + + updateHttpClientConfig(key: never, value: never): void {} + + httpHandlerConfigs() { + return {}; + } +} + +interface comparableParts { + [key: string]: string; +} + +/** + * Generates a standard map of un-equal values given input parts. + */ +const compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => { + const unequalParts: any = {}; + Object.keys(expectedParts).forEach((key) => { + if (generatedParts[key] === undefined) { + unequalParts[key] = { exp: expectedParts[key], gen: undefined }; + } else if (!equivalentContents(expectedParts[key], generatedParts[key])) { + unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] }; + } + }); + + Object.keys(generatedParts).forEach((key) => { + if (expectedParts[key] === undefined) { + unequalParts[key] = { exp: undefined, gen: generatedParts[key] }; + } + }); + + if (Object.keys(unequalParts).length !== 0) { + return unequalParts; + } + return undefined; +}; + +/** + * Compares all types for equivalent contents, doing nested + * equality checks based on non-`$metadata` + * properties that have defined values. + */ +const equivalentContents = (expected: any, generated: any): boolean => { + if (typeof (global as any).expect === "function") { + expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected)); + return true; + } + + const localExpected = expected; + + // Short circuit on equality. + if (localExpected == generated) { + return true; + } + + if (typeof expected !== "object") { + return expected === generated; + } + + // If a test fails with an issue in the below 6 lines, it's likely + // due to an issue in the nestedness or existence of the property + // being compared. + delete localExpected["$metadata"]; + delete generated["$metadata"]; + Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]); + Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]); + + const expectedProperties = Object.getOwnPropertyNames(localExpected); + const generatedProperties = Object.getOwnPropertyNames(generated); + + // Short circuit on different property counts. + if (expectedProperties.length != generatedProperties.length) { + return false; + } + + // Compare properties directly. + for (let index = 0; index < expectedProperties.length; index++) { + const propertyName = expectedProperties[index]; + if (!equivalentContents(localExpected[propertyName], generated[propertyName])) { + return false; + } + } + + return true; +}; + +const clientParams = { + region: "us-west-2", + credentials: { accessKeyId: "key", secretAccessKey: "secret" }, + endpoint: () => { + const url = new URL("https://localhost/"); + return Promise.resolve({ + hostname: url.hostname, + protocol: url.protocol, + path: url.pathname, + }) as Promise; + }, +}; + +/** + * A wrapper function that shadows `fail` from jest-jasmine2 + * (jasmine2 was replaced with circus in > v27 as the default test runner) + */ +const fail = (error?: any): never => { + throw new Error(error); +}; + +/** + * Hexadecimal to byteArray. + */ +const toBytes = (hex: string) => { + return Buffer.from(hex, "base64"); +}; + +function normalizeByteArrayType(data: any) { + // normalize float32 errors + if (typeof data === "number") { + const u = new Uint8Array(4); + const dv = new DataView(u.buffer, u.byteOffset, u.byteLength); + dv.setFloat32(0, data); + return dv.getFloat32(0); + } + if (!data || typeof data !== "object") { + return data; + } + if (data instanceof Uint8Array) { + return Uint8Array.from(data); + } + if (data instanceof String || data instanceof Boolean || data instanceof Number) { + return data.valueOf(); + } + const output = {} as any; + for (const key of Object.getOwnPropertyNames(data)) { + output[key] = normalizeByteArrayType(data[key]); + } + return output; +} + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("AwsJson11DateTimeWithNegativeOffset:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + ` { + "datetime": "2019-12-16T22:48:18-01:00" + } + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("AwsJson11DateTimeWithPositiveOffset:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + ` { + "datetime": "2019-12-17T00:48:18+01:00" + } + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Sends requests to / + */ +it("sends_requests_to_slash:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyOperationCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EmptyOperation"); + } +}); + +/** + * Includes X-Amz-Target header and Content-Type + */ +it("includes_x_amz_target_and_content_type:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyOperationCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EmptyOperation"); + } +}); + +/** + * Clients must always send an empty JSON object payload for + * operations with no input (that is, `{}`). While AWS service + * implementations support requests with no payload or requests + * that send `{}`, always sending `{}` from the client is + * preferred for forward compatibility in case input is ever + * added to an operation. + */ +it("json_1_1_client_sends_empty_payload_for_no_input_shape:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyOperationCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EmptyOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * When no output is defined, the service is expected to return + * an empty payload, however, client must ignore a JSON payload + * if one is returned. This ensures that if output is added later, + * then it will not break the client. + */ +it("handles_empty_output_shape:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new EmptyOperationCommand(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); +}); + +/** + * This client-only test builds on handles_empty_output_shape, + * by including unexpected fields in the JSON. A client + * needs to ignore JSON output that is empty or that contains + * JSON object data. + */ +it("handles_unexpected_json_output:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "foo": true + }` + ), + }); + + const params: any = {}; + const command = new EmptyOperationCommand(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); +}); + +/** + * When no output is defined, the service is expected to return + * an empty payload. Despite the lack of a payload, the service + * is expected to always send a Content-Type header. Clients must + * handle cases where a service returns a JSON object and where + * a service returns no JSON at all. + */ +it("json_1_1_service_responds_with_no_payload:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `` + ), + }); + + const params: any = {}; + const command = new EmptyOperationCommand(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); +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait. + */ +it("AwsJson11EndpointTrait:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointOperationCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EndpointOperation"); + + expect(r.headers["host"]).toBe("foo.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait, and can use the host label trait to define + * further customization based on user input. + */ +it("AwsJson11EndpointTraitWithHostLabel:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointWithHostLabelOperationCommand({ + label: "bar", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EndpointWithHostLabelOperation"); + + expect(r.headers["host"]).toBe("foo.bar.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"label\": \"bar\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that clients can correctly parse datetime timestamps with fractional seconds + */ +it("AwsJson11DateTimeWithFractionalSeconds:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + ` { + "datetime": "2000-01-02T20:34:56.123Z" + } + ` + ), + }); + + const params: any = {}; + const command = new FractionalSecondsCommand(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 = [ + { + datetime: new Date(9.46845296123e8 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses simple JSON errors + */ +it("AwsJson11InvalidGreetingError:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "__type": "InvalidGreeting", + "Message": "Hi" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "InvalidGreeting") { + console.log(err); + fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Parses a complex error with no message member + */ +it("AwsJson11ComplexError:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "__type": "ComplexError", + "TopLevel": "Top level", + "Nested": { + "Foo": "bar" + } + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + TopLevel: "Top level", + Nested: { + Foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +it("AwsJson11EmptyComplexError:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "__type": "ComplexError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Serializes the X-Amzn-ErrorType header. For an example service, see Amazon EKS. + */ +it("AwsJson11FooErrorUsingXAmznErrorType:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": "FooError", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some X-Amzn-Errortype headers contain URLs. Clients need to split the URL on ':' and take only the first half of the string. For example, 'ValidationException:http://internal.amazon.com/coral/com.amazon.coral.validate/' + * is to be interpreted as 'ValidationException'. + * + * For an example service see Amazon Polly. + */ +it("AwsJson11FooErrorUsingXAmznErrorTypeWithUri:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * X-Amzn-Errortype might contain a URL and a namespace. Client should extract only the shape name. This is a pathalogical case that might not actually happen in any deployed AWS service. + */ +it("AwsJson11FooErrorUsingXAmznErrorTypeWithUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": + "aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * This example uses the 'code' property in the output rather than X-Amzn-Errortype. Some services do this though it's preferable to send the X-Amzn-Errortype. Client implementations must first check for the X-Amzn-Errortype and then check for a top-level 'code' property. + * + * For example service see Amazon S3 Glacier. + */ +it("AwsJson11FooErrorUsingCode:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "code": "FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using code, and it might contain a namespace. Clients should just take the last part of the string after '#'. + */ +it("AwsJson11FooErrorUsingCodeAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "code": "aws.protocoltests.restjson#FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using code, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service. + */ +it("AwsJson11FooErrorUsingCodeUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "code": "aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type. + */ +it("AwsJson11FooErrorWithDunderType:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "__type": "FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type, and it might contain a namespace. Clients should just take the last part of the string after '#'. + */ +it("AwsJson11FooErrorWithDunderTypeAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "__type": "aws.protocoltests.restjson#FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service. + */ +it("AwsJson11FooErrorWithDunderTypeUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "__type": "aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Custom endpoints supplied by users can have paths + */ +it("AwsJson11HostWithPath:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + endpoint: "https://example.com/custom", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HostWithPathOperationCommand({}); + 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("/custom/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.HostWithPathOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("AwsJson11Enums:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonEnumsCommand({ + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonEnums"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"fooEnum1\": \"Foo\", + \"fooEnum2\": \"0\", + \"fooEnum3\": \"1\", + \"fooEnumList\": [ + \"Foo\", + \"0\" + ], + \"fooEnumSet\": [ + \"Foo\", + \"0\" + ], + \"fooEnumMap\": { + \"hi\": \"Foo\", + \"zero\": \"0\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("AwsJson11Enums:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "fooEnum1": "Foo", + "fooEnum2": "0", + "fooEnum3": "1", + "fooEnumList": [ + "Foo", + "0" + ], + "fooEnumSet": [ + "Foo", + "0" + ], + "fooEnumMap": { + "hi": "Foo", + "zero": "0" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonEnumsCommand(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 = [ + { + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("AwsJson11IntEnums:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonIntEnumsCommand({ + intEnum1: 1, + intEnum2: 2, + intEnum3: 3, + intEnumList: [1, 2], + intEnumSet: [1, 2], + intEnumMap: { + a: 1, + b: 2, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonIntEnums"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"intEnum1\": 1, + \"intEnum2\": 2, + \"intEnum3\": 3, + \"intEnumList\": [ + 1, + 2 + ], + \"intEnumSet\": [ + 1, + 2 + ], + \"intEnumMap\": { + \"a\": 1, + \"b\": 2 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("AwsJson11IntEnums:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-amz-target": "JsonProtocol.JsonIntEnums", + "content-type": "application/x-amz-json-1.1", + }, + `{ + "intEnum1": 1, + "intEnum2": 2, + "intEnum3": 3, + "intEnumList": [ + 1, + 2 + ], + "intEnumSet": [ + 1, + 2 + ], + "intEnumMap": { + "a": 1, + "b": 2 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonIntEnumsCommand(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 = [ + { + intEnum1: 1, + intEnum2: 2, + intEnum3: 3, + intEnumList: [1, 2], + intEnumSet: [1, 2], + intEnumMap: { + a: 1, + b: 2, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a string union value + */ +it("AwsJson11SerializeStringUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + stringValue: "foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"stringValue\": \"foo\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a boolean union value + */ +it("AwsJson11SerializeBooleanUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + booleanValue: true, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"booleanValue\": true + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a number union value + */ +it("AwsJson11SerializeNumberUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + numberValue: 1, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"numberValue\": 1 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a blob union value + */ +it("AwsJson11SerializeBlobUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"blobValue\": \"Zm9v\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a timestamp union value + */ +it("AwsJson11SerializeTimestampUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + timestampValue: new Date(1398796238000), + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"timestampValue\": 1398796238 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an enum union value + */ +it("AwsJson11SerializeEnumUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + enumValue: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"enumValue\": \"Foo\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a list union value + */ +it("AwsJson11SerializeListUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + listValue: ["foo", "bar"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"listValue\": [\"foo\", \"bar\"] + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a map union value + */ +it("AwsJson11SerializeMapUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + mapValue: { + foo: "bar", + spam: "eggs", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"mapValue\": { + \"foo\": \"bar\", + \"spam\": \"eggs\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure union value + */ +it("AwsJson11SerializeStructureUnionValue:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + structureValue: { + hi: "hello", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"structureValue\": { + \"hi\": \"hello\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes a string union value + */ +it("AwsJson11DeserializeStringUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "stringValue": "foo" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + stringValue: "foo", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a boolean union value + */ +it("AwsJson11DeserializeBooleanUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "booleanValue": true + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + booleanValue: true, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a number union value + */ +it("AwsJson11DeserializeNumberUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "numberValue": 1 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + numberValue: 1, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a blob union value + */ +it("AwsJson11DeserializeBlobUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "blobValue": "Zm9v" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a timestamp union value + */ +it("AwsJson11DeserializeTimestampUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "timestampValue": 1398796238 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + timestampValue: new Date(1398796238 * 1000), + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes an enum union value + */ +it("AwsJson11DeserializeEnumUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "enumValue": "Foo" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + enumValue: "Foo", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a list union value + */ +it("AwsJson11DeserializeListUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "listValue": ["foo", "bar"] + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + listValue: ["foo", "bar"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a map union value + */ +it("AwsJson11DeserializeMapUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "mapValue": { + "foo": "bar", + "spam": "eggs" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + mapValue: { + foo: "bar", + spam: "eggs", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a structure union value + */ +it("AwsJson11DeserializeStructureUnionValue:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "structureValue": { + "hi": "hello" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + structureValue: { + hi: "hello", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ignores an unrecognized __type property + */ +it("AwsJson11DeserializeIgnoreType:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "contents": { + "__type": "aws.protocoltests.json10#MyUnion", + "structureValue": { + "hi": "hello" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + structureValue: { + hi: "hello", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes string shapes + */ +it("serializes_string_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + String: "abc xyz", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"String\":\"abc xyz\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes string shapes with jsonvalue trait + */ +it("serializes_string_shapes_with_jsonvalue_trait:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + JsonValue: + '{"string":"value","number":1234.5,"boolTrue":true,"boolFalse":false,"array":[1,2,3,4],"object":{"key":"value"},"null":null}', + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"JsonValue\":\"{\\"string\\":\\"value\\",\\"number\\":1234.5,\\"boolTrue\\":true,\\"boolFalse\\":false,\\"array\\":[1,2,3,4],\\"object\\":{\\"key\\":\\"value\\"},\\"null\\":null}\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes integer shapes + */ +it("serializes_integer_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Integer: 1234, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Integer\":1234}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes long shapes + */ +it("serializes_long_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Long: 999999999999, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Long\":999999999999}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes float shapes + */ +it("serializes_float_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Float: 1234.5, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Float\":1234.5}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes double shapes + */ +it("serializes_double_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Double: 1234.5, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Double\":1234.5}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes blob shapes + */ +it("serializes_blob_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Blob: Uint8Array.from("binary-value", (c) => c.charCodeAt(0)), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Blob\":\"YmluYXJ5LXZhbHVl\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes boolean shapes (true) + */ +it("serializes_boolean_shapes_true:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Boolean: true, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Boolean\":true}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes boolean shapes (false) + */ +it("serializes_boolean_shapes_false:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Boolean: false, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Boolean\":false}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes timestamp shapes + */ +it("serializes_timestamp_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Timestamp: new Date(946845296000), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Timestamp\":946845296}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes timestamp shapes with iso8601 timestampFormat + */ +it("serializes_timestamp_shapes_with_iso8601_timestampformat:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + Iso8601Timestamp: new Date(946845296000), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Iso8601Timestamp\":\"2000-01-02T20:34:56Z\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes timestamp shapes with httpdate timestampFormat + */ +it("serializes_timestamp_shapes_with_httpdate_timestampformat:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + HttpdateTimestamp: new Date(946845296000), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"HttpdateTimestamp\":\"Sun, 02 Jan 2000 20:34:56 GMT\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes timestamp shapes with unixTimestamp timestampFormat + */ +it("serializes_timestamp_shapes_with_unixtimestamp_timestampformat:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + UnixTimestamp: new Date(946845296000), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"UnixTimestamp\":946845296}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes list shapes + */ +it("serializes_list_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + ListOfStrings: ["abc", "mno", "xyz"], + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"ListOfStrings\":[\"abc\",\"mno\",\"xyz\"]}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes empty list shapes + */ +it("serializes_empty_list_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + ListOfStrings: [], + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"ListOfStrings\":[]}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes list of map shapes + */ +it("serializes_list_of_map_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + ListOfMapsOfStrings: [ + { + foo: "bar", + } as any, + { + abc: "xyz", + } as any, + { + red: "blue", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"ListOfMapsOfStrings\":[{\"foo\":\"bar\"},{\"abc\":\"xyz\"},{\"red\":\"blue\"}]}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes list of structure shapes + */ +it("serializes_list_of_structure_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + ListOfStructs: [ + { + Value: "abc", + } as any, + { + Value: "mno", + } as any, + { + Value: "xyz", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"ListOfStructs\":[{\"Value\":\"abc\"},{\"Value\":\"mno\"},{\"Value\":\"xyz\"}]}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes list of recursive structure shapes + */ +it("serializes_list_of_recursive_structure_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + RecursiveList: [ + { + RecursiveList: [ + { + RecursiveList: [ + { + Integer: 123, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"RecursiveList\":[{\"RecursiveList\":[{\"RecursiveList\":[{\"Integer\":123}]}]}]}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes map shapes + */ +it("serializes_map_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + MapOfStrings: { + abc: "xyz", + mno: "hjk", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"MapOfStrings\":{\"abc\":\"xyz\",\"mno\":\"hjk\"}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes empty map shapes + */ +it("serializes_empty_map_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + MapOfStrings: {} 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"MapOfStrings\":{}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes map of list shapes + */ +it("serializes_map_of_list_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + MapOfListsOfStrings: { + abc: ["abc", "xyz"], + mno: ["xyz", "abc"], + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"MapOfListsOfStrings\":{\"abc\":[\"abc\",\"xyz\"],\"mno\":[\"xyz\",\"abc\"]}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes map of structure shapes + */ +it("serializes_map_of_structure_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + MapOfStructs: { + key1: { + Value: "value-1", + } as any, + key2: { + Value: "value-2", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"MapOfStructs\":{\"key1\":{\"Value\":\"value-1\"},\"key2\":{\"Value\":\"value-2\"}}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes map of recursive structure shapes + */ +it("serializes_map_of_recursive_structure_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + RecursiveMap: { + key1: { + RecursiveMap: { + key2: { + RecursiveMap: { + key3: { + Boolean: false, + } as any, + } as any, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"RecursiveMap\":{\"key1\":{\"RecursiveMap\":{\"key2\":{\"RecursiveMap\":{\"key3\":{\"Boolean\":false}}}}}}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes structure shapes + */ +it("serializes_structure_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + SimpleStruct: { + Value: "abc", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"SimpleStruct\":{\"Value\":\"abc\"}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes structure members with locationName traits + */ +it("serializes_structure_members_with_locationname_traits:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + StructWithJsonName: { + Value: "some-value", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"StructWithJsonName\":{\"Value\":\"some-value\"}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes empty structure shapes + */ +it("serializes_empty_structure_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + SimpleStruct: {} 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"SimpleStruct\":{}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes structure which have no members + */ +it("serializes_structure_which_have_no_members:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + EmptyStruct: {} 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"EmptyStruct\":{}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes recursive structure shapes + */ +it("serializes_recursive_structure_shapes:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new KitchenSinkOperationCommand({ + String: "top-value", + Boolean: false, + RecursiveStruct: { + String: "nested-value", + Boolean: true, + RecursiveList: [ + { + String: "string-only", + } as any, + { + RecursiveStruct: { + MapOfStrings: { + color: "red", + size: "large", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"String\":\"top-value\",\"Boolean\":false,\"RecursiveStruct\":{\"String\":\"nested-value\",\"Boolean\":true,\"RecursiveList\":[{\"String\":\"string-only\"},{\"RecursiveStruct\":{\"MapOfStrings\":{\"color\":\"red\",\"size\":\"large\"}}}]}}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Parses operations with empty JSON bodies + */ +it("parses_operations_with_empty_json_bodies:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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); +}); + +/** + * Parses string shapes + */ +it("parses_string_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"String":"string-value"}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + String: "string-value", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses integer shapes + */ +it("parses_integer_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Integer":1234}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Integer: 1234, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses long shapes + */ +it("parses_long_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Long":1234567890123456789}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Long: 1234567890123456789, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses float shapes + */ +it("parses_float_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Float":1234.5}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Float: 1234.5, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses double shapes + */ +it("parses_double_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Double":123456789.12345679}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Double: 1.2345678912345679e8, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses boolean shapes (true) + */ +it("parses_boolean_shapes_true:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Boolean":true}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Boolean: true, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses boolean (false) + */ +it("parses_boolean_false:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Boolean":false}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Boolean: false, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses blob shapes + */ +it("parses_blob_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Blob":"YmluYXJ5LXZhbHVl"}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Blob: Uint8Array.from("binary-value", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses timestamp shapes + */ +it("parses_timestamp_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Timestamp":946845296}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Timestamp: new Date(946845296 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses iso8601 timestamps + */ +it("parses_iso8601_timestamps:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"Iso8601Timestamp":"2000-01-02T20:34:56Z"}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + Iso8601Timestamp: new Date(946845296 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses httpdate timestamps + */ +it("parses_httpdate_timestamps:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"HttpdateTimestamp":"Sun, 02 Jan 2000 20:34:56 GMT"}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + HttpdateTimestamp: new Date(946845296 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses list shapes + */ +it("parses_list_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"ListOfStrings":["abc","mno","xyz"]}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + ListOfStrings: ["abc", "mno", "xyz"], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses list of map shapes + */ +it("parses_list_of_map_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"ListOfMapsOfStrings":[{"size":"large"},{"color":"red"}]}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + ListOfMapsOfStrings: [ + { + size: "large", + }, + { + color: "red", + }, + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses list of list shapes + */ +it("parses_list_of_list_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"ListOfLists":[["abc","mno","xyz"],["hjk","qrs","tuv"]]}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + ListOfLists: [ + ["abc", "mno", "xyz"], + ["hjk", "qrs", "tuv"], + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses list of structure shapes + */ +it("parses_list_of_structure_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"ListOfStructs":[{"Value":"value-1"},{"Value":"value-2"}]}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + ListOfStructs: [ + { + Value: "value-1", + }, + { + Value: "value-2", + }, + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses list of recursive structure shapes + */ +it("parses_list_of_recursive_structure_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"RecursiveList":[{"RecursiveList":[{"RecursiveList":[{"String":"value"}]}]}]}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + RecursiveList: [ + { + RecursiveList: [ + { + RecursiveList: [ + { + String: "value", + }, + ], + }, + ], + }, + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses map shapes + */ +it("parses_map_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"MapOfStrings":{"size":"large","color":"red"}}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + MapOfStrings: { + size: "large", + color: "red", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses map of list shapes + */ +it("parses_map_of_list_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"MapOfListsOfStrings":{"sizes":["large","small"],"colors":["red","green"]}}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + MapOfListsOfStrings: { + sizes: ["large", "small"], + colors: ["red", "green"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses map of map shapes + */ +it("parses_map_of_map_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"MapOfMaps":{"sizes":{"large":"L","medium":"M"},"colors":{"red":"R","blue":"B"}}}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + MapOfMaps: { + sizes: { + large: "L", + medium: "M", + }, + colors: { + red: "R", + blue: "B", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses map of structure shapes + */ +it("parses_map_of_structure_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"MapOfStructs":{"size":{"Value":"small"},"color":{"Value":"red"}}}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + MapOfStructs: { + size: { + Value: "small", + }, + color: { + Value: "red", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses map of recursive structure shapes + */ +it("parses_map_of_recursive_structure_shapes:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{"RecursiveMap":{"key-1":{"RecursiveMap":{"key-2":{"RecursiveMap":{"key-3":{"String":"value"}}}}}}}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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 = [ + { + RecursiveMap: { + "key-1": { + RecursiveMap: { + "key-2": { + RecursiveMap: { + "key-3": { + String: "value", + }, + }, + }, + }, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses the request id from the response + */ +it("parses_the_request_id_from_the_response:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-amzn-requestid": "amazon-uniq-request-id", + "content-type": "application/x-amz-json-1.1", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new KitchenSinkOperationCommand(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); +}); + +/** + * Null structure values are dropped + */ +it("AwsJson11StructuresDontSerializeNullValues:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NullOperationCommand({ + string: null, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.NullOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Null structure values are dropped + */ +it("AwsJson11StructuresDontDeserializeNullValues:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "string": null + }` + ), + }); + + const params: any = {}; + const command = new NullOperationCommand(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); +}); + +/** + * Can call operations with no input or output + */ +it("can_call_operation_with_no_input_or_output:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithOptionalInputOutputCommand({} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.OperationWithOptionalInputOutput"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Can invoke operations with optional input + */ +it("can_call_operation_with_optional_input:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithOptionalInputOutputCommand({ + Value: "Hi", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.OperationWithOptionalInputOutput"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"Value\":\"Hi\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes inline documents in a JSON request. + */ +it("PutAndGetInlineDocumentsInput:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutAndGetInlineDocumentsCommand({ + inlineDocument: { + foo: "bar", + }, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.PutAndGetInlineDocuments"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"inlineDocument\": {\"foo\": \"bar\"} + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes inline documents in a JSON response. + */ +it("PutAndGetInlineDocumentsInput:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "inlineDocument": {"foo": "bar"} + }` + ), + }); + + const params: any = {}; + const command = new PutAndGetInlineDocumentsCommand(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 = [ + { + inlineDocument: { + foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header. + */ +it("SDKAppliedContentEncoding_awsJson1_1:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header, and the + * user-provided content-encoding is NOT in the Content-Encoding header since HTTP binding + * traits are ignored in the awsJson1_1 protocol. + * + */ +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + encoding: "custom", + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Supports handling NaN float values. + */ +it("AwsJson11SupportsNaNFloatInputs:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: NaN, + doubleValue: NaN, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SimpleScalarProperties"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"NaN\", + \"doubleValue\": \"NaN\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("AwsJson11SupportsInfinityFloatInputs:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: Infinity, + doubleValue: Infinity, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SimpleScalarProperties"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"Infinity\", + \"doubleValue\": \"Infinity\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling -Infinity float values. + */ +it("AwsJson11SupportsNegativeInfinityFloatInputs:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: -Infinity, + doubleValue: -Infinity, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SimpleScalarProperties"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"-Infinity\", + \"doubleValue\": \"-Infinity\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling NaN float values. + */ +it("AwsJson11SupportsNaNFloatInputs:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "floatValue": "NaN", + "doubleValue": "NaN" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: NaN, + doubleValue: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float values. + */ +it("AwsJson11SupportsInfinityFloatInputs:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "floatValue": "Infinity", + "doubleValue": "Infinity" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: Infinity, + doubleValue: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float values. + */ +it("AwsJson11SupportsNegativeInfinityFloatInputs:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "floatValue": "-Infinity", + "doubleValue": "-Infinity" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: -Infinity, + doubleValue: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes null values in maps + */ +it("AwsJson11SparseMapsSerializeNullValues:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseNullsOperationCommand({ + sparseStringMap: { + foo: null, + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SparseNullsOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseStringMap\": { + \"foo\": null + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes null values in lists + */ +it("AwsJson11SparseListsSerializeNull:Request", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseNullsOperationCommand({ + sparseStringList: [null], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); + expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SparseNullsOperation"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseStringList\": [ + null + ] + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes null values in maps + */ +it("AwsJson11SparseMapsDeserializeNullValues:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "sparseStringMap": { + "foo": null + } + }` + ), + }); + + const params: any = {}; + const command = new SparseNullsOperationCommand(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 = [ + { + sparseStringMap: { + foo: null, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes null values in lists + */ +it("AwsJson11SparseListsDeserializeNull:Response", async () => { + const client = new JsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/x-amz-json-1.1", + }, + `{ + "sparseStringList": [ + null + ] + }` + ), + }); + + const params: any = {}; + const command = new SparseNullsOperationCommand(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 = [ + { + sparseStringList: [null], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentJsonBodies = (expectedBody: string, generatedBody: string): Object => { + const expectedParts = JSON.parse(expectedBody); + const generatedParts = JSON.parse(generatedBody); + + return compareParts(expectedParts, generatedParts); +}; + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentUnknownTypeBodies = ( + utf8Encoder: __Encoder, + expectedBody: string, + generatedBody: string | Uint8Array +): Object => { + const expectedParts = { Value: expectedBody }; + const generatedParts = { + Value: generatedBody instanceof Uint8Array ? utf8Encoder(generatedBody) : generatedBody, + }; + + return compareParts(expectedParts, generatedParts); +}; diff --git a/private/aws-protocoltests-json-schema/tsconfig.cjs.json b/private/aws-protocoltests-json-schema/tsconfig.cjs.json new file mode 100644 index 0000000000000..9224176da7f72 --- /dev/null +++ b/private/aws-protocoltests-json-schema/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-json-schema/tsconfig.es.json b/private/aws-protocoltests-json-schema/tsconfig.es.json new file mode 100644 index 0000000000000..5a76fb6593463 --- /dev/null +++ b/private/aws-protocoltests-json-schema/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "ESNext", + "moduleResolution": "bundler", + "outDir": "dist-es", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-json-schema/tsconfig.json b/private/aws-protocoltests-json-schema/tsconfig.json new file mode 100644 index 0000000000000..956bed461a6ce --- /dev/null +++ b/private/aws-protocoltests-json-schema/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/private/aws-protocoltests-json-schema/tsconfig.types.json b/private/aws-protocoltests-json-schema/tsconfig.types.json new file mode 100644 index 0000000000000..b9a5eb7844868 --- /dev/null +++ b/private/aws-protocoltests-json-schema/tsconfig.types.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true, + "noCheck": false + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/private/aws-protocoltests-json-schema/vite.config.js b/private/aws-protocoltests-json-schema/vite.config.js new file mode 100644 index 0000000000000..e7147d3ac9e1d --- /dev/null +++ b/private/aws-protocoltests-json-schema/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-query-schema/.gitignore b/private/aws-protocoltests-query-schema/.gitignore new file mode 100644 index 0000000000000..54f14c9aef253 --- /dev/null +++ b/private/aws-protocoltests-query-schema/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/private/aws-protocoltests-query-schema/LICENSE b/private/aws-protocoltests-query-schema/LICENSE new file mode 100644 index 0000000000000..ba9d6d1526906 --- /dev/null +++ b/private/aws-protocoltests-query-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/private/aws-protocoltests-query-schema/README.md b/private/aws-protocoltests-query-schema/README.md new file mode 100644 index 0000000000000..b89e36aa8b750 --- /dev/null +++ b/private/aws-protocoltests-query-schema/README.md @@ -0,0 +1,2565 @@ + + +# @aws-sdk/aws-protocoltests-query-schema + +## Description + +AWS SDK for JavaScript QueryProtocol Client for Node.js, Browser and React Native. + +A query service that sends query requests and XML responses. + +## Installing + +To install this package, simply type add or install @aws-sdk/aws-protocoltests-query-schema +using your favorite package manager: + +- `npm install @aws-sdk/aws-protocoltests-query-schema` +- `yarn add @aws-sdk/aws-protocoltests-query-schema` +- `pnpm add @aws-sdk/aws-protocoltests-query-schema` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `QueryProtocolClient` and +the commands you need, for example `QueryListsCommand`: + +```js +// ES5 example +const { QueryProtocolClient, QueryListsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); +``` + +```ts +// ES6+ example +import { QueryProtocolClient, QueryListsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new QueryProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new QueryListsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-protocoltests-query-schema"; +const client = new AWS.QueryProtocol({ region: "REGION" }); + +// async/await. +try { + const data = await client.queryLists(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .queryLists(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.queryLists(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-protocoltests-query-schema` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EmptyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyOperationCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +KitchenSinkOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/KitchenSinkOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/KitchenSinkOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/KitchenSinkOperationCommandOutput/) + +
+
+ +NullOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NullOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullOperationCommandOutput/) + +
+
+ +OperationWithOptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithOptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithOptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithOptionalInputOutputCommandOutput/) + +
+
+ +PutAndGetInlineDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PutAndGetInlineDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutAndGetInlineDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutAndGetInlineDocumentsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseNullsOperationCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +OperationWithRequiredMembers + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithRequiredMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithRequiredMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithRequiredMembersCommandOutput/) + +
+
+ +OperationWithRequiredMembersWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithRequiredMembersWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +AcceptHeaderStarService + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/AcceptHeaderStarServiceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/AcceptHeaderStarServiceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/AcceptHeaderStarServiceCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryMapsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +DocumentType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DocumentTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DocumentTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DocumentTypeCommandOutput/) + +
+
+ +DocumentTypeAsMapValue + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DocumentTypeAsMapValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DocumentTypeAsMapValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DocumentTypeAsMapValueCommandOutput/) + +
+
+ +DocumentTypeAsPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DocumentTypeAsPayloadCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +HttpChecksumRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpChecksumRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpChecksumRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpChecksumRequiredCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpPrefixHeadersInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPrefixHeadersInResponseCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpRequestWithRegexLiteral + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithRegexLiteralCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithRegexLiteralCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithRegexLiteralCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +JsonBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonBlobsCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonListsCommandOutput/) + +
+
+ +JsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonMapsCommandOutput/) + +
+
+ +JsonTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonTimestampsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +MalformedAcceptWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedAcceptWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedAcceptWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedAcceptWithBodyCommandOutput/) + +
+
+ +MalformedAcceptWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedAcceptWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedAcceptWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedAcceptWithGenericStringCommandOutput/) + +
+
+ +MalformedAcceptWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedAcceptWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedAcceptWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedAcceptWithPayloadCommandOutput/) + +
+
+ +MalformedBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedBlobCommandOutput/) + +
+
+ +MalformedBoolean + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedBooleanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedBooleanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedBooleanCommandOutput/) + +
+
+ +MalformedByte + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedByteCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedByteCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedByteCommandOutput/) + +
+
+ +MalformedContentTypeWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedContentTypeWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedContentTypeWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithGenericStringCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedContentTypeWithoutBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithoutBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithoutBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBodyEmptyInput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedContentTypeWithoutBodyEmptyInputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandOutput/) + +
+
+ +MalformedContentTypeWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedContentTypeWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedContentTypeWithPayloadCommandOutput/) + +
+
+ +MalformedDouble + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedDoubleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedDoubleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedDoubleCommandOutput/) + +
+
+ +MalformedFloat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedFloatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedFloatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedFloatCommandOutput/) + +
+
+ +MalformedInteger + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedIntegerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedIntegerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedIntegerCommandOutput/) + +
+
+ +MalformedList + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedListCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedListCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedListCommandOutput/) + +
+
+ +MalformedLong + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedLongCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLongCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLongCommandOutput/) + +
+
+ +MalformedMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedMapCommandOutput/) + +
+
+ +MalformedRequestBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedRequestBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRequestBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRequestBodyCommandOutput/) + +
+
+ +MalformedShort + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedShortCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedShortCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedShortCommandOutput/) + +
+
+ +MalformedString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedStringCommandOutput/) + +
+
+ +MalformedTimestampBodyDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampBodyDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampBodyDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampBodyDateTimeCommandOutput/) + +
+
+ +MalformedTimestampBodyDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampBodyDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampBodyDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampBodyDefaultCommandOutput/) + +
+
+ +MalformedTimestampBodyHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampBodyHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampBodyHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampBodyHttpDateCommandOutput/) + +
+
+ +MalformedTimestampHeaderDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampHeaderDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampHeaderDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampHeaderDateTimeCommandOutput/) + +
+
+ +MalformedTimestampHeaderDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampHeaderDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampHeaderDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampHeaderDefaultCommandOutput/) + +
+
+ +MalformedTimestampHeaderEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampHeaderEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampHeaderEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampHeaderEpochCommandOutput/) + +
+
+ +MalformedTimestampPathDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampPathDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampPathDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampPathDefaultCommandOutput/) + +
+
+ +MalformedTimestampPathEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampPathEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampPathEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampPathEpochCommandOutput/) + +
+
+ +MalformedTimestampPathHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampPathHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampPathHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampPathHttpDateCommandOutput/) + +
+
+ +MalformedTimestampQueryDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampQueryDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampQueryDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampQueryDefaultCommandOutput/) + +
+
+ +MalformedTimestampQueryEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampQueryEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampQueryEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampQueryEpochCommandOutput/) + +
+
+ +MalformedTimestampQueryHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedTimestampQueryHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampQueryHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedTimestampQueryHttpDateCommandOutput/) + +
+
+ +MalformedUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedUnionCommandOutput/) + +
+
+ +MediaTypeHeader + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MediaTypeHeaderCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MediaTypeHeaderCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MediaTypeHeaderCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +OmitsSerializingEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OmitsSerializingEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OmitsSerializingEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OmitsSerializingEmptyListsCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +PostPlayerAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PostPlayerActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PostPlayerActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PostPlayerActionCommandOutput/) + +
+
+ +PostUnionWithJsonName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PostUnionWithJsonNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PostUnionWithJsonNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PostUnionWithJsonNameCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +ResponseCodeHttpFallback + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ResponseCodeHttpFallbackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ResponseCodeHttpFallbackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ResponseCodeHttpFallbackCommandOutput/) + +
+
+ +ResponseCodeRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ResponseCodeRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ResponseCodeRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ResponseCodeRequiredCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseJsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SparseJsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseJsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseJsonListsCommandOutput/) + +
+
+ +SparseJsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SparseJsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseJsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseJsonMapsCommandOutput/) + +
+
+ +StreamingTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/StreamingTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/StreamingTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/StreamingTraitsCommandOutput/) + +
+
+ +StreamingTraitsRequireLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/StreamingTraitsRequireLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/StreamingTraitsRequireLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/StreamingTraitsRequireLengthCommandOutput/) + +
+
+ +StreamingTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/StreamingTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/StreamingTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/StreamingTraitsWithMediaTypeCommandOutput/) + +
+
+ +TestBodyStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TestBodyStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestBodyStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestBodyStructureCommandOutput/) + +
+
+ +TestGetNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TestGetNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestGetNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestGetNoInputNoPayloadCommandOutput/) + +
+
+ +TestGetNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TestGetNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestGetNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestGetNoPayloadCommandOutput/) + +
+
+ +TestPayloadBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TestPayloadBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPayloadBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPayloadBlobCommandOutput/) + +
+
+ +TestPayloadStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TestPayloadStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPayloadStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPayloadStructureCommandOutput/) + +
+
+ +TestPostNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TestPostNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPostNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPostNoInputNoPayloadCommandOutput/) + +
+
+ +TestPostNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TestPostNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPostNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TestPostNoPayloadCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +UnitInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/UnitInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/UnitInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/UnitInputAndOutputCommandOutput/) + +
+
+ +MalformedEnum + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedEnumCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedEnumCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedEnumCommandOutput/) + +
+
+ +MalformedLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLengthCommandOutput/) + +
+
+ +MalformedLengthOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedLengthOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLengthOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLengthOverrideCommandOutput/) + +
+
+ +MalformedLengthQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedLengthQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLengthQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedLengthQueryStringCommandOutput/) + +
+
+ +MalformedPattern + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedPatternCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedPatternCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedPatternCommandOutput/) + +
+
+ +MalformedPatternOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedPatternOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedPatternOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedPatternOverrideCommandOutput/) + +
+
+ +MalformedRange + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedRangeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRangeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRangeCommandOutput/) + +
+
+ +MalformedRangeOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedRangeOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRangeOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRangeOverrideCommandOutput/) + +
+
+ +MalformedRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedRequiredCommandOutput/) + +
+
+ +MalformedUniqueItems + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/MalformedUniqueItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedUniqueItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/MalformedUniqueItemsCommandOutput/) + +
+
+ +RecursiveStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RecursiveStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveStructuresCommandOutput/) + +
+
+ +SensitiveValidation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SensitiveValidationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SensitiveValidationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SensitiveValidationCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +BodyWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/BodyWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/BodyWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/BodyWithXmlNameCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelHeaderOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointWithHostLabelHeaderOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithMemberXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithMemberXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithMemberXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithMemberXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPayloadWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithXmlNamespaceCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespaceAndPrefix + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPayloadWithXmlNamespaceAndPrefixCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +NestedXmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NestedXmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedXmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedXmlMapsCommandOutput/) + +
+
+ +NestedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NestedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NestedXmlMapWithXmlNameCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +XmlAttributes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlAttributesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlAttributesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlAttributesCommandOutput/) + +
+
+ +XmlAttributesOnPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlAttributesOnPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlAttributesOnPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlAttributesOnPayloadCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEmptyStrings + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEmptyStringsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyStringsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEmptyStringsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +XmlUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/XmlUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/XmlUnionsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +GetRestApis + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GetRestApisCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GetRestApisCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GetRestApisCommandOutput/) + +
+
+ +UploadArchive + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/UploadArchiveCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/UploadArchiveCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/UploadArchiveCommandOutput/) + +
+
+ +UploadMultipartPart + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/UploadMultipartPartCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/UploadMultipartPartCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/UploadMultipartPartCommandOutput/) + +
+
+ +Predict + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/PredictCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PredictCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/PredictCommandOutput/) + +
+
+ +DeleteObjectTagging + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DeleteObjectTaggingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DeleteObjectTaggingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DeleteObjectTaggingCommandOutput/) + +
+
+ +GetBucketLocation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GetBucketLocationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GetBucketLocationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GetBucketLocationCommandOutput/) + +
+
+ +GetObject + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GetObjectCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GetObjectCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GetObjectCommandOutput/) + +
+
+ +ListObjectsV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/ListObjectsV2Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ListObjectsV2CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/ListObjectsV2CommandOutput/) + +
+
+ +EmptyInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/EmptyInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/EmptyInputOutputCommandOutput/) + +
+
+ +Float16 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/Float16Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/Float16CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/Float16CommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +NoInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/NoInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/NoInputOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OptionalInputOutputCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +RpcV2CborDenseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RpcV2CborDenseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RpcV2CborDenseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RpcV2CborDenseMapsCommandOutput/) + +
+
+ +RpcV2CborLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RpcV2CborListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RpcV2CborListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RpcV2CborListsCommandOutput/) + +
+
+ +RpcV2CborSparseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/RpcV2CborSparseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RpcV2CborSparseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/RpcV2CborSparseMapsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/SparseNullsOperationCommandOutput/) + +
diff --git a/private/aws-protocoltests-query-schema/api-extractor.json b/private/aws-protocoltests-query-schema/api-extractor.json new file mode 100644 index 0000000000000..d5bf5ffeee851 --- /dev/null +++ b/private/aws-protocoltests-query-schema/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/private/aws-protocoltests-query-schema/package.json b/private/aws-protocoltests-query-schema/package.json new file mode 100644 index 0000000000000..3231b408ab22f --- /dev/null +++ b/private/aws-protocoltests-query-schema/package.json @@ -0,0 +1,104 @@ +{ + "name": "@aws-sdk/aws-protocoltests-query-schema", + "description": "@aws-sdk/aws-protocoltests-query-schema client", + "version": "1.0.0-alpha.1", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "test": "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.5.2", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-compression": "^4.1.10", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.10", + "@smithy/middleware-retry": "^4.1.11", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.2", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.18", + "@smithy/util-defaults-mode-node": "^4.0.18", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "@smithy/util-utf8": "^4.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@tsconfig/node18": "18.2.4", + "@types/node": "^18.19.69", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~5.8.3", + "vitest": "2.1.8" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "private": true, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-protocoltests-query-schema", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/aws-protocoltests-query-schema" + } +} diff --git a/private/aws-protocoltests-query-schema/src/QueryProtocol.ts b/private/aws-protocoltests-query-schema/src/QueryProtocol.ts new file mode 100644 index 0000000000000..579fb3dc63a5a --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/QueryProtocol.ts @@ -0,0 +1,696 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + DatetimeOffsetsCommand, + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, +} from "./commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommand, + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { + EndpointOperationCommand, + EndpointOperationCommandInput, + EndpointOperationCommandOutput, +} from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommand, + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { + FlattenedXmlMapCommand, + FlattenedXmlMapCommandInput, + FlattenedXmlMapCommandOutput, +} from "./commands/FlattenedXmlMapCommand"; +import { + FlattenedXmlMapWithXmlNameCommand, + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNameCommand"; +import { + FlattenedXmlMapWithXmlNamespaceCommand, + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { + FractionalSecondsCommand, + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, +} from "./commands/FractionalSecondsCommand"; +import { + GreetingWithErrorsCommand, + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, +} from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommand, + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { + IgnoresWrappingXmlNameCommand, + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, +} from "./commands/IgnoresWrappingXmlNameCommand"; +import { + NestedStructuresCommand, + NestedStructuresCommandInput, + NestedStructuresCommandOutput, +} from "./commands/NestedStructuresCommand"; +import { + NoInputAndNoOutputCommand, + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, +} from "./commands/NoInputAndNoOutputCommand"; +import { + NoInputAndOutputCommand, + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, +} from "./commands/NoInputAndOutputCommand"; +import { + PutWithContentEncodingCommand, + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommand, + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommand, QueryListsCommandInput, QueryListsCommandOutput } from "./commands/QueryListsCommand"; +import { QueryMapsCommand, QueryMapsCommandInput, QueryMapsCommandOutput } from "./commands/QueryMapsCommand"; +import { + QueryTimestampsCommand, + QueryTimestampsCommandInput, + QueryTimestampsCommandOutput, +} from "./commands/QueryTimestampsCommand"; +import { + RecursiveXmlShapesCommand, + RecursiveXmlShapesCommandInput, + RecursiveXmlShapesCommandOutput, +} from "./commands/RecursiveXmlShapesCommand"; +import { + SimpleInputParamsCommand, + SimpleInputParamsCommandInput, + SimpleInputParamsCommandOutput, +} from "./commands/SimpleInputParamsCommand"; +import { + SimpleScalarXmlPropertiesCommand, + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, +} from "./commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommand, XmlBlobsCommandInput, XmlBlobsCommandOutput } from "./commands/XmlBlobsCommand"; +import { + XmlEmptyBlobsCommand, + XmlEmptyBlobsCommandInput, + XmlEmptyBlobsCommandOutput, +} from "./commands/XmlEmptyBlobsCommand"; +import { + XmlEmptyListsCommand, + XmlEmptyListsCommandInput, + XmlEmptyListsCommandOutput, +} from "./commands/XmlEmptyListsCommand"; +import { + XmlEmptyMapsCommand, + XmlEmptyMapsCommandInput, + XmlEmptyMapsCommandOutput, +} from "./commands/XmlEmptyMapsCommand"; +import { XmlEnumsCommand, XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand"; +import { XmlIntEnumsCommand, XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand"; +import { XmlListsCommand, XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand"; +import { XmlMapsCommand, XmlMapsCommandInput, XmlMapsCommandOutput } from "./commands/XmlMapsCommand"; +import { + XmlMapsXmlNameCommand, + XmlMapsXmlNameCommandInput, + XmlMapsXmlNameCommandOutput, +} from "./commands/XmlMapsXmlNameCommand"; +import { + XmlNamespacesCommand, + XmlNamespacesCommandInput, + XmlNamespacesCommandOutput, +} from "./commands/XmlNamespacesCommand"; +import { + XmlTimestampsCommand, + XmlTimestampsCommandInput, + XmlTimestampsCommandOutput, +} from "./commands/XmlTimestampsCommand"; +import { QueryProtocolClient, QueryProtocolClientConfig } from "./QueryProtocolClient"; + +const commands = { + DatetimeOffsetsCommand, + EmptyInputAndEmptyOutputCommand, + EndpointOperationCommand, + EndpointWithHostLabelOperationCommand, + FlattenedXmlMapCommand, + FlattenedXmlMapWithXmlNameCommand, + FlattenedXmlMapWithXmlNamespaceCommand, + FractionalSecondsCommand, + GreetingWithErrorsCommand, + HostWithPathOperationCommand, + IgnoresWrappingXmlNameCommand, + NestedStructuresCommand, + NoInputAndNoOutputCommand, + NoInputAndOutputCommand, + PutWithContentEncodingCommand, + QueryIdempotencyTokenAutoFillCommand, + QueryListsCommand, + QueryMapsCommand, + QueryTimestampsCommand, + RecursiveXmlShapesCommand, + SimpleInputParamsCommand, + SimpleScalarXmlPropertiesCommand, + XmlBlobsCommand, + XmlEmptyBlobsCommand, + XmlEmptyListsCommand, + XmlEmptyMapsCommand, + XmlEnumsCommand, + XmlIntEnumsCommand, + XmlListsCommand, + XmlMapsCommand, + XmlMapsXmlNameCommand, + XmlNamespacesCommand, + XmlTimestampsCommand, +}; + +export interface QueryProtocol { + /** + * @see {@link DatetimeOffsetsCommand} + */ + datetimeOffsets(): Promise; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + datetimeOffsets(args: DatetimeOffsetsCommandInput, cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void): void; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void + ): void; + + /** + * @see {@link EmptyInputAndEmptyOutputCommand} + */ + emptyInputAndEmptyOutput(): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + + /** + * @see {@link EndpointOperationCommand} + */ + endpointOperation(): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + endpointOperation( + args: EndpointOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointWithHostLabelOperationCommand} + */ + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + + /** + * @see {@link FlattenedXmlMapCommand} + */ + flattenedXmlMap(): Promise; + flattenedXmlMap( + args: FlattenedXmlMapCommandInput, + options?: __HttpHandlerOptions + ): Promise; + flattenedXmlMap(args: FlattenedXmlMapCommandInput, cb: (err: any, data?: FlattenedXmlMapCommandOutput) => void): void; + flattenedXmlMap( + args: FlattenedXmlMapCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FlattenedXmlMapCommandOutput) => void + ): void; + + /** + * @see {@link FlattenedXmlMapWithXmlNameCommand} + */ + flattenedXmlMapWithXmlName(): Promise; + flattenedXmlMapWithXmlName( + args: FlattenedXmlMapWithXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + flattenedXmlMapWithXmlName( + args: FlattenedXmlMapWithXmlNameCommandInput, + cb: (err: any, data?: FlattenedXmlMapWithXmlNameCommandOutput) => void + ): void; + flattenedXmlMapWithXmlName( + args: FlattenedXmlMapWithXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FlattenedXmlMapWithXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link FlattenedXmlMapWithXmlNamespaceCommand} + */ + flattenedXmlMapWithXmlNamespace(): Promise; + flattenedXmlMapWithXmlNamespace( + args: FlattenedXmlMapWithXmlNamespaceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + flattenedXmlMapWithXmlNamespace( + args: FlattenedXmlMapWithXmlNamespaceCommandInput, + cb: (err: any, data?: FlattenedXmlMapWithXmlNamespaceCommandOutput) => void + ): void; + flattenedXmlMapWithXmlNamespace( + args: FlattenedXmlMapWithXmlNamespaceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FlattenedXmlMapWithXmlNamespaceCommandOutput) => void + ): void; + + /** + * @see {@link FractionalSecondsCommand} + */ + fractionalSeconds(): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + + /** + * @see {@link GreetingWithErrorsCommand} + */ + greetingWithErrors(): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + + /** + * @see {@link HostWithPathOperationCommand} + */ + hostWithPathOperation(): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + + /** + * @see {@link IgnoresWrappingXmlNameCommand} + */ + ignoresWrappingXmlName(): Promise; + ignoresWrappingXmlName( + args: IgnoresWrappingXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + ignoresWrappingXmlName( + args: IgnoresWrappingXmlNameCommandInput, + cb: (err: any, data?: IgnoresWrappingXmlNameCommandOutput) => void + ): void; + ignoresWrappingXmlName( + args: IgnoresWrappingXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: IgnoresWrappingXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link NestedStructuresCommand} + */ + nestedStructures(): Promise; + nestedStructures( + args: NestedStructuresCommandInput, + options?: __HttpHandlerOptions + ): Promise; + nestedStructures( + args: NestedStructuresCommandInput, + cb: (err: any, data?: NestedStructuresCommandOutput) => void + ): void; + nestedStructures( + args: NestedStructuresCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NestedStructuresCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndNoOutputCommand} + */ + noInputAndNoOutput(): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndOutputCommand} + */ + noInputAndOutput(): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + + /** + * @see {@link PutWithContentEncodingCommand} + */ + putWithContentEncoding(): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + + /** + * @see {@link QueryIdempotencyTokenAutoFillCommand} + */ + queryIdempotencyTokenAutoFill(): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + + /** + * @see {@link QueryListsCommand} + */ + queryLists(): Promise; + queryLists(args: QueryListsCommandInput, options?: __HttpHandlerOptions): Promise; + queryLists(args: QueryListsCommandInput, cb: (err: any, data?: QueryListsCommandOutput) => void): void; + queryLists( + args: QueryListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryListsCommandOutput) => void + ): void; + + /** + * @see {@link QueryMapsCommand} + */ + queryMaps(): Promise; + queryMaps(args: QueryMapsCommandInput, options?: __HttpHandlerOptions): Promise; + queryMaps(args: QueryMapsCommandInput, cb: (err: any, data?: QueryMapsCommandOutput) => void): void; + queryMaps( + args: QueryMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryMapsCommandOutput) => void + ): void; + + /** + * @see {@link QueryTimestampsCommand} + */ + queryTimestamps(): Promise; + queryTimestamps( + args: QueryTimestampsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryTimestamps(args: QueryTimestampsCommandInput, cb: (err: any, data?: QueryTimestampsCommandOutput) => void): void; + queryTimestamps( + args: QueryTimestampsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryTimestampsCommandOutput) => void + ): void; + + /** + * @see {@link RecursiveXmlShapesCommand} + */ + recursiveXmlShapes(): Promise; + recursiveXmlShapes( + args: RecursiveXmlShapesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + recursiveXmlShapes( + args: RecursiveXmlShapesCommandInput, + cb: (err: any, data?: RecursiveXmlShapesCommandOutput) => void + ): void; + recursiveXmlShapes( + args: RecursiveXmlShapesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RecursiveXmlShapesCommandOutput) => void + ): void; + + /** + * @see {@link SimpleInputParamsCommand} + */ + simpleInputParams(): Promise; + simpleInputParams( + args: SimpleInputParamsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleInputParams( + args: SimpleInputParamsCommandInput, + cb: (err: any, data?: SimpleInputParamsCommandOutput) => void + ): void; + simpleInputParams( + args: SimpleInputParamsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleInputParamsCommandOutput) => void + ): void; + + /** + * @see {@link SimpleScalarXmlPropertiesCommand} + */ + simpleScalarXmlProperties(): Promise; + simpleScalarXmlProperties( + args: SimpleScalarXmlPropertiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleScalarXmlProperties( + args: SimpleScalarXmlPropertiesCommandInput, + cb: (err: any, data?: SimpleScalarXmlPropertiesCommandOutput) => void + ): void; + simpleScalarXmlProperties( + args: SimpleScalarXmlPropertiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleScalarXmlPropertiesCommandOutput) => void + ): void; + + /** + * @see {@link XmlBlobsCommand} + */ + xmlBlobs(): Promise; + xmlBlobs(args: XmlBlobsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlBlobs(args: XmlBlobsCommandInput, cb: (err: any, data?: XmlBlobsCommandOutput) => void): void; + xmlBlobs( + args: XmlBlobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlBlobsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyBlobsCommand} + */ + xmlEmptyBlobs(): Promise; + xmlEmptyBlobs(args: XmlEmptyBlobsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyBlobs(args: XmlEmptyBlobsCommandInput, cb: (err: any, data?: XmlEmptyBlobsCommandOutput) => void): void; + xmlEmptyBlobs( + args: XmlEmptyBlobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyBlobsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyListsCommand} + */ + xmlEmptyLists(): Promise; + xmlEmptyLists(args: XmlEmptyListsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyLists(args: XmlEmptyListsCommandInput, cb: (err: any, data?: XmlEmptyListsCommandOutput) => void): void; + xmlEmptyLists( + args: XmlEmptyListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyListsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyMapsCommand} + */ + xmlEmptyMaps(): Promise; + xmlEmptyMaps(args: XmlEmptyMapsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyMaps(args: XmlEmptyMapsCommandInput, cb: (err: any, data?: XmlEmptyMapsCommandOutput) => void): void; + xmlEmptyMaps( + args: XmlEmptyMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyMapsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEnumsCommand} + */ + xmlEnums(): Promise; + xmlEnums(args: XmlEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEnums(args: XmlEnumsCommandInput, cb: (err: any, data?: XmlEnumsCommandOutput) => void): void; + xmlEnums( + args: XmlEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEnumsCommandOutput) => void + ): void; + + /** + * @see {@link XmlIntEnumsCommand} + */ + xmlIntEnums(): Promise; + xmlIntEnums(args: XmlIntEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlIntEnums(args: XmlIntEnumsCommandInput, cb: (err: any, data?: XmlIntEnumsCommandOutput) => void): void; + xmlIntEnums( + args: XmlIntEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlIntEnumsCommandOutput) => void + ): void; + + /** + * @see {@link XmlListsCommand} + */ + xmlLists(): Promise; + xmlLists(args: XmlListsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlLists(args: XmlListsCommandInput, cb: (err: any, data?: XmlListsCommandOutput) => void): void; + xmlLists( + args: XmlListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlListsCommandOutput) => void + ): void; + + /** + * @see {@link XmlMapsCommand} + */ + xmlMaps(): Promise; + xmlMaps(args: XmlMapsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlMaps(args: XmlMapsCommandInput, cb: (err: any, data?: XmlMapsCommandOutput) => void): void; + xmlMaps( + args: XmlMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlMapsCommandOutput) => void + ): void; + + /** + * @see {@link XmlMapsXmlNameCommand} + */ + xmlMapsXmlName(): Promise; + xmlMapsXmlName( + args: XmlMapsXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + xmlMapsXmlName(args: XmlMapsXmlNameCommandInput, cb: (err: any, data?: XmlMapsXmlNameCommandOutput) => void): void; + xmlMapsXmlName( + args: XmlMapsXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlMapsXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link XmlNamespacesCommand} + */ + xmlNamespaces(): Promise; + xmlNamespaces(args: XmlNamespacesCommandInput, options?: __HttpHandlerOptions): Promise; + xmlNamespaces(args: XmlNamespacesCommandInput, cb: (err: any, data?: XmlNamespacesCommandOutput) => void): void; + xmlNamespaces( + args: XmlNamespacesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlNamespacesCommandOutput) => void + ): void; + + /** + * @see {@link XmlTimestampsCommand} + */ + xmlTimestamps(): Promise; + xmlTimestamps(args: XmlTimestampsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlTimestamps(args: XmlTimestampsCommandInput, cb: (err: any, data?: XmlTimestampsCommandOutput) => void): void; + xmlTimestamps( + args: XmlTimestampsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlTimestampsCommandOutput) => void + ): void; +} + +/** + * A query service that sends query requests and XML responses. + * @public + */ +export class QueryProtocol extends QueryProtocolClient implements QueryProtocol {} +createAggregatedClient(commands, QueryProtocol); diff --git a/private/aws-protocoltests-query-schema/src/QueryProtocolClient.ts b/private/aws-protocoltests-query-schema/src/QueryProtocolClient.ts new file mode 100644 index 0000000000000..e6520331aa24f --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/QueryProtocolClient.ts @@ -0,0 +1,470 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + ClientProtocol, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + HttpRequest, + HttpResponse, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + defaultQueryProtocolHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "./commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommandInput, FlattenedXmlMapCommandOutput } from "./commands/FlattenedXmlMapCommand"; +import { + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNameCommand"; +import { + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "./commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, +} from "./commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommandInput, NestedStructuresCommandOutput } from "./commands/NestedStructuresCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "./commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "./commands/NoInputAndOutputCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommandInput, QueryListsCommandOutput } from "./commands/QueryListsCommand"; +import { QueryMapsCommandInput, QueryMapsCommandOutput } from "./commands/QueryMapsCommand"; +import { QueryTimestampsCommandInput, QueryTimestampsCommandOutput } from "./commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommandInput, RecursiveXmlShapesCommandOutput } from "./commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommandInput, SimpleInputParamsCommandOutput } from "./commands/SimpleInputParamsCommand"; +import { + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, +} from "./commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommandInput, XmlBlobsCommandOutput } from "./commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommandInput, XmlEmptyBlobsCommandOutput } from "./commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommandInput, XmlEmptyListsCommandOutput } from "./commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommandInput, XmlEmptyMapsCommandOutput } from "./commands/XmlEmptyMapsCommand"; +import { XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand"; +import { XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand"; +import { XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand"; +import { XmlMapsCommandInput, XmlMapsCommandOutput } from "./commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommandInput, XmlMapsXmlNameCommandOutput } from "./commands/XmlMapsXmlNameCommand"; +import { XmlNamespacesCommandInput, XmlNamespacesCommandOutput } from "./commands/XmlNamespacesCommand"; +import { XmlTimestampsCommandInput, XmlTimestampsCommandOutput } from "./commands/XmlTimestampsCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | DatetimeOffsetsCommandInput + | EmptyInputAndEmptyOutputCommandInput + | EndpointOperationCommandInput + | EndpointWithHostLabelOperationCommandInput + | FlattenedXmlMapCommandInput + | FlattenedXmlMapWithXmlNameCommandInput + | FlattenedXmlMapWithXmlNamespaceCommandInput + | FractionalSecondsCommandInput + | GreetingWithErrorsCommandInput + | HostWithPathOperationCommandInput + | IgnoresWrappingXmlNameCommandInput + | NestedStructuresCommandInput + | NoInputAndNoOutputCommandInput + | NoInputAndOutputCommandInput + | PutWithContentEncodingCommandInput + | QueryIdempotencyTokenAutoFillCommandInput + | QueryListsCommandInput + | QueryMapsCommandInput + | QueryTimestampsCommandInput + | RecursiveXmlShapesCommandInput + | SimpleInputParamsCommandInput + | SimpleScalarXmlPropertiesCommandInput + | XmlBlobsCommandInput + | XmlEmptyBlobsCommandInput + | XmlEmptyListsCommandInput + | XmlEmptyMapsCommandInput + | XmlEnumsCommandInput + | XmlIntEnumsCommandInput + | XmlListsCommandInput + | XmlMapsCommandInput + | XmlMapsXmlNameCommandInput + | XmlNamespacesCommandInput + | XmlTimestampsCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | DatetimeOffsetsCommandOutput + | EmptyInputAndEmptyOutputCommandOutput + | EndpointOperationCommandOutput + | EndpointWithHostLabelOperationCommandOutput + | FlattenedXmlMapCommandOutput + | FlattenedXmlMapWithXmlNameCommandOutput + | FlattenedXmlMapWithXmlNamespaceCommandOutput + | FractionalSecondsCommandOutput + | GreetingWithErrorsCommandOutput + | HostWithPathOperationCommandOutput + | IgnoresWrappingXmlNameCommandOutput + | NestedStructuresCommandOutput + | NoInputAndNoOutputCommandOutput + | NoInputAndOutputCommandOutput + | PutWithContentEncodingCommandOutput + | QueryIdempotencyTokenAutoFillCommandOutput + | QueryListsCommandOutput + | QueryMapsCommandOutput + | QueryTimestampsCommandOutput + | RecursiveXmlShapesCommandOutput + | SimpleInputParamsCommandOutput + | SimpleScalarXmlPropertiesCommandOutput + | XmlBlobsCommandOutput + | XmlEmptyBlobsCommandOutput + | XmlEmptyListsCommandOutput + | XmlEmptyMapsCommandOutput + | XmlEnumsCommandOutput + | XmlIntEnumsCommandOutput + | XmlListsCommandOutput + | XmlMapsCommandOutput + | XmlMapsXmlNameCommandOutput + | XmlNamespacesCommandOutput + | XmlTimestampsCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON) + * may be overridden. A default will always be set by the client. + * Available options depend on the service's supported protocols and will not be validated by + * the client. + * @alpha + * + */ + protocol?: ClientProtocol; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type QueryProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + CompressionInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of QueryProtocolClient class constructor that set the region, credentials and other options. + */ +export interface QueryProtocolClientConfig extends QueryProtocolClientConfigType {} + +/** + * @public + */ +export type QueryProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + CompressionResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of QueryProtocolClient class. This is resolved and normalized from the {@link QueryProtocolClientConfig | constructor configuration interface}. + */ +export interface QueryProtocolClientResolvedConfig extends QueryProtocolClientResolvedConfigType {} + +/** + * A query service that sends query requests and XML responses. + * @public + */ +export class QueryProtocolClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + QueryProtocolClientResolvedConfig +> { + /** + * The resolved configuration of QueryProtocolClient class. This is resolved and normalized from the {@link QueryProtocolClientConfig | constructor configuration interface}. + */ + readonly config: QueryProtocolClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + super(_config_0 as any); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveCompressionConfig(_config_7); + const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []); + this.config = _config_9; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultQueryProtocolHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: QueryProtocolClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/private/aws-protocoltests-query-schema/src/auth/httpAuthExtensionConfiguration.ts b/private/aws-protocoltests-query-schema/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 0000000000000..adf0277643422 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { QueryProtocolHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: QueryProtocolHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): QueryProtocolHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: QueryProtocolHttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: QueryProtocolHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): QueryProtocolHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/private/aws-protocoltests-query-schema/src/auth/httpAuthSchemeProvider.ts b/private/aws-protocoltests-query-schema/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 0000000000000..78b86390b6ff3 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,155 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, + Provider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { QueryProtocolClientConfig, QueryProtocolClientResolvedConfig } from "../QueryProtocolClient"; + +/** + * @internal + */ +export interface QueryProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface QueryProtocolHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + QueryProtocolClientResolvedConfig, + HandlerExecutionContext, + QueryProtocolHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultQueryProtocolHttpAuthSchemeParametersProvider = async ( + config: QueryProtocolClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption(authParameters: QueryProtocolHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "awsquery", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface QueryProtocolHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultQueryProtocolHttpAuthSchemeProvider: QueryProtocolHttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + authSchemePreference?: string[] | Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: QueryProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + readonly authSchemePreference: Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: QueryProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), + }) as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/private/aws-protocoltests-query-schema/src/commands/DatetimeOffsetsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/DatetimeOffsetsCommand.ts new file mode 100644 index 0000000000000..dacf9cd7ebdcc --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/DatetimeOffsetsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DatetimeOffsetsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { DatetimeOffsets } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandInput {} +/** + * @public + * + * The output of {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandOutput extends DatetimeOffsetsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, DatetimeOffsetsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, DatetimeOffsetsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new DatetimeOffsetsCommand(input); + * const response = await client.send(command); + * // { // DatetimeOffsetsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param DatetimeOffsetsCommandInput - {@link DatetimeOffsetsCommandInput} + * @returns {@link DatetimeOffsetsCommandOutput} + * @see {@link DatetimeOffsetsCommandInput} for command's `input` shape. + * @see {@link DatetimeOffsetsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class DatetimeOffsetsCommand extends $Command + .classBuilder< + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "DatetimeOffsets", {}) + .n("QueryProtocolClient", "DatetimeOffsetsCommand") + .f(void 0, void 0) + .sc(DatetimeOffsets) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: DatetimeOffsetsOutput; + }; + sdk: { + input: DatetimeOffsetsCommandInput; + output: DatetimeOffsetsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts b/private/aws-protocoltests-query-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts new file mode 100644 index 0000000000000..8e66cc8d8750d --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { EmptyInputAndEmptyOutputInput, EmptyInputAndEmptyOutputOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { EmptyInputAndEmptyOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandInput extends EmptyInputAndEmptyOutputInput {} +/** + * @public + * + * The output of {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandOutput extends EmptyInputAndEmptyOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response members. + * + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, EmptyInputAndEmptyOutputCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, EmptyInputAndEmptyOutputCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new EmptyInputAndEmptyOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EmptyInputAndEmptyOutputCommandInput - {@link EmptyInputAndEmptyOutputCommandInput} + * @returns {@link EmptyInputAndEmptyOutputCommandOutput} + * @see {@link EmptyInputAndEmptyOutputCommandInput} for command's `input` shape. + * @see {@link EmptyInputAndEmptyOutputCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class EmptyInputAndEmptyOutputCommand extends $Command + .classBuilder< + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "EmptyInputAndEmptyOutput", {}) + .n("QueryProtocolClient", "EmptyInputAndEmptyOutputCommand") + .f(void 0, void 0) + .sc(EmptyInputAndEmptyOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EmptyInputAndEmptyOutputCommandInput; + output: EmptyInputAndEmptyOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/EndpointOperationCommand.ts b/private/aws-protocoltests-query-schema/src/commands/EndpointOperationCommand.ts new file mode 100644 index 0000000000000..60e07bb1a22b9 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/EndpointOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { EndpointOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandInput {} +/** + * @public + * + * The output of {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, EndpointOperationCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, EndpointOperationCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new EndpointOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointOperationCommandInput - {@link EndpointOperationCommandInput} + * @returns {@link EndpointOperationCommandOutput} + * @see {@link EndpointOperationCommandInput} for command's `input` shape. + * @see {@link EndpointOperationCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class EndpointOperationCommand extends $Command + .classBuilder< + EndpointOperationCommandInput, + EndpointOperationCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "EndpointOperation", {}) + .n("QueryProtocolClient", "EndpointOperationCommand") + .f(void 0, void 0) + .sc(EndpointOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EndpointOperationCommandInput; + output: EndpointOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/EndpointWithHostLabelOperationCommand.ts b/private/aws-protocoltests-query-schema/src/commands/EndpointWithHostLabelOperationCommand.ts new file mode 100644 index 0000000000000..081ea3a330ae0 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/EndpointWithHostLabelOperationCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HostLabelInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { EndpointWithHostLabelOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandInput extends HostLabelInput {} +/** + * @public + * + * The output of {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, EndpointWithHostLabelOperationCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, EndpointWithHostLabelOperationCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // HostLabelInput + * label: "STRING_VALUE", // required + * }; + * const command = new EndpointWithHostLabelOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointWithHostLabelOperationCommandInput - {@link EndpointWithHostLabelOperationCommandInput} + * @returns {@link EndpointWithHostLabelOperationCommandOutput} + * @see {@link EndpointWithHostLabelOperationCommandInput} for command's `input` shape. + * @see {@link EndpointWithHostLabelOperationCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class EndpointWithHostLabelOperationCommand extends $Command + .classBuilder< + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "EndpointWithHostLabelOperation", {}) + .n("QueryProtocolClient", "EndpointWithHostLabelOperationCommand") + .f(void 0, void 0) + .sc(EndpointWithHostLabelOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HostLabelInput; + output: {}; + }; + sdk: { + input: EndpointWithHostLabelOperationCommandInput; + output: EndpointWithHostLabelOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapCommand.ts b/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapCommand.ts new file mode 100644 index 0000000000000..c96f42d1f11ee --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FlattenedXmlMapOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { FlattenedXmlMap } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FlattenedXmlMapCommand}. + */ +export interface FlattenedXmlMapCommandInput {} +/** + * @public + * + * The output of {@link FlattenedXmlMapCommand}. + */ +export interface FlattenedXmlMapCommandOutput extends FlattenedXmlMapOutput, __MetadataBearer {} + +/** + * Flattened maps + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, FlattenedXmlMapCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, FlattenedXmlMapCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new FlattenedXmlMapCommand(input); + * const response = await client.send(command); + * // { // FlattenedXmlMapOutput + * // myMap: { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }; + * + * ``` + * + * @param FlattenedXmlMapCommandInput - {@link FlattenedXmlMapCommandInput} + * @returns {@link FlattenedXmlMapCommandOutput} + * @see {@link FlattenedXmlMapCommandInput} for command's `input` shape. + * @see {@link FlattenedXmlMapCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class FlattenedXmlMapCommand extends $Command + .classBuilder< + FlattenedXmlMapCommandInput, + FlattenedXmlMapCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "FlattenedXmlMap", {}) + .n("QueryProtocolClient", "FlattenedXmlMapCommand") + .f(void 0, void 0) + .sc(FlattenedXmlMap) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FlattenedXmlMapOutput; + }; + sdk: { + input: FlattenedXmlMapCommandInput; + output: FlattenedXmlMapCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapWithXmlNameCommand.ts b/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapWithXmlNameCommand.ts new file mode 100644 index 0000000000000..8f28aba053461 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapWithXmlNameCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FlattenedXmlMapWithXmlNameOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { FlattenedXmlMapWithXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FlattenedXmlMapWithXmlNameCommand}. + */ +export interface FlattenedXmlMapWithXmlNameCommandInput {} +/** + * @public + * + * The output of {@link FlattenedXmlMapWithXmlNameCommand}. + */ +export interface FlattenedXmlMapWithXmlNameCommandOutput extends FlattenedXmlMapWithXmlNameOutput, __MetadataBearer {} + +/** + * Flattened maps with @xmlName + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, FlattenedXmlMapWithXmlNameCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, FlattenedXmlMapWithXmlNameCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new FlattenedXmlMapWithXmlNameCommand(input); + * const response = await client.send(command); + * // { // FlattenedXmlMapWithXmlNameOutput + * // myMap: { // FlattenedXmlMapWithXmlNameOutputMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param FlattenedXmlMapWithXmlNameCommandInput - {@link FlattenedXmlMapWithXmlNameCommandInput} + * @returns {@link FlattenedXmlMapWithXmlNameCommandOutput} + * @see {@link FlattenedXmlMapWithXmlNameCommandInput} for command's `input` shape. + * @see {@link FlattenedXmlMapWithXmlNameCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class FlattenedXmlMapWithXmlNameCommand extends $Command + .classBuilder< + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "FlattenedXmlMapWithXmlName", {}) + .n("QueryProtocolClient", "FlattenedXmlMapWithXmlNameCommand") + .f(void 0, void 0) + .sc(FlattenedXmlMapWithXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FlattenedXmlMapWithXmlNameOutput; + }; + sdk: { + input: FlattenedXmlMapWithXmlNameCommandInput; + output: FlattenedXmlMapWithXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts b/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts new file mode 100644 index 0000000000000..96ae4c1c0f0be --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FlattenedXmlMapWithXmlNamespaceOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { FlattenedXmlMapWithXmlNamespace } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FlattenedXmlMapWithXmlNamespaceCommand}. + */ +export interface FlattenedXmlMapWithXmlNamespaceCommandInput {} +/** + * @public + * + * The output of {@link FlattenedXmlMapWithXmlNamespaceCommand}. + */ +export interface FlattenedXmlMapWithXmlNamespaceCommandOutput + extends FlattenedXmlMapWithXmlNamespaceOutput, + __MetadataBearer {} + +/** + * Flattened maps with @xmlNamespace and @xmlName + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, FlattenedXmlMapWithXmlNamespaceCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, FlattenedXmlMapWithXmlNamespaceCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new FlattenedXmlMapWithXmlNamespaceCommand(input); + * const response = await client.send(command); + * // { // FlattenedXmlMapWithXmlNamespaceOutput + * // myMap: { // FlattenedXmlMapWithXmlNamespaceOutputMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param FlattenedXmlMapWithXmlNamespaceCommandInput - {@link FlattenedXmlMapWithXmlNamespaceCommandInput} + * @returns {@link FlattenedXmlMapWithXmlNamespaceCommandOutput} + * @see {@link FlattenedXmlMapWithXmlNamespaceCommandInput} for command's `input` shape. + * @see {@link FlattenedXmlMapWithXmlNamespaceCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class FlattenedXmlMapWithXmlNamespaceCommand extends $Command + .classBuilder< + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "FlattenedXmlMapWithXmlNamespace", {}) + .n("QueryProtocolClient", "FlattenedXmlMapWithXmlNamespaceCommand") + .f(void 0, void 0) + .sc(FlattenedXmlMapWithXmlNamespace) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FlattenedXmlMapWithXmlNamespaceOutput; + }; + sdk: { + input: FlattenedXmlMapWithXmlNamespaceCommandInput; + output: FlattenedXmlMapWithXmlNamespaceCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/FractionalSecondsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/FractionalSecondsCommand.ts new file mode 100644 index 0000000000000..75feb81b9e2a2 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/FractionalSecondsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FractionalSecondsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { FractionalSeconds } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandInput {} +/** + * @public + * + * The output of {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, FractionalSecondsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, FractionalSecondsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new FractionalSecondsCommand(input); + * const response = await client.send(command); + * // { // FractionalSecondsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput} + * @returns {@link FractionalSecondsCommandOutput} + * @see {@link FractionalSecondsCommandInput} for command's `input` shape. + * @see {@link FractionalSecondsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class FractionalSecondsCommand extends $Command + .classBuilder< + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "FractionalSeconds", {}) + .n("QueryProtocolClient", "FractionalSecondsCommand") + .f(void 0, void 0) + .sc(FractionalSeconds) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FractionalSecondsOutput; + }; + sdk: { + input: FractionalSecondsCommandInput; + output: FractionalSecondsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/GreetingWithErrorsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/GreetingWithErrorsCommand.ts new file mode 100644 index 0000000000000..9cfdb436da1ae --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/GreetingWithErrorsCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { GreetingWithErrorsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { GreetingWithErrors } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandInput {} +/** + * @public + * + * The output of {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {} + +/** + * This operation has three possible return values: + * + * 1. A successful response in the form of GreetingWithErrorsOutput + * 2. An InvalidGreeting error. + * 3. A BadRequest error. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, GreetingWithErrorsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, GreetingWithErrorsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new GreetingWithErrorsCommand(input); + * const response = await client.send(command); + * // { // GreetingWithErrorsOutput + * // greeting: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput} + * @returns {@link GreetingWithErrorsCommandOutput} + * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape. + * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link InvalidGreeting} (client fault) + * This error is thrown when an invalid greeting value is provided. + * + * @throws {@link ComplexError} (client fault) + * This error is thrown when a request is invalid. + * + * @throws {@link CustomCodeError} (client fault) + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class GreetingWithErrorsCommand extends $Command + .classBuilder< + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "GreetingWithErrors", {}) + .n("QueryProtocolClient", "GreetingWithErrorsCommand") + .f(void 0, void 0) + .sc(GreetingWithErrors) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: GreetingWithErrorsOutput; + }; + sdk: { + input: GreetingWithErrorsCommandInput; + output: GreetingWithErrorsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/HostWithPathOperationCommand.ts b/private/aws-protocoltests-query-schema/src/commands/HostWithPathOperationCommand.ts new file mode 100644 index 0000000000000..c320c83d4a6c6 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/HostWithPathOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { HostWithPathOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandInput {} +/** + * @public + * + * The output of {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, HostWithPathOperationCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, HostWithPathOperationCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new HostWithPathOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HostWithPathOperationCommandInput - {@link HostWithPathOperationCommandInput} + * @returns {@link HostWithPathOperationCommandOutput} + * @see {@link HostWithPathOperationCommandInput} for command's `input` shape. + * @see {@link HostWithPathOperationCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class HostWithPathOperationCommand extends $Command + .classBuilder< + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "HostWithPathOperation", {}) + .n("QueryProtocolClient", "HostWithPathOperationCommand") + .f(void 0, void 0) + .sc(HostWithPathOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: HostWithPathOperationCommandInput; + output: HostWithPathOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/IgnoresWrappingXmlNameCommand.ts b/private/aws-protocoltests-query-schema/src/commands/IgnoresWrappingXmlNameCommand.ts new file mode 100644 index 0000000000000..70e7cbeca92f0 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/IgnoresWrappingXmlNameCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { IgnoresWrappingXmlNameOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { IgnoresWrappingXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link IgnoresWrappingXmlNameCommand}. + */ +export interface IgnoresWrappingXmlNameCommandInput {} +/** + * @public + * + * The output of {@link IgnoresWrappingXmlNameCommand}. + */ +export interface IgnoresWrappingXmlNameCommandOutput extends IgnoresWrappingXmlNameOutput, __MetadataBearer {} + +/** + * The xmlName trait on the output structure is ignored in AWS Query. + * + * The wrapping element is always operation name + "Response", and + * inside of that wrapper is another wrapper named operation name + "Result". + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, IgnoresWrappingXmlNameCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, IgnoresWrappingXmlNameCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new IgnoresWrappingXmlNameCommand(input); + * const response = await client.send(command); + * // { // IgnoresWrappingXmlNameOutput + * // foo: "STRING_VALUE", + * // }; + * + * ``` + * + * @param IgnoresWrappingXmlNameCommandInput - {@link IgnoresWrappingXmlNameCommandInput} + * @returns {@link IgnoresWrappingXmlNameCommandOutput} + * @see {@link IgnoresWrappingXmlNameCommandInput} for command's `input` shape. + * @see {@link IgnoresWrappingXmlNameCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class IgnoresWrappingXmlNameCommand extends $Command + .classBuilder< + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "IgnoresWrappingXmlName", {}) + .n("QueryProtocolClient", "IgnoresWrappingXmlNameCommand") + .f(void 0, void 0) + .sc(IgnoresWrappingXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: IgnoresWrappingXmlNameOutput; + }; + sdk: { + input: IgnoresWrappingXmlNameCommandInput; + output: IgnoresWrappingXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/NestedStructuresCommand.ts b/private/aws-protocoltests-query-schema/src/commands/NestedStructuresCommand.ts new file mode 100644 index 0000000000000..8a290f1a59b4c --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/NestedStructuresCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NestedStructuresInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { NestedStructures } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NestedStructuresCommand}. + */ +export interface NestedStructuresCommandInput extends NestedStructuresInput {} +/** + * @public + * + * The output of {@link NestedStructuresCommand}. + */ +export interface NestedStructuresCommandOutput extends __MetadataBearer {} + +/** + * This test serializes nested and recursive structure members. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, NestedStructuresCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, NestedStructuresCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // NestedStructuresInput + * Nested: { // StructArg + * StringArg: "STRING_VALUE", + * OtherArg: true || false, + * RecursiveArg: { + * StringArg: "STRING_VALUE", + * OtherArg: true || false, + * RecursiveArg: "", + * }, + * }, + * }; + * const command = new NestedStructuresCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NestedStructuresCommandInput - {@link NestedStructuresCommandInput} + * @returns {@link NestedStructuresCommandOutput} + * @see {@link NestedStructuresCommandInput} for command's `input` shape. + * @see {@link NestedStructuresCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class NestedStructuresCommand extends $Command + .classBuilder< + NestedStructuresCommandInput, + NestedStructuresCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "NestedStructures", {}) + .n("QueryProtocolClient", "NestedStructuresCommand") + .f(void 0, void 0) + .sc(NestedStructures) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NestedStructuresInput; + output: {}; + }; + sdk: { + input: NestedStructuresCommandInput; + output: NestedStructuresCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/NoInputAndNoOutputCommand.ts b/private/aws-protocoltests-query-schema/src/commands/NoInputAndNoOutputCommand.ts new file mode 100644 index 0000000000000..65e8e2a3b86d4 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/NoInputAndNoOutputCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { NoInputAndNoOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has no input or output. + * + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, NoInputAndNoOutputCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, NoInputAndNoOutputCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new NoInputAndNoOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndNoOutputCommandInput - {@link NoInputAndNoOutputCommandInput} + * @returns {@link NoInputAndNoOutputCommandOutput} + * @see {@link NoInputAndNoOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndNoOutputCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class NoInputAndNoOutputCommand extends $Command + .classBuilder< + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "NoInputAndNoOutput", {}) + .n("QueryProtocolClient", "NoInputAndNoOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndNoOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndNoOutputCommandInput; + output: NoInputAndNoOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/NoInputAndOutputCommand.ts b/private/aws-protocoltests-query-schema/src/commands/NoInputAndOutputCommand.ts new file mode 100644 index 0000000000000..d65f66e2c4f7d --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/NoInputAndOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NoInputAndOutputInput, NoInputAndOutputOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { NoInputAndOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandInput extends NoInputAndOutputInput {} +/** + * @public + * + * The output of {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandOutput extends NoInputAndOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request payload or response members. + * + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, NoInputAndOutputCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, NoInputAndOutputCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new NoInputAndOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndOutputCommandInput - {@link NoInputAndOutputCommandInput} + * @returns {@link NoInputAndOutputCommandOutput} + * @see {@link NoInputAndOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndOutputCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class NoInputAndOutputCommand extends $Command + .classBuilder< + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "NoInputAndOutput", {}) + .n("QueryProtocolClient", "NoInputAndOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndOutputCommandInput; + output: NoInputAndOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-query-schema/src/commands/PutWithContentEncodingCommand.ts new file mode 100644 index 0000000000000..f3ffb79447e24 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/PutWithContentEncodingCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { PutWithContentEncodingInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { PutWithContentEncoding } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandInput extends PutWithContentEncodingInput {} +/** + * @public + * + * The output of {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, PutWithContentEncodingCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, PutWithContentEncodingCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // PutWithContentEncodingInput + * encoding: "STRING_VALUE", + * data: "STRING_VALUE", + * }; + * const command = new PutWithContentEncodingCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param PutWithContentEncodingCommandInput - {@link PutWithContentEncodingCommandInput} + * @returns {@link PutWithContentEncodingCommandOutput} + * @see {@link PutWithContentEncodingCommandInput} for command's `input` shape. + * @see {@link PutWithContentEncodingCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class PutWithContentEncodingCommand extends $Command + .classBuilder< + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [ + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getCompressionPlugin(config, { + encodings: ["gzip"], + }), + ]; + }) + .s("AwsQuery", "PutWithContentEncoding", {}) + .n("QueryProtocolClient", "PutWithContentEncodingCommand") + .f(void 0, void 0) + .sc(PutWithContentEncoding) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutWithContentEncodingInput; + output: {}; + }; + sdk: { + input: PutWithContentEncodingCommandInput; + output: PutWithContentEncodingCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts b/private/aws-protocoltests-query-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts new file mode 100644 index 0000000000000..8d3846b9fc291 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryIdempotencyTokenAutoFillInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { QueryIdempotencyTokenAutoFill } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandInput extends QueryIdempotencyTokenAutoFillInput {} +/** + * @public + * + * The output of {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandOutput extends __MetadataBearer {} + +/** + * Automatically adds idempotency tokens. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, QueryIdempotencyTokenAutoFillCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, QueryIdempotencyTokenAutoFillCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // QueryIdempotencyTokenAutoFillInput + * token: "STRING_VALUE", + * }; + * const command = new QueryIdempotencyTokenAutoFillCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryIdempotencyTokenAutoFillCommandInput - {@link QueryIdempotencyTokenAutoFillCommandInput} + * @returns {@link QueryIdempotencyTokenAutoFillCommandOutput} + * @see {@link QueryIdempotencyTokenAutoFillCommandInput} for command's `input` shape. + * @see {@link QueryIdempotencyTokenAutoFillCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class QueryIdempotencyTokenAutoFillCommand extends $Command + .classBuilder< + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "QueryIdempotencyTokenAutoFill", {}) + .n("QueryProtocolClient", "QueryIdempotencyTokenAutoFillCommand") + .f(void 0, void 0) + .sc(QueryIdempotencyTokenAutoFill) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryIdempotencyTokenAutoFillInput; + output: {}; + }; + sdk: { + input: QueryIdempotencyTokenAutoFillCommandInput; + output: QueryIdempotencyTokenAutoFillCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/QueryListsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/QueryListsCommand.ts new file mode 100644 index 0000000000000..b2fea64870bc7 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/QueryListsCommand.ts @@ -0,0 +1,107 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryListsInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { QueryLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryListsCommand}. + */ +export interface QueryListsCommandInput extends QueryListsInput {} +/** + * @public + * + * The output of {@link QueryListsCommand}. + */ +export interface QueryListsCommandOutput extends __MetadataBearer {} + +/** + * This test serializes simple and complex lists. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, QueryListsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, QueryListsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // QueryListsInput + * ListArg: [ // StringList + * "STRING_VALUE", + * ], + * ComplexListArg: [ // GreetingList + * { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * ], + * FlattenedListArg: [ + * "STRING_VALUE", + * ], + * ListArgWithXmlNameMember: [ // ListWithXmlName + * "STRING_VALUE", + * ], + * FlattenedListArgWithXmlName: [ + * "STRING_VALUE", + * ], + * NestedWithList: { // NestedStructWithList + * ListArg: [ + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new QueryListsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryListsCommandInput - {@link QueryListsCommandInput} + * @returns {@link QueryListsCommandOutput} + * @see {@link QueryListsCommandInput} for command's `input` shape. + * @see {@link QueryListsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class QueryListsCommand extends $Command + .classBuilder< + QueryListsCommandInput, + QueryListsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "QueryLists", {}) + .n("QueryProtocolClient", "QueryListsCommand") + .f(void 0, void 0) + .sc(QueryLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryListsInput; + output: {}; + }; + sdk: { + input: QueryListsCommandInput; + output: QueryListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/QueryMapsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/QueryMapsCommand.ts new file mode 100644 index 0000000000000..21bed434f342d --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/QueryMapsCommand.ts @@ -0,0 +1,115 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryMapsInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { QueryMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryMapsCommand}. + */ +export interface QueryMapsCommandInput extends QueryMapsInput {} +/** + * @public + * + * The output of {@link QueryMapsCommand}. + */ +export interface QueryMapsCommandOutput extends __MetadataBearer {} + +/** + * This test serializes simple and complex maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, QueryMapsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, QueryMapsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // QueryMapsInput + * MapArg: { // StringMap + * "": "STRING_VALUE", + * }, + * RenamedMapArg: { + * "": "STRING_VALUE", + * }, + * ComplexMapArg: { // ComplexMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * MapWithXmlMemberName: { // MapWithXmlName + * "": "STRING_VALUE", + * }, + * FlattenedMap: { + * "": "STRING_VALUE", + * }, + * FlattenedMapWithXmlName: { + * "": "STRING_VALUE", + * }, + * MapOfLists: { // MapOfLists + * "": [ // StringList + * "STRING_VALUE", + * ], + * }, + * NestedStructWithMap: { // NestedStructWithMap + * MapArg: { + * "": "STRING_VALUE", + * }, + * }, + * }; + * const command = new QueryMapsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryMapsCommandInput - {@link QueryMapsCommandInput} + * @returns {@link QueryMapsCommandOutput} + * @see {@link QueryMapsCommandInput} for command's `input` shape. + * @see {@link QueryMapsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class QueryMapsCommand extends $Command + .classBuilder< + QueryMapsCommandInput, + QueryMapsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "QueryMaps", {}) + .n("QueryProtocolClient", "QueryMapsCommand") + .f(void 0, void 0) + .sc(QueryMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryMapsInput; + output: {}; + }; + sdk: { + input: QueryMapsCommandInput; + output: QueryMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/QueryTimestampsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/QueryTimestampsCommand.ts new file mode 100644 index 0000000000000..f38a8f1794394 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/QueryTimestampsCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryTimestampsInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { QueryTimestamps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryTimestampsCommand}. + */ +export interface QueryTimestampsCommandInput extends QueryTimestampsInput {} +/** + * @public + * + * The output of {@link QueryTimestampsCommand}. + */ +export interface QueryTimestampsCommandOutput extends __MetadataBearer {} + +/** + * This test serializes timestamps. + * + * 1. Timestamps are serialized as RFC 3339 date-time values by default. + * 2. A timestampFormat trait on a member changes the format. + * 3. A timestampFormat trait on the shape targeted by the member changes the format. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, QueryTimestampsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, QueryTimestampsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // QueryTimestampsInput + * normalFormat: new Date("TIMESTAMP"), + * epochMember: new Date("TIMESTAMP"), + * epochTarget: new Date("TIMESTAMP"), + * }; + * const command = new QueryTimestampsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryTimestampsCommandInput - {@link QueryTimestampsCommandInput} + * @returns {@link QueryTimestampsCommandOutput} + * @see {@link QueryTimestampsCommandInput} for command's `input` shape. + * @see {@link QueryTimestampsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class QueryTimestampsCommand extends $Command + .classBuilder< + QueryTimestampsCommandInput, + QueryTimestampsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "QueryTimestamps", {}) + .n("QueryProtocolClient", "QueryTimestampsCommand") + .f(void 0, void 0) + .sc(QueryTimestamps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryTimestampsInput; + output: {}; + }; + sdk: { + input: QueryTimestampsCommandInput; + output: QueryTimestampsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/RecursiveXmlShapesCommand.ts b/private/aws-protocoltests-query-schema/src/commands/RecursiveXmlShapesCommand.ts new file mode 100644 index 0000000000000..57ba870fdec9b --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/RecursiveXmlShapesCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RecursiveXmlShapesOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { RecursiveXmlShapes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RecursiveXmlShapesCommand}. + */ +export interface RecursiveXmlShapesCommandInput {} +/** + * @public + * + * The output of {@link RecursiveXmlShapesCommand}. + */ +export interface RecursiveXmlShapesCommandOutput extends RecursiveXmlShapesOutput, __MetadataBearer {} + +/** + * Recursive shapes + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, RecursiveXmlShapesCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, RecursiveXmlShapesCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new RecursiveXmlShapesCommand(input); + * const response = await client.send(command); + * // { // RecursiveXmlShapesOutput + * // nested: { // RecursiveXmlShapesOutputNested1 + * // foo: "STRING_VALUE", + * // nested: { // RecursiveXmlShapesOutputNested2 + * // bar: "STRING_VALUE", + * // recursiveMember: { + * // foo: "STRING_VALUE", + * // nested: { + * // bar: "STRING_VALUE", + * // recursiveMember: "", + * // }, + * // }, + * // }, + * // }, + * // }; + * + * ``` + * + * @param RecursiveXmlShapesCommandInput - {@link RecursiveXmlShapesCommandInput} + * @returns {@link RecursiveXmlShapesCommandOutput} + * @see {@link RecursiveXmlShapesCommandInput} for command's `input` shape. + * @see {@link RecursiveXmlShapesCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class RecursiveXmlShapesCommand extends $Command + .classBuilder< + RecursiveXmlShapesCommandInput, + RecursiveXmlShapesCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "RecursiveXmlShapes", {}) + .n("QueryProtocolClient", "RecursiveXmlShapesCommand") + .f(void 0, void 0) + .sc(RecursiveXmlShapes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: RecursiveXmlShapesOutput; + }; + sdk: { + input: RecursiveXmlShapesCommandInput; + output: RecursiveXmlShapesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/SimpleInputParamsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/SimpleInputParamsCommand.ts new file mode 100644 index 0000000000000..01a892109c70d --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/SimpleInputParamsCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleInputParamsInput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { SimpleInputParams } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleInputParamsCommand}. + */ +export interface SimpleInputParamsCommandInput extends SimpleInputParamsInput {} +/** + * @public + * + * The output of {@link SimpleInputParamsCommand}. + */ +export interface SimpleInputParamsCommandOutput extends __MetadataBearer {} + +/** + * This test serializes strings, numbers, and boolean values. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, SimpleInputParamsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, SimpleInputParamsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = { // SimpleInputParamsInput + * Foo: "STRING_VALUE", + * Bar: "STRING_VALUE", + * Baz: true || false, + * Bam: Number("int"), + * FloatValue: Number("float"), + * Boo: Number("double"), + * Qux: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * FooEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * IntegerEnum: 1 || 2 || 3, + * }; + * const command = new SimpleInputParamsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param SimpleInputParamsCommandInput - {@link SimpleInputParamsCommandInput} + * @returns {@link SimpleInputParamsCommandOutput} + * @see {@link SimpleInputParamsCommandInput} for command's `input` shape. + * @see {@link SimpleInputParamsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class SimpleInputParamsCommand extends $Command + .classBuilder< + SimpleInputParamsCommandInput, + SimpleInputParamsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "SimpleInputParams", {}) + .n("QueryProtocolClient", "SimpleInputParamsCommand") + .f(void 0, void 0) + .sc(SimpleInputParams) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleInputParamsInput; + output: {}; + }; + sdk: { + input: SimpleInputParamsCommandInput; + output: SimpleInputParamsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/SimpleScalarXmlPropertiesCommand.ts b/private/aws-protocoltests-query-schema/src/commands/SimpleScalarXmlPropertiesCommand.ts new file mode 100644 index 0000000000000..8724f5f7e314d --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/SimpleScalarXmlPropertiesCommand.ts @@ -0,0 +1,95 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleScalarXmlPropertiesOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { SimpleScalarXmlProperties } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleScalarXmlPropertiesCommand}. + */ +export interface SimpleScalarXmlPropertiesCommandInput {} +/** + * @public + * + * The output of {@link SimpleScalarXmlPropertiesCommand}. + */ +export interface SimpleScalarXmlPropertiesCommandOutput extends SimpleScalarXmlPropertiesOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, SimpleScalarXmlPropertiesCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, SimpleScalarXmlPropertiesCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new SimpleScalarXmlPropertiesCommand(input); + * const response = await client.send(command); + * // { // SimpleScalarXmlPropertiesOutput + * // stringValue: "STRING_VALUE", + * // emptyStringValue: "STRING_VALUE", + * // trueBooleanValue: true || false, + * // falseBooleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }; + * + * ``` + * + * @param SimpleScalarXmlPropertiesCommandInput - {@link SimpleScalarXmlPropertiesCommandInput} + * @returns {@link SimpleScalarXmlPropertiesCommandOutput} + * @see {@link SimpleScalarXmlPropertiesCommandInput} for command's `input` shape. + * @see {@link SimpleScalarXmlPropertiesCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class SimpleScalarXmlPropertiesCommand extends $Command + .classBuilder< + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "SimpleScalarXmlProperties", {}) + .n("QueryProtocolClient", "SimpleScalarXmlPropertiesCommand") + .f(void 0, void 0) + .sc(SimpleScalarXmlProperties) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: SimpleScalarXmlPropertiesOutput; + }; + sdk: { + input: SimpleScalarXmlPropertiesCommandInput; + output: SimpleScalarXmlPropertiesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlBlobsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlBlobsCommand.ts new file mode 100644 index 0000000000000..311d64c6120e1 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlBlobsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlBlobsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlBlobs } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlBlobsCommand}. + */ +export interface XmlBlobsCommandInput {} +/** + * @public + * + * The output of {@link XmlBlobsCommand}. + */ +export interface XmlBlobsCommandOutput extends XmlBlobsOutput, __MetadataBearer {} + +/** + * Blobs are base64 encoded + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlBlobsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlBlobsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlBlobsCommand(input); + * const response = await client.send(command); + * // { // XmlBlobsOutput + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param XmlBlobsCommandInput - {@link XmlBlobsCommandInput} + * @returns {@link XmlBlobsCommandOutput} + * @see {@link XmlBlobsCommandInput} for command's `input` shape. + * @see {@link XmlBlobsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class XmlBlobsCommand extends $Command + .classBuilder< + XmlBlobsCommandInput, + XmlBlobsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlBlobs", {}) + .n("QueryProtocolClient", "XmlBlobsCommand") + .f(void 0, void 0) + .sc(XmlBlobs) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlBlobsOutput; + }; + sdk: { + input: XmlBlobsCommandInput; + output: XmlBlobsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlEmptyBlobsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlEmptyBlobsCommand.ts new file mode 100644 index 0000000000000..0a29533fd8f29 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlEmptyBlobsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlBlobsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlEmptyBlobs } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyBlobsCommand}. + */ +export interface XmlEmptyBlobsCommandInput {} +/** + * @public + * + * The output of {@link XmlEmptyBlobsCommand}. + */ +export interface XmlEmptyBlobsCommandOutput extends XmlBlobsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlEmptyBlobsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlEmptyBlobsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlEmptyBlobsCommand(input); + * const response = await client.send(command); + * // { // XmlBlobsOutput + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param XmlEmptyBlobsCommandInput - {@link XmlEmptyBlobsCommandInput} + * @returns {@link XmlEmptyBlobsCommandOutput} + * @see {@link XmlEmptyBlobsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyBlobsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class XmlEmptyBlobsCommand extends $Command + .classBuilder< + XmlEmptyBlobsCommandInput, + XmlEmptyBlobsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlEmptyBlobs", {}) + .n("QueryProtocolClient", "XmlEmptyBlobsCommand") + .f(void 0, void 0) + .sc(XmlEmptyBlobs) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlBlobsOutput; + }; + sdk: { + input: XmlEmptyBlobsCommandInput; + output: XmlEmptyBlobsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlEmptyListsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlEmptyListsCommand.ts new file mode 100644 index 0000000000000..deca19a5ca4b5 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlEmptyListsCommand.ts @@ -0,0 +1,132 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlListsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlEmptyLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyListsCommand}. + */ +export interface XmlEmptyListsCommandInput {} +/** + * @public + * + * The output of {@link XmlEmptyListsCommand}. + */ +export interface XmlEmptyListsCommandOutput extends XmlListsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlEmptyListsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlEmptyListsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlEmptyListsCommand(input); + * const response = await client.send(command); + * // { // XmlListsOutput + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // renamedListMembers: [ // RenamedListMembers + * // "STRING_VALUE", + * // ], + * // flattenedList: [ + * // "STRING_VALUE", + * // ], + * // flattenedList2: [ + * // "STRING_VALUE", + * // ], + * // flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * // "STRING_VALUE", + * // ], + * // flattenedListWithNamespace: [ // ListWithNamespace + * // "STRING_VALUE", + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param XmlEmptyListsCommandInput - {@link XmlEmptyListsCommandInput} + * @returns {@link XmlEmptyListsCommandOutput} + * @see {@link XmlEmptyListsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyListsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class XmlEmptyListsCommand extends $Command + .classBuilder< + XmlEmptyListsCommandInput, + XmlEmptyListsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlEmptyLists", {}) + .n("QueryProtocolClient", "XmlEmptyListsCommand") + .f(void 0, void 0) + .sc(XmlEmptyLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlListsOutput; + }; + sdk: { + input: XmlEmptyListsCommandInput; + output: XmlEmptyListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlEmptyMapsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlEmptyMapsCommand.ts new file mode 100644 index 0000000000000..ba4ab72568fb7 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlEmptyMapsCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlMapsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlEmptyMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyMapsCommand}. + */ +export interface XmlEmptyMapsCommandInput {} +/** + * @public + * + * The output of {@link XmlEmptyMapsCommand}. + */ +export interface XmlEmptyMapsCommandOutput extends XmlMapsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlEmptyMapsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlEmptyMapsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlEmptyMapsCommand(input); + * const response = await client.send(command); + * // { // XmlMapsOutput + * // myMap: { // XmlMapsOutputMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param XmlEmptyMapsCommandInput - {@link XmlEmptyMapsCommandInput} + * @returns {@link XmlEmptyMapsCommandOutput} + * @see {@link XmlEmptyMapsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyMapsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class XmlEmptyMapsCommand extends $Command + .classBuilder< + XmlEmptyMapsCommandInput, + XmlEmptyMapsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlEmptyMaps", {}) + .n("QueryProtocolClient", "XmlEmptyMapsCommand") + .f(void 0, void 0) + .sc(XmlEmptyMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlMapsOutput; + }; + sdk: { + input: XmlEmptyMapsCommandInput; + output: XmlEmptyMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlEnumsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlEnumsCommand.ts new file mode 100644 index 0000000000000..cc31874d76205 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlEnumsCommand.ts @@ -0,0 +1,97 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlEnumsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEnumsCommand}. + */ +export interface XmlEnumsCommandInput {} +/** + * @public + * + * The output of {@link XmlEnumsCommand}. + */ +export interface XmlEnumsCommandOutput extends XmlEnumsOutput, __MetadataBearer {} + +/** + * This example serializes enums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlEnumsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlEnumsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlEnumsCommand(input); + * const response = await client.send(command); + * // { // XmlEnumsOutput + * // fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumSet: [ // FooEnumSet + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumMap: { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }; + * + * ``` + * + * @param XmlEnumsCommandInput - {@link XmlEnumsCommandInput} + * @returns {@link XmlEnumsCommandOutput} + * @see {@link XmlEnumsCommandInput} for command's `input` shape. + * @see {@link XmlEnumsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class XmlEnumsCommand extends $Command + .classBuilder< + XmlEnumsCommandInput, + XmlEnumsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlEnums", {}) + .n("QueryProtocolClient", "XmlEnumsCommand") + .f(void 0, void 0) + .sc(XmlEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlEnumsOutput; + }; + sdk: { + input: XmlEnumsCommandInput; + output: XmlEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlIntEnumsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlIntEnumsCommand.ts new file mode 100644 index 0000000000000..54da8ea944746 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlIntEnumsCommand.ts @@ -0,0 +1,97 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlIntEnumsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlIntEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlIntEnumsCommand}. + */ +export interface XmlIntEnumsCommandInput {} +/** + * @public + * + * The output of {@link XmlIntEnumsCommand}. + */ +export interface XmlIntEnumsCommandOutput extends XmlIntEnumsOutput, __MetadataBearer {} + +/** + * This example serializes enums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlIntEnumsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlIntEnumsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlIntEnumsCommand(input); + * const response = await client.send(command); + * // { // XmlIntEnumsOutput + * // intEnum1: 1 || 2 || 3, + * // intEnum2: 1 || 2 || 3, + * // intEnum3: 1 || 2 || 3, + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // intEnumSet: [ // IntegerEnumSet + * // 1 || 2 || 3, + * // ], + * // intEnumMap: { // IntegerEnumMap + * // "": 1 || 2 || 3, + * // }, + * // }; + * + * ``` + * + * @param XmlIntEnumsCommandInput - {@link XmlIntEnumsCommandInput} + * @returns {@link XmlIntEnumsCommandOutput} + * @see {@link XmlIntEnumsCommandInput} for command's `input` shape. + * @see {@link XmlIntEnumsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class XmlIntEnumsCommand extends $Command + .classBuilder< + XmlIntEnumsCommandInput, + XmlIntEnumsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlIntEnums", {}) + .n("QueryProtocolClient", "XmlIntEnumsCommand") + .f(void 0, void 0) + .sc(XmlIntEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlIntEnumsOutput; + }; + sdk: { + input: XmlIntEnumsCommandInput; + output: XmlIntEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlListsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlListsCommand.ts new file mode 100644 index 0000000000000..01607c65dab8b --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlListsCommand.ts @@ -0,0 +1,141 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlListsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlListsCommand}. + */ +export interface XmlListsCommandInput {} +/** + * @public + * + * The output of {@link XmlListsCommand}. + */ +export interface XmlListsCommandOutput extends XmlListsOutput, __MetadataBearer {} + +/** + * This test case serializes XML lists for the following cases for both + * input and output: + * + * 1. Normal XML lists. + * 2. Normal XML sets. + * 3. XML lists of lists. + * 4. XML lists with @xmlName on its members + * 5. Flattened XML lists. + * 6. Flattened XML lists with @xmlName. + * 7. Lists of structures. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlListsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlListsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlListsCommand(input); + * const response = await client.send(command); + * // { // XmlListsOutput + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // renamedListMembers: [ // RenamedListMembers + * // "STRING_VALUE", + * // ], + * // flattenedList: [ + * // "STRING_VALUE", + * // ], + * // flattenedList2: [ + * // "STRING_VALUE", + * // ], + * // flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * // "STRING_VALUE", + * // ], + * // flattenedListWithNamespace: [ // ListWithNamespace + * // "STRING_VALUE", + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param XmlListsCommandInput - {@link XmlListsCommandInput} + * @returns {@link XmlListsCommandOutput} + * @see {@link XmlListsCommandInput} for command's `input` shape. + * @see {@link XmlListsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class XmlListsCommand extends $Command + .classBuilder< + XmlListsCommandInput, + XmlListsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlLists", {}) + .n("QueryProtocolClient", "XmlListsCommand") + .f(void 0, void 0) + .sc(XmlLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlListsOutput; + }; + sdk: { + input: XmlListsCommandInput; + output: XmlListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlMapsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlMapsCommand.ts new file mode 100644 index 0000000000000..9e4388eb814d7 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlMapsCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlMapsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlMapsCommand}. + */ +export interface XmlMapsCommandInput {} +/** + * @public + * + * The output of {@link XmlMapsCommand}. + */ +export interface XmlMapsCommandOutput extends XmlMapsOutput, __MetadataBearer {} + +/** + * The example tests basic map serialization. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlMapsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlMapsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlMapsCommand(input); + * const response = await client.send(command); + * // { // XmlMapsOutput + * // myMap: { // XmlMapsOutputMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param XmlMapsCommandInput - {@link XmlMapsCommandInput} + * @returns {@link XmlMapsCommandOutput} + * @see {@link XmlMapsCommandInput} for command's `input` shape. + * @see {@link XmlMapsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class XmlMapsCommand extends $Command + .classBuilder< + XmlMapsCommandInput, + XmlMapsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlMaps", {}) + .n("QueryProtocolClient", "XmlMapsCommand") + .f(void 0, void 0) + .sc(XmlMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlMapsOutput; + }; + sdk: { + input: XmlMapsCommandInput; + output: XmlMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlMapsXmlNameCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlMapsXmlNameCommand.ts new file mode 100644 index 0000000000000..a04fdfb8c7cdf --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlMapsXmlNameCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlMapsXmlNameOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlMapsXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlMapsXmlNameCommand}. + */ +export interface XmlMapsXmlNameCommandInput {} +/** + * @public + * + * The output of {@link XmlMapsXmlNameCommand}. + */ +export interface XmlMapsXmlNameCommandOutput extends XmlMapsXmlNameOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlMapsXmlNameCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlMapsXmlNameCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlMapsXmlNameCommand(input); + * const response = await client.send(command); + * // { // XmlMapsXmlNameOutput + * // myMap: { // XmlMapsXmlNameOutputMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param XmlMapsXmlNameCommandInput - {@link XmlMapsXmlNameCommandInput} + * @returns {@link XmlMapsXmlNameCommandOutput} + * @see {@link XmlMapsXmlNameCommandInput} for command's `input` shape. + * @see {@link XmlMapsXmlNameCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class XmlMapsXmlNameCommand extends $Command + .classBuilder< + XmlMapsXmlNameCommandInput, + XmlMapsXmlNameCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlMapsXmlName", {}) + .n("QueryProtocolClient", "XmlMapsXmlNameCommand") + .f(void 0, void 0) + .sc(XmlMapsXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlMapsXmlNameOutput; + }; + sdk: { + input: XmlMapsXmlNameCommandInput; + output: XmlMapsXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlNamespacesCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlNamespacesCommand.ts new file mode 100644 index 0000000000000..36ce118b7db1b --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlNamespacesCommand.ts @@ -0,0 +1,91 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlNamespacesOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlNamespaces } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlNamespacesCommand}. + */ +export interface XmlNamespacesCommandInput {} +/** + * @public + * + * The output of {@link XmlNamespacesCommand}. + */ +export interface XmlNamespacesCommandOutput extends XmlNamespacesOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlNamespacesCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlNamespacesCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlNamespacesCommand(input); + * const response = await client.send(command); + * // { // XmlNamespacesOutput + * // nested: { // XmlNamespaceNested + * // foo: "STRING_VALUE", + * // values: [ // XmlNamespacedList + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param XmlNamespacesCommandInput - {@link XmlNamespacesCommandInput} + * @returns {@link XmlNamespacesCommandOutput} + * @see {@link XmlNamespacesCommandInput} for command's `input` shape. + * @see {@link XmlNamespacesCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + */ +export class XmlNamespacesCommand extends $Command + .classBuilder< + XmlNamespacesCommandInput, + XmlNamespacesCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlNamespaces", {}) + .n("QueryProtocolClient", "XmlNamespacesCommand") + .f(void 0, void 0) + .sc(XmlNamespaces) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlNamespacesOutput; + }; + sdk: { + input: XmlNamespacesCommandInput; + output: XmlNamespacesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/XmlTimestampsCommand.ts b/private/aws-protocoltests-query-schema/src/commands/XmlTimestampsCommand.ts new file mode 100644 index 0000000000000..99e1f0a4c0e8f --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/XmlTimestampsCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlTimestampsOutput } from "../models/models_0"; +import { QueryProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QueryProtocolClient"; +import { XmlTimestamps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlTimestampsCommand}. + */ +export interface XmlTimestampsCommandInput {} +/** + * @public + * + * The output of {@link XmlTimestampsCommand}. + */ +export interface XmlTimestampsCommandOutput extends XmlTimestampsOutput, __MetadataBearer {} + +/** + * This tests how timestamps are serialized, including using the + * default format of date-time and various @timestampFormat trait + * values. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QueryProtocolClient, XmlTimestampsCommand } from "@aws-sdk/aws-protocoltests-query-schema"; // ES Modules import + * // const { QueryProtocolClient, XmlTimestampsCommand } = require("@aws-sdk/aws-protocoltests-query-schema"); // CommonJS import + * const client = new QueryProtocolClient(config); + * const input = {}; + * const command = new XmlTimestampsCommand(input); + * const response = await client.send(command); + * // { // XmlTimestampsOutput + * // normal: new Date("TIMESTAMP"), + * // dateTime: new Date("TIMESTAMP"), + * // dateTimeOnTarget: new Date("TIMESTAMP"), + * // epochSeconds: new Date("TIMESTAMP"), + * // epochSecondsOnTarget: new Date("TIMESTAMP"), + * // httpDate: new Date("TIMESTAMP"), + * // httpDateOnTarget: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param XmlTimestampsCommandInput - {@link XmlTimestampsCommandInput} + * @returns {@link XmlTimestampsCommandOutput} + * @see {@link XmlTimestampsCommandInput} for command's `input` shape. + * @see {@link XmlTimestampsCommandOutput} for command's `response` shape. + * @see {@link QueryProtocolClientResolvedConfig | config} for QueryProtocolClient's `config` shape. + * + * @throws {@link QueryProtocolServiceException} + *

Base exception class for all service exceptions from QueryProtocol service.

+ * + * + * @public + */ +export class XmlTimestampsCommand extends $Command + .classBuilder< + XmlTimestampsCommandInput, + XmlTimestampsCommandOutput, + QueryProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("AwsQuery", "XmlTimestamps", {}) + .n("QueryProtocolClient", "XmlTimestampsCommand") + .f(void 0, void 0) + .sc(XmlTimestamps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: XmlTimestampsOutput; + }; + sdk: { + input: XmlTimestampsCommandInput; + output: XmlTimestampsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-query-schema/src/commands/index.ts b/private/aws-protocoltests-query-schema/src/commands/index.ts new file mode 100644 index 0000000000000..b36583e0677f0 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/commands/index.ts @@ -0,0 +1,34 @@ +// smithy-typescript generated code +export * from "./DatetimeOffsetsCommand"; +export * from "./EmptyInputAndEmptyOutputCommand"; +export * from "./EndpointOperationCommand"; +export * from "./EndpointWithHostLabelOperationCommand"; +export * from "./FlattenedXmlMapCommand"; +export * from "./FlattenedXmlMapWithXmlNameCommand"; +export * from "./FlattenedXmlMapWithXmlNamespaceCommand"; +export * from "./FractionalSecondsCommand"; +export * from "./GreetingWithErrorsCommand"; +export * from "./HostWithPathOperationCommand"; +export * from "./IgnoresWrappingXmlNameCommand"; +export * from "./NestedStructuresCommand"; +export * from "./NoInputAndNoOutputCommand"; +export * from "./NoInputAndOutputCommand"; +export * from "./PutWithContentEncodingCommand"; +export * from "./QueryIdempotencyTokenAutoFillCommand"; +export * from "./QueryListsCommand"; +export * from "./QueryMapsCommand"; +export * from "./QueryTimestampsCommand"; +export * from "./RecursiveXmlShapesCommand"; +export * from "./SimpleInputParamsCommand"; +export * from "./SimpleScalarXmlPropertiesCommand"; +export * from "./XmlBlobsCommand"; +export * from "./XmlEmptyBlobsCommand"; +export * from "./XmlEmptyListsCommand"; +export * from "./XmlEmptyMapsCommand"; +export * from "./XmlEnumsCommand"; +export * from "./XmlIntEnumsCommand"; +export * from "./XmlListsCommand"; +export * from "./XmlMapsCommand"; +export * from "./XmlMapsXmlNameCommand"; +export * from "./XmlNamespacesCommand"; +export * from "./XmlTimestampsCommand"; diff --git a/private/aws-protocoltests-query-schema/src/endpoint/EndpointParameters.ts b/private/aws-protocoltests-query-schema/src/endpoint/EndpointParameters.ts new file mode 100644 index 0000000000000..98a8caa11a063 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/endpoint/EndpointParameters.ts @@ -0,0 +1,29 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return Object.assign(options, { + defaultSigningName: "awsquery", + }); +}; + +export const commonParams = { + endpoint: { type: "builtInParams", name: "endpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + endpoint?: string; +} diff --git a/private/aws-protocoltests-query-schema/src/endpoint/endpointResolver.ts b/private/aws-protocoltests-query-schema/src/endpoint/endpointResolver.ts new file mode 100644 index 0000000000000..8bb222967df85 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["endpoint"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/private/aws-protocoltests-query-schema/src/endpoint/ruleset.ts b/private/aws-protocoltests-query-schema/src/endpoint/ruleset.ts new file mode 100644 index 0000000000000..14416a50b2697 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/endpoint/ruleset.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { RuleSetObject } from "@smithy/types"; + +export const ruleSet: RuleSetObject = { + version: "1.0", + parameters: { + endpoint: { + type: "string", + builtIn: "SDK::Endpoint", + documentation: "Endpoint used for making requests. Should be formatted as a URI.", + }, + }, + rules: [ + { + conditions: [ + { + fn: "isSet", + argv: [ + { + ref: "endpoint", + }, + ], + }, + ], + endpoint: { + url: { + ref: "endpoint", + }, + }, + type: "endpoint", + }, + { + conditions: [], + error: "(default endpointRuleSet) endpoint is not set - you must configure an endpoint.", + type: "error", + }, + ], +}; diff --git a/private/aws-protocoltests-query-schema/src/extensionConfiguration.ts b/private/aws-protocoltests-query-schema/src/extensionConfiguration.ts new file mode 100644 index 0000000000000..fc039352e069e --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface QueryProtocolExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/private/aws-protocoltests-query-schema/src/index.ts b/private/aws-protocoltests-query-schema/src/index.ts new file mode 100644 index 0000000000000..4688fc3c9e345 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/index.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + * A query service that sends query requests and XML responses. + * + * @packageDocumentation + */ +export * from "./QueryProtocolClient"; +export * from "./QueryProtocol"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { QueryProtocolExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { QueryProtocolServiceException } from "./models/QueryProtocolServiceException"; diff --git a/private/aws-protocoltests-query-schema/src/models/QueryProtocolServiceException.ts b/private/aws-protocoltests-query-schema/src/models/QueryProtocolServiceException.ts new file mode 100644 index 0000000000000..c2135c1eb4ac4 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/models/QueryProtocolServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from QueryProtocol service. + */ +export class QueryProtocolServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, QueryProtocolServiceException.prototype); + } +} diff --git a/private/aws-protocoltests-query-schema/src/models/index.ts b/private/aws-protocoltests-query-schema/src/models/index.ts new file mode 100644 index 0000000000000..9eaceb12865f8 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/private/aws-protocoltests-query-schema/src/models/models_0.ts b/private/aws-protocoltests-query-schema/src/models/models_0.ts new file mode 100644 index 0000000000000..4cc93a3f78ab5 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/models/models_0.ts @@ -0,0 +1,423 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +import { QueryProtocolServiceException as __BaseException } from "./QueryProtocolServiceException"; + +/** + * @public + */ +export interface GreetingStruct { + hi?: string | undefined; +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} + +/** + * @public + */ +export interface DatetimeOffsetsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputInput {} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputOutput {} + +/** + * @public + */ +export interface HostLabelInput { + label: string | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapOutput { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapWithXmlNameOutput { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapWithXmlNamespaceOutput { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FractionalSecondsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface ComplexNestedErrorData { + Foo?: string | undefined; +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name: "ComplexError" = "ComplexError"; + readonly $fault: "client" = "client"; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * @public + */ +export class CustomCodeError extends __BaseException { + readonly name: "CustomCodeError" = "CustomCodeError"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "CustomCodeError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, CustomCodeError.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface GreetingWithErrorsOutput { + greeting?: string | undefined; +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name: "InvalidGreeting" = "InvalidGreeting"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface IgnoresWrappingXmlNameOutput { + foo?: string | undefined; +} + +/** + * @public + */ +export interface NoInputAndOutputInput {} + +/** + * @public + */ +export interface NoInputAndOutputOutput {} + +/** + * @public + */ +export interface PutWithContentEncodingInput { + encoding?: string | undefined; + data?: string | undefined; +} + +/** + * @public + */ +export interface QueryIdempotencyTokenAutoFillInput { + token?: string | undefined; +} + +/** + * @public + */ +export interface NestedStructWithList { + ListArg?: string[] | undefined; +} + +/** + * @public + */ +export interface QueryListsInput { + ListArg?: string[] | undefined; + ComplexListArg?: GreetingStruct[] | undefined; + FlattenedListArg?: string[] | undefined; + ListArgWithXmlNameMember?: string[] | undefined; + FlattenedListArgWithXmlName?: string[] | undefined; + NestedWithList?: NestedStructWithList | undefined; +} + +/** + * @public + */ +export interface NestedStructWithMap { + MapArg?: Record | undefined; +} + +/** + * @public + */ +export interface QueryMapsInput { + MapArg?: Record | undefined; + RenamedMapArg?: Record | undefined; + ComplexMapArg?: Record | undefined; + MapWithXmlMemberName?: Record | undefined; + FlattenedMap?: Record | undefined; + FlattenedMapWithXmlName?: Record | undefined; + MapOfLists?: Record | undefined; + NestedStructWithMap?: NestedStructWithMap | undefined; +} + +/** + * @public + */ +export interface QueryTimestampsInput { + normalFormat?: Date | undefined; + epochMember?: Date | undefined; + epochTarget?: Date | undefined; +} + +/** + * @public + */ +export interface SimpleInputParamsInput { + Foo?: string | undefined; + Bar?: string | undefined; + Baz?: boolean | undefined; + Bam?: number | undefined; + FloatValue?: number | undefined; + Boo?: number | undefined; + Qux?: Uint8Array | undefined; + FooEnum?: FooEnum | undefined; + IntegerEnum?: IntegerEnum | undefined; +} + +/** + * @public + */ +export interface SimpleScalarXmlPropertiesOutput { + stringValue?: string | undefined; + emptyStringValue?: string | undefined; + trueBooleanValue?: boolean | undefined; + falseBooleanValue?: boolean | undefined; + byteValue?: number | undefined; + shortValue?: number | undefined; + integerValue?: number | undefined; + longValue?: number | undefined; + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export interface XmlBlobsOutput { + data?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface StructureListMember { + a?: string | undefined; + b?: string | undefined; +} + +/** + * @public + */ +export interface XmlListsOutput { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + renamedListMembers?: string[] | undefined; + flattenedList?: string[] | undefined; + flattenedList2?: string[] | undefined; + flattenedListWithMemberNamespace?: string[] | undefined; + flattenedListWithNamespace?: string[] | undefined; + structureList?: StructureListMember[] | undefined; +} + +/** + * @public + */ +export interface XmlMapsOutput { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlEnumsOutput { + fooEnum1?: FooEnum | undefined; + fooEnum2?: FooEnum | undefined; + fooEnum3?: FooEnum | undefined; + fooEnumList?: FooEnum[] | undefined; + fooEnumSet?: FooEnum[] | undefined; + fooEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlIntEnumsOutput { + intEnum1?: IntegerEnum | undefined; + intEnum2?: IntegerEnum | undefined; + intEnum3?: IntegerEnum | undefined; + intEnumList?: IntegerEnum[] | undefined; + intEnumSet?: IntegerEnum[] | undefined; + intEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlMapsXmlNameOutput { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlNamespaceNested { + foo?: string | undefined; + values?: string[] | undefined; +} + +/** + * @public + */ +export interface XmlNamespacesOutput { + nested?: XmlNamespaceNested | undefined; +} + +/** + * @public + */ +export interface XmlTimestampsOutput { + normal?: Date | undefined; + dateTime?: Date | undefined; + dateTimeOnTarget?: Date | undefined; + epochSeconds?: Date | undefined; + epochSecondsOnTarget?: Date | undefined; + httpDate?: Date | undefined; + httpDateOnTarget?: Date | undefined; +} + +/** + * @public + */ +export interface StructArg { + StringArg?: string | undefined; + OtherArg?: boolean | undefined; + RecursiveArg?: StructArg | undefined; +} + +/** + * @public + */ +export interface NestedStructuresInput { + Nested?: StructArg | undefined; +} + +/** + * @public + */ +export interface RecursiveXmlShapesOutputNested1 { + foo?: string | undefined; + nested?: RecursiveXmlShapesOutputNested2 | undefined; +} + +/** + * @public + */ +export interface RecursiveXmlShapesOutputNested2 { + bar?: string | undefined; + recursiveMember?: RecursiveXmlShapesOutputNested1 | undefined; +} + +/** + * @public + */ +export interface RecursiveXmlShapesOutput { + nested?: RecursiveXmlShapesOutputNested1 | undefined; +} diff --git a/private/aws-protocoltests-query-schema/src/protocols/Aws_query.ts b/private/aws-protocoltests-query-schema/src/protocols/Aws_query.ts new file mode 100644 index 0000000000000..cdd4cc02e1b89 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/protocols/Aws_query.ts @@ -0,0 +1,2732 @@ +// smithy-typescript generated code +import { parseXmlBody as parseBody, parseXmlErrorBody as parseErrorBody } from "@aws-sdk/core"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, + isValidHostname as __isValidHostname, +} from "@smithy/protocol-http"; +import { + collectBody, + decorateServiceException as __decorateServiceException, + expectNonNull as __expectNonNull, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + getArrayIfSingleItem as __getArrayIfSingleItem, + parseBoolean as __parseBoolean, + parseEpochTimestamp as __parseEpochTimestamp, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime as __parseRfc7231DateTime, + serializeDateTime as __serializeDateTime, + serializeFloat as __serializeFloat, + strictParseByte as __strictParseByte, + strictParseFloat as __strictParseFloat, + strictParseInt32 as __strictParseInt32, + strictParseLong as __strictParseLong, + strictParseShort as __strictParseShort, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + HeaderBag as __HeaderBag, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "../commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "../commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "../commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "../commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommandInput, FlattenedXmlMapCommandOutput } from "../commands/FlattenedXmlMapCommand"; +import { + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, +} from "../commands/FlattenedXmlMapWithXmlNameCommand"; +import { + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, +} from "../commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "../commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "../commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "../commands/HostWithPathOperationCommand"; +import { + IgnoresWrappingXmlNameCommandInput, + IgnoresWrappingXmlNameCommandOutput, +} from "../commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommandInput, NestedStructuresCommandOutput } from "../commands/NestedStructuresCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "../commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "../commands/NoInputAndOutputCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "../commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "../commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommandInput, QueryListsCommandOutput } from "../commands/QueryListsCommand"; +import { QueryMapsCommandInput, QueryMapsCommandOutput } from "../commands/QueryMapsCommand"; +import { QueryTimestampsCommandInput, QueryTimestampsCommandOutput } from "../commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommandInput, RecursiveXmlShapesCommandOutput } from "../commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommandInput, SimpleInputParamsCommandOutput } from "../commands/SimpleInputParamsCommand"; +import { + SimpleScalarXmlPropertiesCommandInput, + SimpleScalarXmlPropertiesCommandOutput, +} from "../commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommandInput, XmlBlobsCommandOutput } from "../commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommandInput, XmlEmptyBlobsCommandOutput } from "../commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommandInput, XmlEmptyListsCommandOutput } from "../commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommandInput, XmlEmptyMapsCommandOutput } from "../commands/XmlEmptyMapsCommand"; +import { XmlEnumsCommandInput, XmlEnumsCommandOutput } from "../commands/XmlEnumsCommand"; +import { XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "../commands/XmlIntEnumsCommand"; +import { XmlListsCommandInput, XmlListsCommandOutput } from "../commands/XmlListsCommand"; +import { XmlMapsCommandInput, XmlMapsCommandOutput } from "../commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommandInput, XmlMapsXmlNameCommandOutput } from "../commands/XmlMapsXmlNameCommand"; +import { XmlNamespacesCommandInput, XmlNamespacesCommandOutput } from "../commands/XmlNamespacesCommand"; +import { XmlTimestampsCommandInput, XmlTimestampsCommandOutput } from "../commands/XmlTimestampsCommand"; +import { + ComplexError, + ComplexNestedErrorData, + CustomCodeError, + DatetimeOffsetsOutput, + EmptyInputAndEmptyOutputInput, + EmptyInputAndEmptyOutputOutput, + FlattenedXmlMapOutput, + FlattenedXmlMapWithXmlNameOutput, + FlattenedXmlMapWithXmlNamespaceOutput, + FooEnum, + FractionalSecondsOutput, + GreetingStruct, + GreetingWithErrorsOutput, + HostLabelInput, + IgnoresWrappingXmlNameOutput, + IntegerEnum, + InvalidGreeting, + NestedStructuresInput, + NestedStructWithList, + NestedStructWithMap, + NoInputAndOutputInput, + NoInputAndOutputOutput, + PutWithContentEncodingInput, + QueryIdempotencyTokenAutoFillInput, + QueryListsInput, + QueryMapsInput, + QueryTimestampsInput, + RecursiveXmlShapesOutput, + RecursiveXmlShapesOutputNested1, + RecursiveXmlShapesOutputNested2, + SimpleInputParamsInput, + SimpleScalarXmlPropertiesOutput, + StructArg, + StructureListMember, + XmlBlobsOutput, + XmlEnumsOutput, + XmlIntEnumsOutput, + XmlListsOutput, + XmlMapsOutput, + XmlMapsXmlNameOutput, + XmlNamespaceNested, + XmlNamespacesOutput, + XmlTimestampsOutput, +} from "../models/models_0"; +import { QueryProtocolServiceException as __BaseException } from "../models/QueryProtocolServiceException"; + +/** + * serializeAws_queryDatetimeOffsetsCommand + */ +export const se_DatetimeOffsetsCommand = async ( + input: DatetimeOffsetsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _DO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryEmptyInputAndEmptyOutputCommand + */ +export const se_EmptyInputAndEmptyOutputCommand = async ( + input: EmptyInputAndEmptyOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_EmptyInputAndEmptyOutputInput(input, context), + [_A]: _EIAEO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryEndpointOperationCommand + */ +export const se_EndpointOperationCommand = async ( + input: EndpointOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _EO, + [_V]: _, + }); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo." + resolvedHostname; + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_queryEndpointWithHostLabelOperationCommand + */ +export const se_EndpointWithHostLabelOperationCommand = async ( + input: EndpointWithHostLabelOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_HostLabelInput(input, context), + [_A]: _EWHLO, + [_V]: _, + }); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo.{label}." + resolvedHostname; + if (input.label === undefined) { + throw new Error("Empty value provided for input host prefix: label."); + } + resolvedHostname = resolvedHostname.replace("{label}", input.label!); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body); +}; + +/** + * serializeAws_queryFlattenedXmlMapCommand + */ +export const se_FlattenedXmlMapCommand = async ( + input: FlattenedXmlMapCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _FXM, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryFlattenedXmlMapWithXmlNameCommand + */ +export const se_FlattenedXmlMapWithXmlNameCommand = async ( + input: FlattenedXmlMapWithXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _FXMWXN, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryFlattenedXmlMapWithXmlNamespaceCommand + */ +export const se_FlattenedXmlMapWithXmlNamespaceCommand = async ( + input: FlattenedXmlMapWithXmlNamespaceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _FXMWXNl, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryFractionalSecondsCommand + */ +export const se_FractionalSecondsCommand = async ( + input: FractionalSecondsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _FS, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryGreetingWithErrorsCommand + */ +export const se_GreetingWithErrorsCommand = async ( + input: GreetingWithErrorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _GWE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryHostWithPathOperationCommand + */ +export const se_HostWithPathOperationCommand = async ( + input: HostWithPathOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _HWPO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryIgnoresWrappingXmlNameCommand + */ +export const se_IgnoresWrappingXmlNameCommand = async ( + input: IgnoresWrappingXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _IWXN, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryNestedStructuresCommand + */ +export const se_NestedStructuresCommand = async ( + input: NestedStructuresCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_NestedStructuresInput(input, context), + [_A]: _NS, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryNoInputAndNoOutputCommand + */ +export const se_NoInputAndNoOutputCommand = async ( + input: NoInputAndNoOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _NIANO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryNoInputAndOutputCommand + */ +export const se_NoInputAndOutputCommand = async ( + input: NoInputAndOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_NoInputAndOutputInput(input, context), + [_A]: _NIAO, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryPutWithContentEncodingCommand + */ +export const se_PutWithContentEncodingCommand = async ( + input: PutWithContentEncodingCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_PutWithContentEncodingInput(input, context), + [_A]: _PWCE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryQueryIdempotencyTokenAutoFillCommand + */ +export const se_QueryIdempotencyTokenAutoFillCommand = async ( + input: QueryIdempotencyTokenAutoFillCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_QueryIdempotencyTokenAutoFillInput(input, context), + [_A]: _QITAF, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryQueryListsCommand + */ +export const se_QueryListsCommand = async ( + input: QueryListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_QueryListsInput(input, context), + [_A]: _QL, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryQueryMapsCommand + */ +export const se_QueryMapsCommand = async ( + input: QueryMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_QueryMapsInput(input, context), + [_A]: _QM, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryQueryTimestampsCommand + */ +export const se_QueryTimestampsCommand = async ( + input: QueryTimestampsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_QueryTimestampsInput(input, context), + [_A]: _QT, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryRecursiveXmlShapesCommand + */ +export const se_RecursiveXmlShapesCommand = async ( + input: RecursiveXmlShapesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _RXS, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_querySimpleInputParamsCommand + */ +export const se_SimpleInputParamsCommand = async ( + input: SimpleInputParamsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = buildFormUrlencodedString({ + ...se_SimpleInputParamsInput(input, context), + [_A]: _SIP, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_querySimpleScalarXmlPropertiesCommand + */ +export const se_SimpleScalarXmlPropertiesCommand = async ( + input: SimpleScalarXmlPropertiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _SSXP, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlBlobsCommand + */ +export const se_XmlBlobsCommand = async ( + input: XmlBlobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XB, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlEmptyBlobsCommand + */ +export const se_XmlEmptyBlobsCommand = async ( + input: XmlEmptyBlobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XEB, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlEmptyListsCommand + */ +export const se_XmlEmptyListsCommand = async ( + input: XmlEmptyListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XEL, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlEmptyMapsCommand + */ +export const se_XmlEmptyMapsCommand = async ( + input: XmlEmptyMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XEM, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlEnumsCommand + */ +export const se_XmlEnumsCommand = async ( + input: XmlEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlIntEnumsCommand + */ +export const se_XmlIntEnumsCommand = async ( + input: XmlIntEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XIE, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlListsCommand + */ +export const se_XmlListsCommand = async ( + input: XmlListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XL, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlMapsCommand + */ +export const se_XmlMapsCommand = async ( + input: XmlMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XM, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlMapsXmlNameCommand + */ +export const se_XmlMapsXmlNameCommand = async ( + input: XmlMapsXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XMXN, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlNamespacesCommand + */ +export const se_XmlNamespacesCommand = async ( + input: XmlNamespacesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XN, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_queryXmlTimestampsCommand + */ +export const se_XmlTimestampsCommand = async ( + input: XmlTimestampsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + const body = buildFormUrlencodedString({ + [_A]: _XT, + [_V]: _, + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * deserializeAws_queryDatetimeOffsetsCommand + */ +export const de_DatetimeOffsetsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DatetimeOffsetsOutput(data.DatetimeOffsetsResult, context); + const response: DatetimeOffsetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryEmptyInputAndEmptyOutputCommand + */ +export const de_EmptyInputAndEmptyOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EmptyInputAndEmptyOutputOutput(data.EmptyInputAndEmptyOutputResult, context); + const response: EmptyInputAndEmptyOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryEndpointOperationCommand + */ +export const de_EndpointOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryEndpointWithHostLabelOperationCommand + */ +export const de_EndpointWithHostLabelOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EndpointWithHostLabelOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryFlattenedXmlMapCommand + */ +export const de_FlattenedXmlMapCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FlattenedXmlMapOutput(data.FlattenedXmlMapResult, context); + const response: FlattenedXmlMapCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryFlattenedXmlMapWithXmlNameCommand + */ +export const de_FlattenedXmlMapWithXmlNameCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FlattenedXmlMapWithXmlNameOutput(data.FlattenedXmlMapWithXmlNameResult, context); + const response: FlattenedXmlMapWithXmlNameCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryFlattenedXmlMapWithXmlNamespaceCommand + */ +export const de_FlattenedXmlMapWithXmlNamespaceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FlattenedXmlMapWithXmlNamespaceOutput(data.FlattenedXmlMapWithXmlNamespaceResult, context); + const response: FlattenedXmlMapWithXmlNamespaceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryFractionalSecondsCommand + */ +export const de_FractionalSecondsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FractionalSecondsOutput(data.FractionalSecondsResult, context); + const response: FractionalSecondsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryGreetingWithErrorsCommand + */ +export const de_GreetingWithErrorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GreetingWithErrorsOutput(data.GreetingWithErrorsResult, context); + const response: GreetingWithErrorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryHostWithPathOperationCommand + */ +export const de_HostWithPathOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: HostWithPathOperationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryIgnoresWrappingXmlNameCommand + */ +export const de_IgnoresWrappingXmlNameCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_IgnoresWrappingXmlNameOutput(data.IgnoresWrappingXmlNameResult, context); + const response: IgnoresWrappingXmlNameCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryNestedStructuresCommand + */ +export const de_NestedStructuresCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: NestedStructuresCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryNoInputAndNoOutputCommand + */ +export const de_NoInputAndNoOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: NoInputAndNoOutputCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryNoInputAndOutputCommand + */ +export const de_NoInputAndOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_NoInputAndOutputOutput(data.NoInputAndOutputResult, context); + const response: NoInputAndOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryPutWithContentEncodingCommand + */ +export const de_PutWithContentEncodingCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: PutWithContentEncodingCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryQueryIdempotencyTokenAutoFillCommand + */ +export const de_QueryIdempotencyTokenAutoFillCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: QueryIdempotencyTokenAutoFillCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryQueryListsCommand + */ +export const de_QueryListsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: QueryListsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryQueryMapsCommand + */ +export const de_QueryMapsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: QueryMapsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryQueryTimestampsCommand + */ +export const de_QueryTimestampsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: QueryTimestampsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_queryRecursiveXmlShapesCommand + */ +export const de_RecursiveXmlShapesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RecursiveXmlShapesOutput(data.RecursiveXmlShapesResult, context); + const response: RecursiveXmlShapesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_querySimpleInputParamsCommand + */ +export const de_SimpleInputParamsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: SimpleInputParamsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_querySimpleScalarXmlPropertiesCommand + */ +export const de_SimpleScalarXmlPropertiesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SimpleScalarXmlPropertiesOutput(data.SimpleScalarXmlPropertiesResult, context); + const response: SimpleScalarXmlPropertiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlBlobsCommand + */ +export const de_XmlBlobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlBlobsOutput(data.XmlBlobsResult, context); + const response: XmlBlobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlEmptyBlobsCommand + */ +export const de_XmlEmptyBlobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlBlobsOutput(data.XmlEmptyBlobsResult, context); + const response: XmlEmptyBlobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlEmptyListsCommand + */ +export const de_XmlEmptyListsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlListsOutput(data.XmlEmptyListsResult, context); + const response: XmlEmptyListsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlEmptyMapsCommand + */ +export const de_XmlEmptyMapsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlMapsOutput(data.XmlEmptyMapsResult, context); + const response: XmlEmptyMapsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlEnumsCommand + */ +export const de_XmlEnumsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlEnumsOutput(data.XmlEnumsResult, context); + const response: XmlEnumsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlIntEnumsCommand + */ +export const de_XmlIntEnumsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlIntEnumsOutput(data.XmlIntEnumsResult, context); + const response: XmlIntEnumsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlListsCommand + */ +export const de_XmlListsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlListsOutput(data.XmlListsResult, context); + const response: XmlListsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlMapsCommand + */ +export const de_XmlMapsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlMapsOutput(data.XmlMapsResult, context); + const response: XmlMapsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlMapsXmlNameCommand + */ +export const de_XmlMapsXmlNameCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlMapsXmlNameOutput(data.XmlMapsXmlNameResult, context); + const response: XmlMapsXmlNameCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlNamespacesCommand + */ +export const de_XmlNamespacesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlNamespacesOutput(data.XmlNamespacesResult, context); + const response: XmlNamespacesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_queryXmlTimestampsCommand + */ +export const de_XmlTimestampsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_XmlTimestampsOutput(data.XmlTimestampsResult, context); + const response: XmlTimestampsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Aws_queryCommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.query#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "Customized": + case "aws.protocoltests.query#CustomCodeError": + throw await de_CustomCodeErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.query#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Error, + errorCode, + }) as never; + } +}; + +/** + * deserializeAws_queryComplexErrorRes + */ +const de_ComplexErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_ComplexError(body.Error, context); + const exception = new ComplexError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_queryCustomCodeErrorRes + */ +const de_CustomCodeErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_CustomCodeError(body.Error, context); + const exception = new CustomCodeError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_queryInvalidGreetingRes + */ +const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = de_InvalidGreeting(body.Error, context); + const exception = new InvalidGreeting({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * serializeAws_queryComplexMap + */ +const se_ComplexMap = (input: Record, context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + const memberEntries = se_GreetingStruct(input[key as keyof typeof input]!, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`entry.${counter}.value.${key}`] = value; + }); + counter++; + }); + return entries; +}; + +/** + * serializeAws_queryEmptyInputAndEmptyOutputInput + */ +const se_EmptyInputAndEmptyOutputInput = (input: EmptyInputAndEmptyOutputInput, context: __SerdeContext): any => { + const entries: any = {}; + return entries; +}; + +/** + * serializeAws_queryHostLabelInput + */ +const se_HostLabelInput = (input: HostLabelInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_l] != null) { + entries[_l] = input[_l]; + } + return entries; +}; + +/** + * serializeAws_queryListWithXmlName + */ +const se_ListWithXmlName = (input: string[], context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + entries[`item.${counter}`] = entry; + counter++; + } + return entries; +}; + +/** + * serializeAws_queryMapOfLists + */ +const se_MapOfLists = (input: Record, context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + const memberEntries = se_StringList(input[key as keyof typeof input]!, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`entry.${counter}.value.${key}`] = value; + }); + counter++; + }); + return entries; +}; + +/** + * serializeAws_queryMapWithXmlName + */ +const se_MapWithXmlName = (input: Record, context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .forEach((key) => { + entries[`entry.${counter}.K`] = key; + entries[`entry.${counter}.V`] = input[key as keyof typeof input]!; + counter++; + }); + return entries; +}; + +/** + * serializeAws_queryNestedStructuresInput + */ +const se_NestedStructuresInput = (input: NestedStructuresInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_N] != null) { + const memberEntries = se_StructArg(input[_N], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Nested.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_queryNestedStructWithList + */ +const se_NestedStructWithList = (input: NestedStructWithList, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_LA] != null) { + const memberEntries = se_StringList(input[_LA], context); + if (input[_LA]?.length === 0) { + entries.ListArg = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ListArg.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_queryNestedStructWithMap + */ +const se_NestedStructWithMap = (input: NestedStructWithMap, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_MA] != null) { + const memberEntries = se_StringMap(input[_MA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `MapArg.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_queryNoInputAndOutputInput + */ +const se_NoInputAndOutputInput = (input: NoInputAndOutputInput, context: __SerdeContext): any => { + const entries: any = {}; + return entries; +}; + +/** + * serializeAws_queryPutWithContentEncodingInput + */ +const se_PutWithContentEncodingInput = (input: PutWithContentEncodingInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_e] != null) { + entries[_e] = input[_e]; + } + if (input[_d] != null) { + entries[_d] = input[_d]; + } + return entries; +}; + +/** + * serializeAws_queryQueryIdempotencyTokenAutoFillInput + */ +const se_QueryIdempotencyTokenAutoFillInput = ( + input: QueryIdempotencyTokenAutoFillInput, + context: __SerdeContext +): any => { + const entries: any = {}; + if (input[_t] === undefined) { + input[_t] = generateIdempotencyToken(); + } + if (input[_t] != null) { + entries[_t] = input[_t]; + } + return entries; +}; + +/** + * serializeAws_queryQueryListsInput + */ +const se_QueryListsInput = (input: QueryListsInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_LA] != null) { + const memberEntries = se_StringList(input[_LA], context); + if (input[_LA]?.length === 0) { + entries.ListArg = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ListArg.${key}`; + entries[loc] = value; + }); + } + if (input[_CLA] != null) { + const memberEntries = se_GreetingList(input[_CLA], context); + if (input[_CLA]?.length === 0) { + entries.ComplexListArg = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ComplexListArg.${key}`; + entries[loc] = value; + }); + } + if (input[_FLA] != null) { + const memberEntries = se_StringList(input[_FLA], context); + if (input[_FLA]?.length === 0) { + entries.FlattenedListArg = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `FlattenedListArg.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_LAWXNM] != null) { + const memberEntries = se_ListWithXmlName(input[_LAWXNM], context); + if (input[_LAWXNM]?.length === 0) { + entries.ListArgWithXmlNameMember = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ListArgWithXmlNameMember.${key}`; + entries[loc] = value; + }); + } + if (input[_FLAWXN] != null) { + const memberEntries = se_ListWithXmlName(input[_FLAWXN], context); + if (input[_FLAWXN]?.length === 0) { + entries.Hi = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Hi.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_NWL] != null) { + const memberEntries = se_NestedStructWithList(input[_NWL], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `NestedWithList.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_queryQueryMapsInput + */ +const se_QueryMapsInput = (input: QueryMapsInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_MA] != null) { + const memberEntries = se_StringMap(input[_MA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `MapArg.${key}`; + entries[loc] = value; + }); + } + if (input[_RMA] != null) { + const memberEntries = se_StringMap(input[_RMA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Foo.${key}`; + entries[loc] = value; + }); + } + if (input[_CMA] != null) { + const memberEntries = se_ComplexMap(input[_CMA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `ComplexMapArg.${key}`; + entries[loc] = value; + }); + } + if (input[_MWXMN] != null) { + const memberEntries = se_MapWithXmlName(input[_MWXMN], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `MapWithXmlMemberName.${key}`; + entries[loc] = value; + }); + } + if (input[_FM] != null) { + const memberEntries = se_StringMap(input[_FM], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `FlattenedMap.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_FMWXN] != null) { + const memberEntries = se_MapWithXmlName(input[_FMWXN], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Hi.${key.substring(key.indexOf(".") + 1)}`; + entries[loc] = value; + }); + } + if (input[_MOL] != null) { + const memberEntries = se_MapOfLists(input[_MOL], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `MapOfLists.${key}`; + entries[loc] = value; + }); + } + if (input[_NSWM] != null) { + const memberEntries = se_NestedStructWithMap(input[_NSWM], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `NestedStructWithMap.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_queryQueryTimestampsInput + */ +const se_QueryTimestampsInput = (input: QueryTimestampsInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_nF] != null) { + entries[_nF] = __serializeDateTime(input[_nF]); + } + if (input[_eM] != null) { + entries[_eM] = input[_eM].getTime() / 1_000; + } + if (input[_eT] != null) { + entries[_eT] = input[_eT].getTime() / 1_000; + } + return entries; +}; + +/** + * serializeAws_querySimpleInputParamsInput + */ +const se_SimpleInputParamsInput = (input: SimpleInputParamsInput, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_F] != null) { + entries[_F] = input[_F]; + } + if (input[_B] != null) { + entries[_B] = input[_B]; + } + if (input[_Ba] != null) { + entries[_Ba] = input[_Ba]; + } + if (input[_Bam] != null) { + entries[_Bam] = input[_Bam]; + } + if (input[_FV] != null) { + entries[_FV] = __serializeFloat(input[_FV]); + } + if (input[_Bo] != null) { + entries[_Bo] = __serializeFloat(input[_Bo]); + } + if (input[_Q] != null) { + entries[_Q] = context.base64Encoder(input[_Q]); + } + if (input[_FE] != null) { + entries[_FE] = input[_FE]; + } + if (input[_IE] != null) { + entries[_IE] = input[_IE]; + } + return entries; +}; + +/** + * serializeAws_queryStructArg + */ +const se_StructArg = (input: StructArg, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_SA] != null) { + entries[_SA] = input[_SA]; + } + if (input[_OA] != null) { + entries[_OA] = input[_OA]; + } + if (input[_RA] != null) { + const memberEntries = se_StructArg(input[_RA], context); + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `RecursiveArg.${key}`; + entries[loc] = value; + }); + } + return entries; +}; + +/** + * serializeAws_queryGreetingList + */ +const se_GreetingList = (input: GreetingStruct[], context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + const memberEntries = se_GreetingStruct(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}; + +/** + * serializeAws_queryGreetingStruct + */ +const se_GreetingStruct = (input: GreetingStruct, context: __SerdeContext): any => { + const entries: any = {}; + if (input[_h] != null) { + entries[_h] = input[_h]; + } + return entries; +}; + +/** + * serializeAws_queryStringList + */ +const se_StringList = (input: string[], context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + entries[`member.${counter}`] = entry; + counter++; + } + return entries; +}; + +/** + * serializeAws_queryStringMap + */ +const se_StringMap = (input: Record, context: __SerdeContext): any => { + const entries: any = {}; + let counter = 1; + Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + entries[`entry.${counter}.value`] = input[key as keyof typeof input]!; + counter++; + }); + return entries; +}; + +/** + * deserializeAws_queryComplexError + */ +const de_ComplexError = (output: any, context: __SerdeContext): ComplexError => { + const contents: any = {}; + if (output[_TL] != null) { + contents[_TL] = __expectString(output[_TL]); + } + if (output[_N] != null) { + contents[_N] = de_ComplexNestedErrorData(output[_N], context); + } + return contents; +}; + +/** + * deserializeAws_queryComplexNestedErrorData + */ +const de_ComplexNestedErrorData = (output: any, context: __SerdeContext): ComplexNestedErrorData => { + const contents: any = {}; + if (output[_F] != null) { + contents[_F] = __expectString(output[_F]); + } + return contents; +}; + +/** + * deserializeAws_queryCustomCodeError + */ +const de_CustomCodeError = (output: any, context: __SerdeContext): CustomCodeError => { + const contents: any = {}; + if (output[_M] != null) { + contents[_M] = __expectString(output[_M]); + } + return contents; +}; + +/** + * deserializeAws_queryDatetimeOffsetsOutput + */ +const de_DatetimeOffsetsOutput = (output: any, context: __SerdeContext): DatetimeOffsetsOutput => { + const contents: any = {}; + if (output[_da] != null) { + contents[_da] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_da])); + } + return contents; +}; + +/** + * deserializeAws_queryEmptyInputAndEmptyOutputOutput + */ +const de_EmptyInputAndEmptyOutputOutput = (output: any, context: __SerdeContext): EmptyInputAndEmptyOutputOutput => { + const contents: any = {}; + return contents; +}; + +/** + * deserializeAws_queryFlattenedXmlMapOutput + */ +const de_FlattenedXmlMapOutput = (output: any, context: __SerdeContext): FlattenedXmlMapOutput => { + const contents: any = {}; + if (output.myMap === "") { + contents[_mM] = {}; + } else if (output[_mM] != null) { + contents[_mM] = de_FooEnumMap(__getArrayIfSingleItem(output[_mM]), context); + } + return contents; +}; + +/** + * deserializeAws_queryFlattenedXmlMapWithXmlNameOutput + */ +const de_FlattenedXmlMapWithXmlNameOutput = ( + output: any, + context: __SerdeContext +): FlattenedXmlMapWithXmlNameOutput => { + const contents: any = {}; + if (output.KVP === "") { + contents[_mM] = {}; + } else if (output[_KVP] != null) { + contents[_mM] = de_FlattenedXmlMapWithXmlNameOutputMap(__getArrayIfSingleItem(output[_KVP]), context); + } + return contents; +}; + +/** + * deserializeAws_queryFlattenedXmlMapWithXmlNameOutputMap + */ +const de_FlattenedXmlMapWithXmlNameOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["V"] === null) { + return acc; + } + acc[pair["K"]] = __expectString(pair["V"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_queryFlattenedXmlMapWithXmlNamespaceOutput + */ +const de_FlattenedXmlMapWithXmlNamespaceOutput = ( + output: any, + context: __SerdeContext +): FlattenedXmlMapWithXmlNamespaceOutput => { + const contents: any = {}; + if (output.KVP === "") { + contents[_mM] = {}; + } else if (output[_KVP] != null) { + contents[_mM] = de_FlattenedXmlMapWithXmlNamespaceOutputMap(__getArrayIfSingleItem(output[_KVP]), context); + } + return contents; +}; + +/** + * deserializeAws_queryFlattenedXmlMapWithXmlNamespaceOutputMap + */ +const de_FlattenedXmlMapWithXmlNamespaceOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["V"] === null) { + return acc; + } + acc[pair["K"]] = __expectString(pair["V"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_queryFractionalSecondsOutput + */ +const de_FractionalSecondsOutput = (output: any, context: __SerdeContext): FractionalSecondsOutput => { + const contents: any = {}; + if (output[_da] != null) { + contents[_da] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_da])); + } + return contents; +}; + +/** + * deserializeAws_queryGreetingWithErrorsOutput + */ +const de_GreetingWithErrorsOutput = (output: any, context: __SerdeContext): GreetingWithErrorsOutput => { + const contents: any = {}; + if (output[_g] != null) { + contents[_g] = __expectString(output[_g]); + } + return contents; +}; + +/** + * deserializeAws_queryIgnoresWrappingXmlNameOutput + */ +const de_IgnoresWrappingXmlNameOutput = (output: any, context: __SerdeContext): IgnoresWrappingXmlNameOutput => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + return contents; +}; + +/** + * deserializeAws_queryInvalidGreeting + */ +const de_InvalidGreeting = (output: any, context: __SerdeContext): InvalidGreeting => { + const contents: any = {}; + if (output[_M] != null) { + contents[_M] = __expectString(output[_M]); + } + return contents; +}; + +/** + * deserializeAws_queryListWithMemberNamespace + */ +const de_ListWithMemberNamespace = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_queryListWithNamespace + */ +const de_ListWithNamespace = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_queryNoInputAndOutputOutput + */ +const de_NoInputAndOutputOutput = (output: any, context: __SerdeContext): NoInputAndOutputOutput => { + const contents: any = {}; + return contents; +}; + +/** + * deserializeAws_queryRecursiveXmlShapesOutput + */ +const de_RecursiveXmlShapesOutput = (output: any, context: __SerdeContext): RecursiveXmlShapesOutput => { + const contents: any = {}; + if (output[_n] != null) { + contents[_n] = de_RecursiveXmlShapesOutputNested1(output[_n], context); + } + return contents; +}; + +/** + * deserializeAws_queryRecursiveXmlShapesOutputNested1 + */ +const de_RecursiveXmlShapesOutputNested1 = (output: any, context: __SerdeContext): RecursiveXmlShapesOutputNested1 => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + if (output[_n] != null) { + contents[_n] = de_RecursiveXmlShapesOutputNested2(output[_n], context); + } + return contents; +}; + +/** + * deserializeAws_queryRecursiveXmlShapesOutputNested2 + */ +const de_RecursiveXmlShapesOutputNested2 = (output: any, context: __SerdeContext): RecursiveXmlShapesOutputNested2 => { + const contents: any = {}; + if (output[_b] != null) { + contents[_b] = __expectString(output[_b]); + } + if (output[_rM] != null) { + contents[_rM] = de_RecursiveXmlShapesOutputNested1(output[_rM], context); + } + return contents; +}; + +/** + * deserializeAws_queryRenamedListMembers + */ +const de_RenamedListMembers = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_querySimpleScalarXmlPropertiesOutput + */ +const de_SimpleScalarXmlPropertiesOutput = (output: any, context: __SerdeContext): SimpleScalarXmlPropertiesOutput => { + const contents: any = {}; + if (output[_sV] != null) { + contents[_sV] = __expectString(output[_sV]); + } + if (output[_eSV] != null) { + contents[_eSV] = __expectString(output[_eSV]); + } + if (output[_tBV] != null) { + contents[_tBV] = __parseBoolean(output[_tBV]); + } + if (output[_fBV] != null) { + contents[_fBV] = __parseBoolean(output[_fBV]); + } + if (output[_bV] != null) { + contents[_bV] = __strictParseByte(output[_bV]) as number; + } + if (output[_sVh] != null) { + contents[_sVh] = __strictParseShort(output[_sVh]) as number; + } + if (output[_iV] != null) { + contents[_iV] = __strictParseInt32(output[_iV]) as number; + } + if (output[_lV] != null) { + contents[_lV] = __strictParseLong(output[_lV]) as number; + } + if (output[_fV] != null) { + contents[_fV] = __strictParseFloat(output[_fV]) as number; + } + if (output[_DD] != null) { + contents[_dV] = __strictParseFloat(output[_DD]) as number; + } + return contents; +}; + +/** + * deserializeAws_queryStructureList + */ +const de_StructureList = (output: any, context: __SerdeContext): StructureListMember[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StructureListMember(entry, context); + }); +}; + +/** + * deserializeAws_queryStructureListMember + */ +const de_StructureListMember = (output: any, context: __SerdeContext): StructureListMember => { + const contents: any = {}; + if (output[_v] != null) { + contents[_a] = __expectString(output[_v]); + } + if (output[_o] != null) { + contents[_b_] = __expectString(output[_o]); + } + return contents; +}; + +/** + * deserializeAws_queryXmlBlobsOutput + */ +const de_XmlBlobsOutput = (output: any, context: __SerdeContext): XmlBlobsOutput => { + const contents: any = {}; + if (output[_d] != null) { + contents[_d] = context.base64Decoder(output[_d]); + } + return contents; +}; + +/** + * deserializeAws_queryXmlEnumsOutput + */ +const de_XmlEnumsOutput = (output: any, context: __SerdeContext): XmlEnumsOutput => { + const contents: any = {}; + if (output[_fE] != null) { + contents[_fE] = __expectString(output[_fE]); + } + if (output[_fEo] != null) { + contents[_fEo] = __expectString(output[_fEo]); + } + if (output[_fEoo] != null) { + contents[_fEoo] = __expectString(output[_fEoo]); + } + if (output.fooEnumList === "") { + contents[_fEL] = []; + } else if (output[_fEL] != null && output[_fEL][_m] != null) { + contents[_fEL] = de_FooEnumList(__getArrayIfSingleItem(output[_fEL][_m]), context); + } + if (output.fooEnumSet === "") { + contents[_fES] = []; + } else if (output[_fES] != null && output[_fES][_m] != null) { + contents[_fES] = de_FooEnumSet(__getArrayIfSingleItem(output[_fES][_m]), context); + } + if (output.fooEnumMap === "") { + contents[_fEM] = {}; + } else if (output[_fEM] != null && output[_fEM][_en] != null) { + contents[_fEM] = de_FooEnumMap(__getArrayIfSingleItem(output[_fEM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_queryXmlIntEnumsOutput + */ +const de_XmlIntEnumsOutput = (output: any, context: __SerdeContext): XmlIntEnumsOutput => { + const contents: any = {}; + if (output[_iE] != null) { + contents[_iE] = __strictParseInt32(output[_iE]) as number; + } + if (output[_iEn] != null) { + contents[_iEn] = __strictParseInt32(output[_iEn]) as number; + } + if (output[_iEnt] != null) { + contents[_iEnt] = __strictParseInt32(output[_iEnt]) as number; + } + if (output.intEnumList === "") { + contents[_iEL] = []; + } else if (output[_iEL] != null && output[_iEL][_m] != null) { + contents[_iEL] = de_IntegerEnumList(__getArrayIfSingleItem(output[_iEL][_m]), context); + } + if (output.intEnumSet === "") { + contents[_iES] = []; + } else if (output[_iES] != null && output[_iES][_m] != null) { + contents[_iES] = de_IntegerEnumSet(__getArrayIfSingleItem(output[_iES][_m]), context); + } + if (output.intEnumMap === "") { + contents[_iEM] = {}; + } else if (output[_iEM] != null && output[_iEM][_en] != null) { + contents[_iEM] = de_IntegerEnumMap(__getArrayIfSingleItem(output[_iEM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_queryXmlListsOutput + */ +const de_XmlListsOutput = (output: any, context: __SerdeContext): XmlListsOutput => { + const contents: any = {}; + if (output.stringList === "") { + contents[_sL] = []; + } else if (output[_sL] != null && output[_sL][_m] != null) { + contents[_sL] = de_StringList(__getArrayIfSingleItem(output[_sL][_m]), context); + } + if (output.stringSet === "") { + contents[_sS] = []; + } else if (output[_sS] != null && output[_sS][_m] != null) { + contents[_sS] = de_StringSet(__getArrayIfSingleItem(output[_sS][_m]), context); + } + if (output.integerList === "") { + contents[_iL] = []; + } else if (output[_iL] != null && output[_iL][_m] != null) { + contents[_iL] = de_IntegerList(__getArrayIfSingleItem(output[_iL][_m]), context); + } + if (output.booleanList === "") { + contents[_bL] = []; + } else if (output[_bL] != null && output[_bL][_m] != null) { + contents[_bL] = de_BooleanList(__getArrayIfSingleItem(output[_bL][_m]), context); + } + if (output.timestampList === "") { + contents[_tL] = []; + } else if (output[_tL] != null && output[_tL][_m] != null) { + contents[_tL] = de_TimestampList(__getArrayIfSingleItem(output[_tL][_m]), context); + } + if (output.enumList === "") { + contents[_eL] = []; + } else if (output[_eL] != null && output[_eL][_m] != null) { + contents[_eL] = de_FooEnumList(__getArrayIfSingleItem(output[_eL][_m]), context); + } + if (output.intEnumList === "") { + contents[_iEL] = []; + } else if (output[_iEL] != null && output[_iEL][_m] != null) { + contents[_iEL] = de_IntegerEnumList(__getArrayIfSingleItem(output[_iEL][_m]), context); + } + if (output.nestedStringList === "") { + contents[_nSL] = []; + } else if (output[_nSL] != null && output[_nSL][_m] != null) { + contents[_nSL] = de_NestedStringList(__getArrayIfSingleItem(output[_nSL][_m]), context); + } + if (output.renamed === "") { + contents[_rLM] = []; + } else if (output[_r] != null && output[_r][_i] != null) { + contents[_rLM] = de_RenamedListMembers(__getArrayIfSingleItem(output[_r][_i]), context); + } + if (output.flattenedList === "") { + contents[_fL] = []; + } else if (output[_fL] != null) { + contents[_fL] = de_RenamedListMembers(__getArrayIfSingleItem(output[_fL]), context); + } + if (output.customName === "") { + contents[_fLl] = []; + } else if (output[_cN] != null) { + contents[_fLl] = de_RenamedListMembers(__getArrayIfSingleItem(output[_cN]), context); + } + if (output.flattenedListWithMemberNamespace === "") { + contents[_fLWMN] = []; + } else if (output[_fLWMN] != null) { + contents[_fLWMN] = de_ListWithMemberNamespace(__getArrayIfSingleItem(output[_fLWMN]), context); + } + if (output.flattenedListWithNamespace === "") { + contents[_fLWN] = []; + } else if (output[_fLWN] != null) { + contents[_fLWN] = de_ListWithNamespace(__getArrayIfSingleItem(output[_fLWN]), context); + } + if (output.myStructureList === "") { + contents[_sLt] = []; + } else if (output[_mSL] != null && output[_mSL][_i] != null) { + contents[_sLt] = de_StructureList(__getArrayIfSingleItem(output[_mSL][_i]), context); + } + return contents; +}; + +/** + * deserializeAws_queryXmlMapsOutput + */ +const de_XmlMapsOutput = (output: any, context: __SerdeContext): XmlMapsOutput => { + const contents: any = {}; + if (output.myMap === "") { + contents[_mM] = {}; + } else if (output[_mM] != null && output[_mM][_en] != null) { + contents[_mM] = de_XmlMapsOutputMap(__getArrayIfSingleItem(output[_mM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_queryXmlMapsOutputMap + */ +const de_XmlMapsOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = de_GreetingStruct(pair["value"], context); + return acc; + }, {}); +}; + +/** + * deserializeAws_queryXmlMapsXmlNameOutput + */ +const de_XmlMapsXmlNameOutput = (output: any, context: __SerdeContext): XmlMapsXmlNameOutput => { + const contents: any = {}; + if (output.myMap === "") { + contents[_mM] = {}; + } else if (output[_mM] != null && output[_mM][_en] != null) { + contents[_mM] = de_XmlMapsXmlNameOutputMap(__getArrayIfSingleItem(output[_mM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_queryXmlMapsXmlNameOutputMap + */ +const de_XmlMapsXmlNameOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["Setting"] === null) { + return acc; + } + acc[pair["Attribute"]] = de_GreetingStruct(pair["Setting"], context); + return acc; + }, {}); +}; + +/** + * deserializeAws_queryXmlNamespacedList + */ +const de_XmlNamespacedList = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_queryXmlNamespaceNested + */ +const de_XmlNamespaceNested = (output: any, context: __SerdeContext): XmlNamespaceNested => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + if (output.values === "") { + contents[_va] = []; + } else if (output[_va] != null && output[_va][_m] != null) { + contents[_va] = de_XmlNamespacedList(__getArrayIfSingleItem(output[_va][_m]), context); + } + return contents; +}; + +/** + * deserializeAws_queryXmlNamespacesOutput + */ +const de_XmlNamespacesOutput = (output: any, context: __SerdeContext): XmlNamespacesOutput => { + const contents: any = {}; + if (output[_n] != null) { + contents[_n] = de_XmlNamespaceNested(output[_n], context); + } + return contents; +}; + +/** + * deserializeAws_queryXmlTimestampsOutput + */ +const de_XmlTimestampsOutput = (output: any, context: __SerdeContext): XmlTimestampsOutput => { + const contents: any = {}; + if (output[_no] != null) { + contents[_no] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_no])); + } + if (output[_dT] != null) { + contents[_dT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_dT])); + } + if (output[_dTOT] != null) { + contents[_dTOT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_dTOT])); + } + if (output[_eS] != null) { + contents[_eS] = __expectNonNull(__parseEpochTimestamp(output[_eS])); + } + if (output[_eSOT] != null) { + contents[_eSOT] = __expectNonNull(__parseEpochTimestamp(output[_eSOT])); + } + if (output[_hD] != null) { + contents[_hD] = __expectNonNull(__parseRfc7231DateTime(output[_hD])); + } + if (output[_hDOT] != null) { + contents[_hDOT] = __expectNonNull(__parseRfc7231DateTime(output[_hDOT])); + } + return contents; +}; + +/** + * deserializeAws_queryBooleanList + */ +const de_BooleanList = (output: any, context: __SerdeContext): boolean[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __parseBoolean(entry); + }); +}; + +/** + * deserializeAws_queryFooEnumList + */ +const de_FooEnumList = (output: any, context: __SerdeContext): FooEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_queryFooEnumMap + */ +const de_FooEnumMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = __expectString(pair["value"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_queryFooEnumSet + */ +const de_FooEnumSet = (output: any, context: __SerdeContext): FooEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_queryGreetingStruct + */ +const de_GreetingStruct = (output: any, context: __SerdeContext): GreetingStruct => { + const contents: any = {}; + if (output[_h] != null) { + contents[_h] = __expectString(output[_h]); + } + return contents; +}; + +/** + * deserializeAws_queryIntegerEnumList + */ +const de_IntegerEnumList = (output: any, context: __SerdeContext): IntegerEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_queryIntegerEnumMap + */ +const de_IntegerEnumMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = __strictParseInt32(pair["value"]) as number; + return acc; + }, {}); +}; + +/** + * deserializeAws_queryIntegerEnumSet + */ +const de_IntegerEnumSet = (output: any, context: __SerdeContext): IntegerEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_queryIntegerList + */ +const de_IntegerList = (output: any, context: __SerdeContext): number[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_queryNestedStringList + */ +const de_NestedStringList = (output: any, context: __SerdeContext): string[][] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StringList(__getArrayIfSingleItem(entry["member"]), context); + }); +}; + +/** + * deserializeAws_queryStringList + */ +const de_StringList = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_queryStringSet + */ +const de_StringSet = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_queryTimestampList + */ +const de_TimestampList = (output: any, context: __SerdeContext): Date[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectNonNull(__parseRfc3339DateTimeWithOffset(entry)); + }); +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const throwDefaultError = withBaseException(__BaseException); +const buildHttpRpcRequest = async ( + context: __SerdeContext, + headers: __HeaderBag, + path: string, + resolvedHostname: string | undefined, + body: any +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents: any = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/x-www-form-urlencoded", +}; + +const _ = "2020-01-08"; +const _A = "Action"; +const _B = "Bar"; +const _Ba = "Baz"; +const _Bam = "Bam"; +const _Bo = "Boo"; +const _CLA = "ComplexListArg"; +const _CMA = "ComplexMapArg"; +const _DD = "DoubleDribble"; +const _DO = "DatetimeOffsets"; +const _EIAEO = "EmptyInputAndEmptyOutput"; +const _EO = "EndpointOperation"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _F = "Foo"; +const _FE = "FooEnum"; +const _FLA = "FlattenedListArg"; +const _FLAWXN = "FlattenedListArgWithXmlName"; +const _FM = "FlattenedMap"; +const _FMWXN = "FlattenedMapWithXmlName"; +const _FS = "FractionalSeconds"; +const _FV = "FloatValue"; +const _FXM = "FlattenedXmlMap"; +const _FXMWXN = "FlattenedXmlMapWithXmlName"; +const _FXMWXNl = "FlattenedXmlMapWithXmlNamespace"; +const _GWE = "GreetingWithErrors"; +const _HWPO = "HostWithPathOperation"; +const _IE = "IntegerEnum"; +const _IWXN = "IgnoresWrappingXmlName"; +const _KVP = "KVP"; +const _LA = "ListArg"; +const _LAWXNM = "ListArgWithXmlNameMember"; +const _M = "Message"; +const _MA = "MapArg"; +const _MOL = "MapOfLists"; +const _MWXMN = "MapWithXmlMemberName"; +const _N = "Nested"; +const _NIANO = "NoInputAndNoOutput"; +const _NIAO = "NoInputAndOutput"; +const _NS = "NestedStructures"; +const _NSWM = "NestedStructWithMap"; +const _NWL = "NestedWithList"; +const _OA = "OtherArg"; +const _PWCE = "PutWithContentEncoding"; +const _Q = "Qux"; +const _QITAF = "QueryIdempotencyTokenAutoFill"; +const _QL = "QueryLists"; +const _QM = "QueryMaps"; +const _QT = "QueryTimestamps"; +const _RA = "RecursiveArg"; +const _RMA = "RenamedMapArg"; +const _RXS = "RecursiveXmlShapes"; +const _SA = "StringArg"; +const _SIP = "SimpleInputParams"; +const _SSXP = "SimpleScalarXmlProperties"; +const _TL = "TopLevel"; +const _V = "Version"; +const _XB = "XmlBlobs"; +const _XE = "XmlEnums"; +const _XEB = "XmlEmptyBlobs"; +const _XEL = "XmlEmptyLists"; +const _XEM = "XmlEmptyMaps"; +const _XIE = "XmlIntEnums"; +const _XL = "XmlLists"; +const _XM = "XmlMaps"; +const _XMXN = "XmlMapsXmlName"; +const _XN = "XmlNamespaces"; +const _XT = "XmlTimestamps"; +const _a = "a"; +const _b = "bar"; +const _bL = "booleanList"; +const _bV = "byteValue"; +const _b_ = "b"; +const _cN = "customName"; +const _d = "data"; +const _dT = "dateTime"; +const _dTOT = "dateTimeOnTarget"; +const _dV = "doubleValue"; +const _da = "datetime"; +const _e = "encoding"; +const _eL = "enumList"; +const _eM = "epochMember"; +const _eS = "epochSeconds"; +const _eSOT = "epochSecondsOnTarget"; +const _eSV = "emptyStringValue"; +const _eT = "epochTarget"; +const _en = "entry"; +const _f = "foo"; +const _fBV = "falseBooleanValue"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fL = "flattenedList"; +const _fLWMN = "flattenedListWithMemberNamespace"; +const _fLWN = "flattenedListWithNamespace"; +const _fLl = "flattenedList2"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "hi"; +const _hD = "httpDate"; +const _hDOT = "httpDateOnTarget"; +const _i = "item"; +const _iE = "intEnum1"; +const _iEL = "intEnumList"; +const _iEM = "intEnumMap"; +const _iES = "intEnumSet"; +const _iEn = "intEnum2"; +const _iEnt = "intEnum3"; +const _iL = "integerList"; +const _iV = "integerValue"; +const _l = "label"; +const _lV = "longValue"; +const _m = "member"; +const _mM = "myMap"; +const _mSL = "myStructureList"; +const _n = "nested"; +const _nF = "normalFormat"; +const _nSL = "nestedStringList"; +const _no = "normal"; +const _o = "other"; +const _r = "renamed"; +const _rLM = "renamedListMembers"; +const _rM = "recursiveMember"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sS = "stringSet"; +const _sV = "stringValue"; +const _sVh = "shortValue"; +const _t = "token"; +const _tBV = "trueBooleanValue"; +const _tL = "timestampList"; +const _v = "value"; +const _va = "values"; + +const buildFormUrlencodedString = (formEntries: Record): string => + Object.entries(formEntries) + .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) + .join("&"); + +const loadQueryErrorCode = (output: __HttpResponse, data: any): string | undefined => { + if (data.Error?.Code !== undefined) { + return data.Error.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } +}; diff --git a/private/aws-protocoltests-query-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-query-schema/src/runtimeConfig.browser.ts new file mode 100644 index 0000000000000..dbab3039f25ee --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/runtimeConfig.browser.ts @@ -0,0 +1,51 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { QueryProtocolClientConfig } from "./QueryProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/private/aws-protocoltests-query-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-query-schema/src/runtimeConfig.native.ts new file mode 100644 index 0000000000000..fa1b611375720 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { QueryProtocolClientConfig } from "./QueryProtocolClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/private/aws-protocoltests-query-schema/src/runtimeConfig.shared.ts b/private/aws-protocoltests-query-schema/src/runtimeConfig.shared.ts new file mode 100644 index 0000000000000..53270b1ffe1a6 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/runtimeConfig.shared.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { AwsQueryProtocol } from "@aws-sdk/core/protocols"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultQueryProtocolHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { QueryProtocolClientConfig } from "./QueryProtocolClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { + return { + apiVersion: "2020-01-08", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultQueryProtocolHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + protocol: + config?.protocol ?? + new AwsQueryProtocol({ + defaultNamespace: "aws.protocoltests.query", + xmlNamespace: "https://example.com/", + version: "2020-01-08", + }), + serviceId: config?.serviceId ?? "Query Protocol", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/private/aws-protocoltests-query-schema/src/runtimeConfig.ts b/private/aws-protocoltests-query-schema/src/runtimeConfig.ts new file mode 100644 index 0000000000000..f7910d170797c --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/runtimeConfig.ts @@ -0,0 +1,81 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { QueryProtocolClientConfig } from "./QueryProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: + config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), + retryMode: + config?.retryMode ?? + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; diff --git a/private/aws-protocoltests-query-schema/src/runtimeExtensions.ts b/private/aws-protocoltests-query-schema/src/runtimeExtensions.ts new file mode 100644 index 0000000000000..1f2a7f7e98bf6 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/runtimeExtensions.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { QueryProtocolExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: QueryProtocolExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: QueryProtocolExtensionConfiguration = Object.assign( + getAwsRegionExtensionConfiguration(runtimeConfig), + getDefaultExtensionConfiguration(runtimeConfig), + getHttpHandlerExtensionConfiguration(runtimeConfig), + getHttpAuthExtensionConfiguration(runtimeConfig) + ); + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return Object.assign( + runtimeConfig, + resolveAwsRegionExtensionConfiguration(extensionConfiguration), + resolveDefaultRuntimeConfig(extensionConfiguration), + resolveHttpHandlerRuntimeConfig(extensionConfiguration), + resolveHttpAuthRuntimeConfig(extensionConfiguration) + ); +}; diff --git a/private/aws-protocoltests-query-schema/src/schemas/schemas.ts b/private/aws-protocoltests-query-schema/src/schemas/schemas.ts new file mode 100644 index 0000000000000..7e7828e6f4aa2 --- /dev/null +++ b/private/aws-protocoltests-query-schema/src/schemas/schemas.ts @@ -0,0 +1,997 @@ +const _ = ""; +const _A = "Attribute"; +const _B = "Boolean"; +const _BL = "BooleanList"; +const _Ba = "Bar"; +const _Bam = "Bam"; +const _Baz = "Baz"; +const _Bl = "Blob"; +const _Bo = "Boo"; +const _By = "Byte"; +const _CCE = "CustomCodeError"; +const _CE = "ComplexError"; +const _CE_ = "Content-Encoding"; +const _CLA = "ComplexListArg"; +const _CM = "ComplexMap"; +const _CMA = "ComplexMapArg"; +const _CNED = "ComplexNestedErrorData"; +const _D = "Double"; +const _DD = "DoubleDribble"; +const _DO = "DatetimeOffsets"; +const _DOO = "DatetimeOffsetsOutput"; +const _DT = "DateTime"; +const _EIAEO = "EmptyInputAndEmptyOutput"; +const _EIAEOI = "EmptyInputAndEmptyOutputInput"; +const _EIAEOO = "EmptyInputAndEmptyOutputOutput"; +const _EO = "EndpointOperation"; +const _ES = "EpochSeconds"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FEL = "FooEnumList"; +const _FEM = "FooEnumMap"; +const _FES = "FooEnumSet"; +const _FLA = "FlattenedListArg"; +const _FLAWXN = "FlattenedListArgWithXmlName"; +const _FM = "FlattenedMap"; +const _FMWXN = "FlattenedMapWithXmlName"; +const _FS = "FractionalSeconds"; +const _FSO = "FractionalSecondsOutput"; +const _FV = "FloatValue"; +const _FXM = "FlattenedXmlMap"; +const _FXMO = "FlattenedXmlMapOutput"; +const _FXMWXN = "FlattenedXmlMapWithXmlName"; +const _FXMWXNO = "FlattenedXmlMapWithXmlNameOutput"; +const _FXMWXNOM = "FlattenedXmlMapWithXmlNameOutputMap"; +const _FXMWXNOMl = "FlattenedXmlMapWithXmlNamespaceOutputMap"; +const _FXMWXNOl = "FlattenedXmlMapWithXmlNamespaceOutput"; +const _FXMWXNl = "FlattenedXmlMapWithXmlNamespace"; +const _Fo = "Foo"; +const _GL = "GreetingList"; +const _GS = "GreetingStruct"; +const _GWE = "GreetingWithErrors"; +const _GWEO = "GreetingWithErrorsOutput"; +const _H = "Hi"; +const _HD = "HttpDate"; +const _HLI = "HostLabelInput"; +const _HWPO = "HostWithPathOperation"; +const _I = "Integer"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IEM = "IntegerEnumMap"; +const _IES = "IntegerEnumSet"; +const _IG = "InvalidGreeting"; +const _IL = "IntegerList"; +const _IM = "IgnoreMe"; +const _IWXN = "IgnoresWrappingXmlName"; +const _IWXNO = "IgnoresWrappingXmlNameOutput"; +const _K = "K"; +const _KVP = "KVP"; +const _L = "Long"; +const _LA = "ListArg"; +const _LAWXNM = "ListArgWithXmlNameMember"; +const _LWMN = "ListWithMemberNamespace"; +const _LWN = "ListWithNamespace"; +const _LWXN = "ListWithXmlName"; +const _M = "Message"; +const _MA = "MapArg"; +const _MOL = "MapOfLists"; +const _MWXMN = "MapWithXmlMemberName"; +const _MWXN = "MapWithXmlName"; +const _N = "Nested"; +const _NIANO = "NoInputAndNoOutput"; +const _NIAO = "NoInputAndOutput"; +const _NIAOI = "NoInputAndOutputInput"; +const _NIAOO = "NoInputAndOutputOutput"; +const _NS = "NestedStructures"; +const _NSI = "NestedStructuresInput"; +const _NSL = "NestedStringList"; +const _NSWL = "NestedStructWithList"; +const _NSWM = "NestedStructWithMap"; +const _NWL = "NestedWithList"; +const _OA = "OtherArg"; +const _PWCE = "PutWithContentEncoding"; +const _PWCEI = "PutWithContentEncodingInput"; +const _Q = "Qux"; +const _QITAF = "QueryIdempotencyTokenAutoFill"; +const _QITAFI = "QueryIdempotencyTokenAutoFillInput"; +const _QL = "QueryLists"; +const _QLI = "QueryListsInput"; +const _QM = "QueryMaps"; +const _QMI = "QueryMapsInput"; +const _QT = "QueryTimestamps"; +const _QTI = "QueryTimestampsInput"; +const _RA = "RecursiveArg"; +const _RLM = "RenamedListMembers"; +const _RMA = "RenamedMapArg"; +const _RXS = "RecursiveXmlShapes"; +const _RXSO = "RecursiveXmlShapesOutput"; +const _RXSON = "RecursiveXmlShapesOutputNested1"; +const _RXSONe = "RecursiveXmlShapesOutputNested2"; +const _S = "String"; +const _SA = "StructArg"; +const _SAt = "StringArg"; +const _SIP = "SimpleInputParams"; +const _SIPI = "SimpleInputParamsInput"; +const _SL = "StringList"; +const _SLM = "StructureListMember"; +const _SLt = "StructureList"; +const _SM = "StringMap"; +const _SS = "StringSet"; +const _SSXP = "SimpleScalarXmlProperties"; +const _SSXPO = "SimpleScalarXmlPropertiesOutput"; +const _Se = "Setting"; +const _Sh = "Short"; +const _T = "Timestamp"; +const _TL = "TimestampList"; +const _TLo = "TopLevel"; +const _V = "V"; +const _XB = "XmlBlobs"; +const _XBO = "XmlBlobsOutput"; +const _XE = "XmlEnums"; +const _XEB = "XmlEmptyBlobs"; +const _XEL = "XmlEmptyLists"; +const _XEM = "XmlEmptyMaps"; +const _XEO = "XmlEnumsOutput"; +const _XIE = "XmlIntEnums"; +const _XIEO = "XmlIntEnumsOutput"; +const _XL = "XmlLists"; +const _XLO = "XmlListsOutput"; +const _XM = "XmlMaps"; +const _XMO = "XmlMapsOutput"; +const _XMOM = "XmlMapsOutputMap"; +const _XMXN = "XmlMapsXmlName"; +const _XMXNO = "XmlMapsXmlNameOutput"; +const _XMXNOM = "XmlMapsXmlNameOutputMap"; +const _XN = "XmlNamespaces"; +const _XNL = "XmlNamespacedList"; +const _XNN = "XmlNamespaceNested"; +const _XNO = "XmlNamespacesOutput"; +const _XT = "XmlTimestamps"; +const _XTO = "XmlTimestampsOutput"; +const _a = "a"; +const _aQE = "awsQueryError"; +const _b = "bar"; +const _bL = "booleanList"; +const _bV = "byteValue"; +const _b_ = "b"; +const _ba = "baz"; +const _c = "client"; +const _cN = "customName"; +const _d = "datetime"; +const _dT = "dateTime"; +const _dTOT = "dateTimeOnTarget"; +const _dV = "doubleValue"; +const _da = "data"; +const _e = "error"; +const _eL = "enumList"; +const _eM = "epochMember"; +const _eS = "epochSeconds"; +const _eSOT = "epochSecondsOnTarget"; +const _eSV = "emptyStringValue"; +const _eT = "epochTarget"; +const _en = "encoding"; +const _end = "endpoint"; +const _f = "foo"; +const _fBV = "falseBooleanValue"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fL = "flattenedList"; +const _fLWMN = "flattenedListWithMemberNamespace"; +const _fLWN = "flattenedListWithNamespace"; +const _fLl = "flattenedList2"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "http://boo.com"; +const _hD = "httpDate"; +const _hDOT = "httpDateOnTarget"; +const _hH = "httpHeader"; +const _hL = "hostLabel"; +const _hi = "hi"; +const _hk = "https://the-key.example.com"; +const _hl = "https://xml-list.example.com"; +const _hm = "https://the-member.example.com"; +const _hm_ = "https://xml-member.example.com"; +const _ht = "http://baz.com"; +const _htt = "http://qux.com"; +const _http = "http://foo.com"; +const _httpb = "http://bux.com"; +const _hv = "https://the-value.example.com"; +const _i = "item"; +const _iE = "intEnum1"; +const _iEL = "intEnumList"; +const _iEM = "intEnumMap"; +const _iES = "intEnumSet"; +const _iEn = "intEnum2"; +const _iEnt = "intEnum3"; +const _iL = "integerList"; +const _iV = "integerValue"; +const _l = "label"; +const _lV = "longValue"; +const _mM = "myMap"; +const _mSL = "myStructureList"; +const _n = "nested"; +const _nF = "normalFormat"; +const _nSL = "nestedStringList"; +const _no = "normal"; +const _o = "other"; +const _r = "renamed"; +const _rLM = "renamedListMembers"; +const _rM = "recursiveMember"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sS = "stringSet"; +const _sV = "stringValue"; +const _sVh = "shortValue"; +const _t = "token"; +const _tBV = "trueBooleanValue"; +const _tL = "timestampList"; +const _v = "value"; +const _va = "values"; +const _xF = "xmlFlattened"; +const _xN = "xmlName"; +const _xNm = "xmlNamespace"; +const n0 = "aws.protocoltests.query"; +const n1 = "aws.protocoltests.shared"; + +// smithy-typescript generated code +import { error, list, map, op, struct } from "@smithy/core/schema"; + +import { + ComplexError as __ComplexError, + CustomCodeError as __CustomCodeError, + InvalidGreeting as __InvalidGreeting, +} from "../models/index"; +import { QueryProtocolServiceException as __QueryProtocolServiceException } from "../models/QueryProtocolServiceException"; + +/* eslint no-var: 0 */ + +export var ComplexError = error( + n0, + _CE, + { + [_e]: _c, + }, + [_TLo, _N], + [0, () => ComplexNestedErrorData], + + __ComplexError +); +export var ComplexNestedErrorData = struct(n0, _CNED, 0, [_Fo], [0]); +export var CustomCodeError = error( + n0, + _CCE, + { + [_e]: _c, + [_aQE]: [`Customized`, 402], + }, + [_M], + [0], + + __CustomCodeError +); +export var DatetimeOffsetsOutput = struct(n0, _DOO, 0, [_d], [5]); +export var EmptyInputAndEmptyOutputInput = struct(n0, _EIAEOI, 0, [], []); +export var EmptyInputAndEmptyOutputOutput = struct(n0, _EIAEOO, 0, [], []); +export var FlattenedXmlMapOutput = struct( + n0, + _FXMO, + 0, + [_mM], + [ + [ + 128 | 0, + { + [_xF]: 1, + }, + ], + ] +); +export var FlattenedXmlMapWithXmlNameOutput = struct( + n0, + _FXMWXNO, + 0, + [_mM], + [ + [ + () => FlattenedXmlMapWithXmlNameOutputMap, + { + [_xN]: _KVP, + [_xF]: 1, + }, + ], + ] +); +export var FlattenedXmlMapWithXmlNamespaceOutput = struct( + n0, + _FXMWXNOl, + 0, + [_mM], + [ + [ + () => FlattenedXmlMapWithXmlNamespaceOutputMap, + { + [_xN]: _KVP, + [_xF]: 1, + [_xNm]: [_, _hm], + }, + ], + ] +); +export var FractionalSecondsOutput = struct(n0, _FSO, 0, [_d], [5]); +export var GreetingWithErrorsOutput = struct(n0, _GWEO, 0, [_g], [0]); +export var HostLabelInput = struct( + n0, + _HLI, + 0, + [_l], + [ + [ + 0, + { + [_hL]: 1, + }, + ], + ] +); +export var IgnoresWrappingXmlNameOutput = struct( + n0, + _IWXNO, + { + [_xN]: _IM, + }, + [_f], + [0] +); +export var InvalidGreeting = error( + n0, + _IG, + { + [_e]: _c, + }, + [_M], + [0], + + __InvalidGreeting +); +export var NestedStructuresInput = struct(n0, _NSI, 0, [_N], [() => StructArg]); +export var NestedStructWithList = struct(n0, _NSWL, 0, [_LA], [64 | 0]); +export var NestedStructWithMap = struct(n0, _NSWM, 0, [_MA], [128 | 0]); +export var NoInputAndOutputInput = struct(n0, _NIAOI, 0, [], []); +export var NoInputAndOutputOutput = struct(n0, _NIAOO, 0, [], []); +export var PutWithContentEncodingInput = struct( + n0, + _PWCEI, + 0, + [_en, _da], + [ + [ + 0, + { + [_hH]: _CE_, + }, + ], + 0, + ] +); +export var QueryIdempotencyTokenAutoFillInput = struct(n0, _QITAFI, 0, [_t], [[0, 4]]); +export var QueryListsInput = struct( + n0, + _QLI, + 0, + [_LA, _CLA, _FLA, _LAWXNM, _FLAWXN, _NWL], + [ + 64 | 0, + () => GreetingList, + [ + 64 | 0, + { + [_xF]: 1, + }, + ], + [() => ListWithXmlName, 0], + [ + () => ListWithXmlName, + { + [_xN]: _H, + [_xF]: 1, + }, + ], + () => NestedStructWithList, + ] +); +export var QueryMapsInput = struct( + n0, + _QMI, + 0, + [_MA, _RMA, _CMA, _MWXMN, _FM, _FMWXN, _MOL, _NSWM], + [ + 128 | 0, + [ + 128 | 0, + { + [_xN]: _Fo, + }, + ], + () => ComplexMap, + [() => MapWithXmlName, 0], + [ + 128 | 0, + { + [_xF]: 1, + }, + ], + [ + () => MapWithXmlName, + { + [_xN]: _H, + [_xF]: 1, + }, + ], + map(n0, _MOL, 0, 0, 64 | 0), + () => NestedStructWithMap, + ] +); +export var QueryTimestampsInput = struct(n0, _QTI, 0, [_nF, _eM, _eT], [4, 7, 7]); +export var RecursiveXmlShapesOutput = struct(n0, _RXSO, 0, [_n], [() => RecursiveXmlShapesOutputNested1]); +export var RecursiveXmlShapesOutputNested1 = struct( + n0, + _RXSON, + 0, + [_f, _n], + [0, () => RecursiveXmlShapesOutputNested2] +); +export var RecursiveXmlShapesOutputNested2 = struct( + n0, + _RXSONe, + 0, + [_b, _rM], + [0, () => RecursiveXmlShapesOutputNested1] +); +export var SimpleInputParamsInput = struct( + n0, + _SIPI, + 0, + [_Fo, _Ba, _Baz, _Bam, _FV, _Bo, _Q, _FE, _IE], + [0, 0, 2, 1, 1, 1, 21, 0, 1] +); +export var SimpleScalarXmlPropertiesOutput = struct( + n0, + _SSXPO, + 0, + [_sV, _eSV, _tBV, _fBV, _bV, _sVh, _iV, _lV, _fV, _dV], + [ + 0, + 0, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + [ + 1, + { + [_xN]: _DD, + }, + ], + ] +); +export var StructArg = struct(n0, _SA, 0, [_SAt, _OA, _RA], [0, 2, () => StructArg]); +export var StructureListMember = struct( + n0, + _SLM, + 0, + [_a, _b_], + [ + [ + 0, + { + [_xN]: _v, + }, + ], + [ + 0, + { + [_xN]: _o, + }, + ], + ] +); +export var XmlBlobsOutput = struct(n0, _XBO, 0, [_da], [21]); +export var XmlEnumsOutput = struct( + n0, + _XEO, + 0, + [_fE, _fEo, _fEoo, _fEL, _fES, _fEM], + [0, 0, 0, 64 | 0, 64 | 0, 128 | 0] +); +export var XmlIntEnumsOutput = struct( + n0, + _XIEO, + 0, + [_iE, _iEn, _iEnt, _iEL, _iES, _iEM], + [1, 1, 1, 64 | 1, 64 | 1, 128 | 1] +); +export var XmlListsOutput = struct( + n0, + _XLO, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _rLM, _fL, _fLl, _fLWMN, _fLWN, _sLt], + [ + 64 | 0, + 64 | 0, + 64 | 1, + 64 | 2, + 64 | 4, + 64 | 0, + 64 | 1, + list(n1, _NSL, 0, 64 | 0), + [ + () => RenamedListMembers, + { + [_xN]: _r, + }, + ], + [ + () => RenamedListMembers, + { + [_xF]: 1, + }, + ], + [ + () => RenamedListMembers, + { + [_xN]: _cN, + [_xF]: 1, + }, + ], + [ + () => ListWithMemberNamespace, + { + [_xF]: 1, + }, + ], + [ + () => ListWithNamespace, + { + [_xF]: 1, + }, + ], + [ + () => StructureList, + { + [_xN]: _mSL, + }, + ], + ] +); +export var XmlMapsOutput = struct(n0, _XMO, 0, [_mM], [() => XmlMapsOutputMap]); +export var XmlMapsXmlNameOutput = struct(n0, _XMXNO, 0, [_mM], [[() => XmlMapsXmlNameOutputMap, 0]]); +export var XmlNamespaceNested = struct( + n0, + _XNN, + { + [_xNm]: [_, _h], + }, + [_f, _va], + [ + [ + 0, + { + [_xNm]: [_ba, _ht], + }, + ], + [ + () => XmlNamespacedList, + { + [_xNm]: [_, _htt], + }, + ], + ] +); +export var XmlNamespacesOutput = struct( + n0, + _XNO, + { + [_xNm]: [_, _http], + }, + [_n], + [[() => XmlNamespaceNested, 0]] +); +export var XmlTimestampsOutput = struct(n0, _XTO, 0, [_no, _dT, _dTOT, _eS, _eSOT, _hD, _hDOT], [4, 5, 5, 7, 7, 6, 6]); +export var GreetingStruct = struct(n1, _GS, 0, [_hi], [0]); +export var Unit = "unit" as const; + +export var QueryProtocolServiceException = error( + "smithy.ts.sdk.synthetic.aws.protocoltests.query", + "QueryProtocolServiceException", + 0, + [], + [], + __QueryProtocolServiceException +); +export var ListWithMemberNamespace = list( + n0, + _LWMN, + { + [_xNm]: [_, _hl], + }, + [ + 0, + { + [_xNm]: [_, _hm_], + }, + ] +); +export var ListWithNamespace = list( + n0, + _LWN, + { + [_xNm]: [_, _hl], + }, + 0 +); +export var ListWithXmlName = list(n0, _LWXN, 0, [ + 0, + { + [_xN]: _i, + }, +]); +export var RenamedListMembers = list(n0, _RLM, 0, [ + 0, + { + [_xN]: _i, + }, +]); +export var StructureList = list(n0, _SLt, 0, [ + () => StructureListMember, + { + [_xN]: _i, + }, +]); +export var XmlNamespacedList = list(n0, _XNL, 0, [ + 0, + { + [_xNm]: [_, _httpb], + }, +]); +export var BooleanList = 64 | 2; + +export var FooEnumList = 64 | 0; + +export var FooEnumSet = 64 | 0; + +export var GreetingList = list(n1, _GL, 0, () => GreetingStruct); +export var IntegerEnumList = 64 | 1; + +export var IntegerEnumSet = 64 | 1; + +export var IntegerList = 64 | 1; + +export var NestedStringList = list(n1, _NSL, 0, 64 | 0); +export var StringList = 64 | 0; + +export var StringSet = 64 | 0; + +export var TimestampList = 64 | 4; + +export var ComplexMap = map(n0, _CM, 0, 0, () => GreetingStruct); +export var FlattenedXmlMapWithXmlNameOutputMap = map( + n0, + _FXMWXNOM, + 0, + [ + 0, + { + [_xN]: _K, + }, + ], + [ + 0, + { + [_xN]: _V, + }, + ] +); +export var FlattenedXmlMapWithXmlNamespaceOutputMap = map( + n0, + _FXMWXNOMl, + 0, + [ + 0, + { + [_xNm]: [_, _hk], + [_xN]: _K, + }, + ], + [ + 0, + { + [_xNm]: [_, _hv], + [_xN]: _V, + }, + ] +); +export var MapOfLists = map(n0, _MOL, 0, 0, 64 | 0); +export var MapWithXmlName = map( + n0, + _MWXN, + 0, + [ + 0, + { + [_xN]: _K, + }, + ], + [ + 0, + { + [_xN]: _V, + }, + ] +); +export var XmlMapsOutputMap = map(n0, _XMOM, 0, 0, () => GreetingStruct); +export var XmlMapsXmlNameOutputMap = map( + n0, + _XMXNOM, + 0, + [ + 0, + { + [_xN]: _A, + }, + ], + [ + () => GreetingStruct, + { + [_xN]: _Se, + }, + ] +); +export var FooEnumMap = 128 | 0; + +export var IntegerEnumMap = 128 | 1; + +export var StringMap = 128 | 0; + +export var DatetimeOffsets = op( + n0, + _DO, + 0, + () => Unit, + () => DatetimeOffsetsOutput +); +export var EmptyInputAndEmptyOutput = op( + n0, + _EIAEO, + 0, + () => EmptyInputAndEmptyOutputInput, + () => EmptyInputAndEmptyOutputOutput +); +export var EndpointOperation = op( + n0, + _EO, + { + [_end]: ["foo."], + }, + () => Unit, + () => Unit +); +export var EndpointWithHostLabelOperation = op( + n0, + _EWHLO, + { + [_end]: ["foo.{label}."], + }, + () => HostLabelInput, + () => Unit +); +export var FlattenedXmlMap = op( + n0, + _FXM, + 0, + () => Unit, + () => FlattenedXmlMapOutput +); +export var FlattenedXmlMapWithXmlName = op( + n0, + _FXMWXN, + 0, + () => Unit, + () => FlattenedXmlMapWithXmlNameOutput +); +export var FlattenedXmlMapWithXmlNamespace = op( + n0, + _FXMWXNl, + 0, + () => Unit, + () => FlattenedXmlMapWithXmlNamespaceOutput +); +export var FractionalSeconds = op( + n0, + _FS, + 0, + () => Unit, + () => FractionalSecondsOutput +); +export var GreetingWithErrors = op( + n0, + _GWE, + 0, + () => Unit, + () => GreetingWithErrorsOutput +); +export var HostWithPathOperation = op( + n0, + _HWPO, + 0, + () => Unit, + () => Unit +); +export var IgnoresWrappingXmlName = op( + n0, + _IWXN, + 0, + () => Unit, + () => IgnoresWrappingXmlNameOutput +); +export var NestedStructures = op( + n0, + _NS, + 0, + () => NestedStructuresInput, + () => Unit +); +export var NoInputAndNoOutput = op( + n0, + _NIANO, + 0, + () => Unit, + () => Unit +); +export var NoInputAndOutput = op( + n0, + _NIAO, + 0, + () => NoInputAndOutputInput, + () => NoInputAndOutputOutput +); +export var PutWithContentEncoding = op( + n0, + _PWCE, + 0, + () => PutWithContentEncodingInput, + () => Unit +); +export var QueryIdempotencyTokenAutoFill = op( + n0, + _QITAF, + 0, + () => QueryIdempotencyTokenAutoFillInput, + () => Unit +); +export var QueryLists = op( + n0, + _QL, + 0, + () => QueryListsInput, + () => Unit +); +export var QueryMaps = op( + n0, + _QM, + 0, + () => QueryMapsInput, + () => Unit +); +export var QueryTimestamps = op( + n0, + _QT, + 0, + () => QueryTimestampsInput, + () => Unit +); +export var RecursiveXmlShapes = op( + n0, + _RXS, + 0, + () => Unit, + () => RecursiveXmlShapesOutput +); +export var SimpleInputParams = op( + n0, + _SIP, + 0, + () => SimpleInputParamsInput, + () => Unit +); +export var SimpleScalarXmlProperties = op( + n0, + _SSXP, + 0, + () => Unit, + () => SimpleScalarXmlPropertiesOutput +); +export var XmlBlobs = op( + n0, + _XB, + 0, + () => Unit, + () => XmlBlobsOutput +); +export var XmlEmptyBlobs = op( + n0, + _XEB, + 0, + () => Unit, + () => XmlBlobsOutput +); +export var XmlEmptyLists = op( + n0, + _XEL, + 0, + () => Unit, + () => XmlListsOutput +); +export var XmlEmptyMaps = op( + n0, + _XEM, + 0, + () => Unit, + () => XmlMapsOutput +); +export var XmlEnums = op( + n0, + _XE, + 0, + () => Unit, + () => XmlEnumsOutput +); +export var XmlIntEnums = op( + n0, + _XIE, + 0, + () => Unit, + () => XmlIntEnumsOutput +); +export var XmlLists = op( + n0, + _XL, + 0, + () => Unit, + () => XmlListsOutput +); +export var XmlMaps = op( + n0, + _XM, + 0, + () => Unit, + () => XmlMapsOutput +); +export var XmlMapsXmlName = op( + n0, + _XMXN, + 0, + () => Unit, + () => XmlMapsXmlNameOutput +); +export var XmlNamespaces = op( + n0, + _XN, + 0, + () => Unit, + () => XmlNamespacesOutput +); +export var XmlTimestamps = op( + n0, + _XT, + 0, + () => Unit, + () => XmlTimestampsOutput +); diff --git a/private/aws-protocoltests-query-schema/test/functional/awsquery.spec.ts b/private/aws-protocoltests-query-schema/test/functional/awsquery.spec.ts new file mode 100644 index 0000000000000..c2be014abe9ea --- /dev/null +++ b/private/aws-protocoltests-query-schema/test/functional/awsquery.spec.ts @@ -0,0 +1,3675 @@ +// smithy-typescript generated code +import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; +import { Encoder as __Encoder } from "@smithy/types"; +import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; +import { Readable } from "stream"; +import { expect, test as it } from "vitest"; + +import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommand } from "../../src/commands/FlattenedXmlMapCommand"; +import { FlattenedXmlMapWithXmlNameCommand } from "../../src/commands/FlattenedXmlMapWithXmlNameCommand"; +import { FlattenedXmlMapWithXmlNamespaceCommand } from "../../src/commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { FractionalSecondsCommand } from "../../src/commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HostWithPathOperationCommand } from "../../src/commands/HostWithPathOperationCommand"; +import { IgnoresWrappingXmlNameCommand } from "../../src/commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommand } from "../../src/commands/NestedStructuresCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { PutWithContentEncodingCommand } from "../../src/commands/PutWithContentEncodingCommand"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommand } from "../../src/commands/QueryListsCommand"; +import { QueryMapsCommand } from "../../src/commands/QueryMapsCommand"; +import { QueryTimestampsCommand } from "../../src/commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommand } from "../../src/commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommand } from "../../src/commands/SimpleInputParamsCommand"; +import { SimpleScalarXmlPropertiesCommand } from "../../src/commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommand } from "../../src/commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommand } from "../../src/commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommand } from "../../src/commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommand } from "../../src/commands/XmlEmptyMapsCommand"; +import { XmlEnumsCommand } from "../../src/commands/XmlEnumsCommand"; +import { XmlIntEnumsCommand } from "../../src/commands/XmlIntEnumsCommand"; +import { XmlListsCommand } from "../../src/commands/XmlListsCommand"; +import { XmlMapsCommand } from "../../src/commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommand } from "../../src/commands/XmlMapsXmlNameCommand"; +import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand"; +import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand"; +import { QueryProtocolClient } from "../../src/QueryProtocolClient"; + +/** + * Throws an expected exception that contains the serialized request. + */ +class EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error { + constructor(readonly request: HttpRequest) { + super(); + } +} + +/** + * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a + * request. The thrown exception contains the serialized request. + */ +class RequestSerializationTestHandler implements HttpHandler { + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request)); + } + updateHttpClientConfig(key: never, value: never): void {} + httpHandlerConfigs() { + return {}; + } +} + +/** + * Returns a resolved Promise of the specified response contents. + */ +class ResponseDeserializationTestHandler implements HttpHandler { + isSuccess: boolean; + code: number; + headers: HeaderBag; + body: string | Uint8Array; + isBase64Body: boolean; + + constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) { + this.isSuccess = isSuccess; + this.code = code; + if (headers === undefined) { + this.headers = {}; + } else { + this.headers = headers; + } + if (body === undefined) { + body = ""; + } + this.body = body; + this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), "base64").toString("base64") === body; + } + + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.resolve({ + response: new HttpResponse({ + statusCode: this.code, + headers: this.headers, + body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]), + }), + }); + } + + updateHttpClientConfig(key: never, value: never): void {} + + httpHandlerConfigs() { + return {}; + } +} + +interface comparableParts { + [key: string]: string; +} + +/** + * Generates a standard map of un-equal values given input parts. + */ +const compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => { + const unequalParts: any = {}; + Object.keys(expectedParts).forEach((key) => { + if (generatedParts[key] === undefined) { + unequalParts[key] = { exp: expectedParts[key], gen: undefined }; + } else if (!equivalentContents(expectedParts[key], generatedParts[key])) { + unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] }; + } + }); + + Object.keys(generatedParts).forEach((key) => { + if (expectedParts[key] === undefined) { + unequalParts[key] = { exp: undefined, gen: generatedParts[key] }; + } + }); + + if (Object.keys(unequalParts).length !== 0) { + return unequalParts; + } + return undefined; +}; + +/** + * Compares all types for equivalent contents, doing nested + * equality checks based on non-`$metadata` + * properties that have defined values. + */ +const equivalentContents = (expected: any, generated: any): boolean => { + if (typeof (global as any).expect === "function") { + expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected)); + return true; + } + + const localExpected = expected; + + // Short circuit on equality. + if (localExpected == generated) { + return true; + } + + if (typeof expected !== "object") { + return expected === generated; + } + + // If a test fails with an issue in the below 6 lines, it's likely + // due to an issue in the nestedness or existence of the property + // being compared. + delete localExpected["$metadata"]; + delete generated["$metadata"]; + Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]); + Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]); + + const expectedProperties = Object.getOwnPropertyNames(localExpected); + const generatedProperties = Object.getOwnPropertyNames(generated); + + // Short circuit on different property counts. + if (expectedProperties.length != generatedProperties.length) { + return false; + } + + // Compare properties directly. + for (let index = 0; index < expectedProperties.length; index++) { + const propertyName = expectedProperties[index]; + if (!equivalentContents(localExpected[propertyName], generated[propertyName])) { + return false; + } + } + + return true; +}; + +const clientParams = { + region: "us-west-2", + credentials: { accessKeyId: "key", secretAccessKey: "secret" }, + endpoint: () => { + const url = new URL("https://localhost/"); + return Promise.resolve({ + hostname: url.hostname, + protocol: url.protocol, + path: url.pathname, + }) as Promise; + }, +}; + +/** + * A wrapper function that shadows `fail` from jest-jasmine2 + * (jasmine2 was replaced with circus in > v27 as the default test runner) + */ +const fail = (error?: any): never => { + throw new Error(error); +}; + +/** + * Hexadecimal to byteArray. + */ +const toBytes = (hex: string) => { + return Buffer.from(hex, "base64"); +}; + +function normalizeByteArrayType(data: any) { + // normalize float32 errors + if (typeof data === "number") { + const u = new Uint8Array(4); + const dv = new DataView(u.buffer, u.byteOffset, u.byteLength); + dv.setFloat32(0, data); + return dv.getFloat32(0); + } + if (!data || typeof data !== "object") { + return data; + } + if (data instanceof Uint8Array) { + return Uint8Array.from(data); + } + if (data instanceof String || data instanceof Boolean || data instanceof Number) { + return data.valueOf(); + } + const output = {} as any; + for (const key of Object.getOwnPropertyNames(data)) { + output[key] = normalizeByteArrayType(data[key]); + } + return output; +} + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("AwsQueryDateTimeWithNegativeOffset:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 2019-12-16T22:48:18-01:00 + + + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("AwsQueryDateTimeWithPositiveOffset:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 2019-12-17T00:48:18+01:00 + + + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty input serializes no extra query params + */ +it("QueryEmptyInputAndEmptyOutput:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyInputAndEmptyOutputCommand({} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=EmptyInputAndEmptyOutput&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Empty output + */ +it("QueryEmptyInputAndEmptyOutput:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined), + }); + + const params: any = {}; + const command = new EmptyInputAndEmptyOutputCommand(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); +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait. + */ +it("AwsQueryEndpointTrait:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointOperationCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.headers["host"]).toBe("foo.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=EndpointOperation&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait, and can use the host label trait to define + * further customization based on user input. + */ +it("AwsQueryEndpointTraitWithHostLabel:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointWithHostLabelOperationCommand({ + label: "bar", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.headers["host"]).toBe("foo.bar.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=EndpointWithHostLabelOperation&Version=2020-01-08&label=bar`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes flattened XML maps in responses + */ +it("QueryQueryFlattenedXmlMap:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + foo + Foo + + + baz + Baz + + + ` + ), + }); + + const params: any = {}; + const command = new FlattenedXmlMapCommand(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 = [ + { + myMap: { + foo: "Foo", + baz: "Baz", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes flattened XML maps in responses that have xmlName on members + */ +it("QueryQueryFlattenedXmlMapWithXmlName:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + a + A + + + b + B + + + ` + ), + }); + + const params: any = {}; + const command = new FlattenedXmlMapWithXmlNameCommand(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 = [ + { + myMap: { + a: "A", + b: "B", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes flattened XML maps in responses that have xmlNamespace and xmlName on members + */ +it("QueryQueryFlattenedXmlMapWithXmlNamespace:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + a + A + + + b + B + + + ` + ), + }); + + const params: any = {}; + const command = new FlattenedXmlMapWithXmlNamespaceCommand(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 = [ + { + myMap: { + a: "A", + b: "B", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse datetime timestamps with fractional seconds + */ +it("AwsQueryDateTimeWithFractionalSeconds:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 2000-01-02T20:34:56.123Z + + + ` + ), + }); + + const params: any = {}; + const command = new FractionalSecondsCommand(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 = [ + { + datetime: new Date(9.46845296123e8 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that operations with errors successfully know how to deserialize the successful response + */ +it("QueryGreetingWithErrors:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + Hello + + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(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 = [ + { + greeting: "Hello", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses simple XML errors + */ +it("QueryInvalidGreetingError:Error:GreetingWithErrors", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "text/xml", + }, + ` + + Sender + InvalidGreeting + Hi + + foo-id + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "InvalidGreeting") { + console.log(err); + fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +it("QueryComplexError:Error:GreetingWithErrors", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "text/xml", + }, + ` + + Sender + ComplexError + Top level + + bar + + + foo-id + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + TopLevel: "Top level", + Nested: { + Foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Parses customized XML errors + */ +it("QueryCustomizedError:Error:GreetingWithErrors", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 402, + { + "content-type": "text/xml", + }, + ` + + Sender + Customized + Hi + + foo-id + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "CustomCodeError") { + console.log(err); + fail(`Expected a CustomCodeError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(402); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Custom endpoints supplied by users can have paths + */ +it("QueryHostWithPath:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + endpoint: "https://example.com/custom", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HostWithPathOperationCommand({}); + 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("/custom/"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=HostWithPathOperation&Version=2020-01-08`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * The xmlName trait on the output structure is ignored in AWS Query + */ +it("QueryIgnoresWrappingXmlName:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + bar + + + ` + ), + }); + + const params: any = {}; + const command = new IgnoresWrappingXmlNameCommand(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 = [ + { + foo: "bar", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes nested structures using dots + */ +it("NestedStructures:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NestedStructuresCommand({ + Nested: { + StringArg: "foo", + OtherArg: true, + RecursiveArg: { + StringArg: "baz", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=NestedStructures&Version=2020-01-08&Nested.StringArg=foo&Nested.OtherArg=true&Nested.RecursiveArg.StringArg=baz`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * No input serializes no additional query params + */ +it("QueryNoInputAndNoOutput:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndNoOutputCommand({}); + 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=NoInputAndNoOutput&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Empty output. Note that no assertion is made on the output body itself. + */ +it("QueryNoInputAndNoOutput:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined), + }); + + const params: any = {}; + const command = new NoInputAndNoOutputCommand(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); +}); + +/** + * No input serializes no payload + */ +it("QueryNoInputAndOutput:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndOutputCommand({} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=NoInputAndOutput&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Empty output + */ +it("QueryNoInputAndOutput:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined), + }); + + const params: any = {}; + const command = new NoInputAndOutputCommand(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); +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header. + */ +it("SDKAppliedContentEncoding_awsQuery:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header, and the + * user-provided content-encoding is NOT in the Content-Encoding header since HTTP binding + * traits are ignored in the awsQuery protocol. + * + */ +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + encoding: "custom", + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Automatically adds idempotency token when not set + */ +it("QueryProtocolIdempotencyTokenAutoFill:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000000", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&token=00000000-0000-4000-8000-000000000000`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Uses the given idempotency token as-is + */ +it("QueryProtocolIdempotencyTokenAutoFillIsSet:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000123", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&token=00000000-0000-4000-8000-000000000123`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes query lists + */ +it("QueryLists:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + ListArg: ["foo", "bar", "baz"], + ComplexListArg: [ + { + hi: "hello", + } as any, + { + hi: "hola", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&ListArg.member.1=foo&ListArg.member.2=bar&ListArg.member.3=baz&ComplexListArg.member.1.hi=hello&ComplexListArg.member.2.hi=hola`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes empty query lists + */ +it("EmptyQueryLists:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + ListArg: [], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&ListArg=`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Flattens query lists by repeating the member name and removing the member element + */ +it("FlattenedQueryLists:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + FlattenedListArg: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&FlattenedListArg.1=A&FlattenedListArg.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Changes the member of lists using xmlName trait + */ +it("QueryListArgWithXmlNameMember:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + ListArgWithXmlNameMember: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&ListArgWithXmlNameMember.item.1=A&ListArgWithXmlNameMember.item.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Changes the name of flattened lists using xmlName trait on the structure member + */ +it("QueryFlattenedListArgWithXmlName:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + FlattenedListArgWithXmlName: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&Hi.1=A&Hi.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Nested structure with a list member + */ +it("QueryNestedStructWithList:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryListsCommand({ + NestedWithList: { + ListArg: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryLists&Version=2020-01-08&NestedWithList.ListArg.member.1=A&NestedWithList.ListArg.member.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes query maps + */ +it("QuerySimpleQueryMaps:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + MapArg: { + bar: "Bar", + foo: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&MapArg.entry.1.key=bar&MapArg.entry.1.value=Bar&MapArg.entry.2.key=foo&MapArg.entry.2.value=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes query maps and uses xmlName + */ +it("QuerySimpleQueryMapsWithXmlName:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + RenamedMapArg: { + foo: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&Foo.entry.1.key=foo&Foo.entry.1.value=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes complex query maps + */ +it("QueryComplexQueryMaps:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + ComplexMapArg: { + bar: { + hi: "Bar", + } as any, + foo: { + hi: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&ComplexMapArg.entry.1.key=bar&ComplexMapArg.entry.1.value.hi=Bar&ComplexMapArg.entry.2.key=foo&ComplexMapArg.entry.2.value.hi=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Does not serialize empty query maps + */ +it("QueryEmptyQueryMaps:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + MapArg: {} 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes query maps where the member has an xmlName trait + */ +it("QueryQueryMapWithMemberXmlName:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + MapWithXmlMemberName: { + bar: "Bar", + foo: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&MapWithXmlMemberName.entry.1.K=bar&MapWithXmlMemberName.entry.1.V=Bar&MapWithXmlMemberName.entry.2.K=foo&MapWithXmlMemberName.entry.2.V=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes flattened query maps + */ +it("QueryFlattenedQueryMaps:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + FlattenedMap: { + bar: "Bar", + foo: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&FlattenedMap.1.key=bar&FlattenedMap.1.value=Bar&FlattenedMap.2.key=foo&FlattenedMap.2.value=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes flattened query maps that use an xmlName + */ +it("QueryFlattenedQueryMapsWithXmlName:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + FlattenedMapWithXmlName: { + bar: "Bar", + foo: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&Hi.1.K=bar&Hi.1.V=Bar&Hi.2.K=foo&Hi.2.V=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes query map of lists + */ +it("QueryQueryMapOfLists:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + MapOfLists: { + bar: ["C", "D"], + foo: ["A", "B"], + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&MapOfLists.entry.1.key=bar&MapOfLists.entry.1.value.member.1=C&MapOfLists.entry.1.value.member.2=D&MapOfLists.entry.2.key=foo&MapOfLists.entry.2.value.member.1=A&MapOfLists.entry.2.value.member.2=B`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes nested struct with map member + */ +it("QueryNestedStructWithMap:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryMapsCommand({ + NestedStructWithMap: { + MapArg: { + bar: "Bar", + foo: "Foo", + } 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("/"); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryMaps&Version=2020-01-08&NestedStructWithMap.MapArg.entry.1.key=bar&NestedStructWithMap.MapArg.entry.1.value=Bar&NestedStructWithMap.MapArg.entry.2.key=foo&NestedStructWithMap.MapArg.entry.2.value=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes timestamps + */ +it("QueryTimestampsInput:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryTimestampsCommand({ + normalFormat: new Date(1422172800000), + epochMember: new Date(1422172800000), + epochTarget: new Date(1422172800000), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=QueryTimestamps&Version=2020-01-08&normalFormat=2015-01-25T08%3A00%3A00Z&epochMember=1422172800&epochTarget=1422172800`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes recursive structures + */ +it("QueryRecursiveShapes:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + Foo1 + + Bar1 + + Foo2 + + Bar2 + + + + + + + ` + ), + }); + + const params: any = {}; + const command = new RecursiveXmlShapesCommand(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 = [ + { + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + }, + }, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes strings + */ +it("QuerySimpleInputParamsStrings:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Foo: "val1", + Bar: "val2", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Bar=val2`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes booleans that are true + */ +it("QuerySimpleInputParamsStringAndBooleanTrue:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Foo: "val1", + Baz: true, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Baz=true`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes booleans that are false + */ +it("QuerySimpleInputParamsStringsAndBooleanFalse:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Baz: false, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Baz=false`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes integers + */ +it("QuerySimpleInputParamsInteger:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Bam: 10, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Bam=10`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes floats + */ +it("QuerySimpleInputParamsFloat:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Boo: 10.8, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Boo=10.8`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Blobs are base64 encoded in the query string + */ +it("QuerySimpleInputParamsBlob:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + Qux: Uint8Array.from("value", (c) => c.charCodeAt(0)), + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Qux=dmFsdWU%3D`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes enums in the query string + */ +it("QueryEnums:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FooEnum: "Foo", + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FooEnum=Foo`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes intEnums in the query string + */ +it("QueryIntEnums:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + IntegerEnum: 1, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&IntegerEnum=1`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling NaN float values. + */ +it("AwsQuerySupportsNaNFloatInputs:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FloatValue: NaN, + Boo: NaN, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=NaN&Boo=NaN`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("AwsQuerySupportsInfinityFloatInputs:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FloatValue: Infinity, + Boo: Infinity, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=Infinity&Boo=Infinity`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling -Infinity float values. + */ +it("AwsQuerySupportsNegativeInfinityFloatInputs:Request", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleInputParamsCommand({ + FloatValue: -Infinity, + Boo: -Infinity, + } 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("/"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=-Infinity&Boo=-Infinity`; + const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("QuerySimpleScalarProperties:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + string + + true + false + 1 + 2 + 3 + 4 + 5.5 + 6.5 + + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + stringValue: "string", + emptyStringValue: "", + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling NaN float values. + */ +it("AwsQuerySupportsNaNFloatOutputs:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + NaN + NaN + + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + floatValue: NaN, + doubleValue: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float values. + */ +it("AwsQuerySupportsInfinityFloatOutputs:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + Infinity + Infinity + + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + floatValue: Infinity, + doubleValue: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float values. + */ +it("AwsQuerySupportsNegativeInfinityFloatOutputs:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + -Infinity + -Infinity + + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarXmlPropertiesCommand(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 = [ + { + floatValue: -Infinity, + doubleValue: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Blobs are base64 encoded + */ +it("QueryXmlBlobs:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + dmFsdWU= + + + ` + ), + }); + + const params: any = {}; + const command = new XmlBlobsCommand(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 = [ + { + data: Uint8Array.from("value", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty blobs are deserialized as empty string + */ +it("QueryXmlEmptyBlobs:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyBlobsCommand(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 = [ + { + data: Uint8Array.from("", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty self closed blobs are deserialized as empty string + */ +it("QueryXmlEmptySelfClosedBlobs:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyBlobsCommand(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 = [ + { + data: Uint8Array.from("", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes empty XML lists + */ +it("QueryXmlEmptyLists:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyListsCommand(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 = [ + { + stringList: [], + stringSet: [], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes Empty XML maps + */ +it("QueryXmlEmptyMaps:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyMapsCommand(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 = [ + { + myMap: {}, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes Self-Closed XML maps + */ +it("QueryXmlEmptySelfClosedMaps:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyMapsCommand(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 = [ + { + myMap: {}, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("QueryXmlEnums:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + Foo + 0 + 1 + + Foo + 0 + + + Foo + 0 + + + + hi + Foo + + + zero + 0 + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEnumsCommand(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 = [ + { + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("QueryXmlIntEnums:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 1 + 2 + 3 + + 1 + 2 + + + 1 + 2 + + + + a + 1 + + + b + 2 + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlIntEnumsCommand(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 = [ + { + intEnum1: 1, + intEnum2: 2, + intEnum3: 3, + intEnumList: [1, 2], + intEnumSet: [1, 2], + intEnumMap: { + a: 1, + b: 2, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests for XML list serialization + */ +it("QueryXmlLists:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + foo + bar + + + foo + bar + + + 1 + 2 + + + true + false + + + 2014-04-29T18:30:38Z + 2014-04-29T18:30:38Z + + + Foo + 0 + + + 1 + 2 + + + + foo + bar + + + baz + qux + + + + foo + bar + + hi + bye + yep + nope + a + b + a + b + + + 1 + 2 + + + 3 + 4 + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlListsCommand(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 = [ + { + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238 * 1000), new Date(1398796238 * 1000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + renamedListMembers: ["foo", "bar"], + flattenedList: ["hi", "bye"], + flattenedList2: ["yep", "nope"], + flattenedListWithMemberNamespace: ["a", "b"], + flattenedListWithNamespace: ["a", "b"], + structureList: [ + { + a: "1", + b: "2", + }, + { + a: "3", + b: "4", + }, + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests for XML map serialization + */ +it("QueryXmlMaps:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + foo + + there + + + + baz + + bye + + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlMapsCommand(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 = [ + { + myMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML lists + */ +it("QueryQueryXmlMapsXmlName:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + + foo + + there + + + + baz + + bye + + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlMapsXmlNameCommand(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 = [ + { + myMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML namespaces + */ +it("QueryXmlNamespaces:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + + Foo + + Bar + Baz + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlNamespacesCommand(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 = [ + { + nested: { + foo: "Foo", + values: ["Bar", "Baz"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests how normal timestamps are serialized + */ +it("QueryXmlTimestamps:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 2014-04-29T18:30:38Z + + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + normal: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time works like normal timestamps + */ +it("QueryXmlTimestampsWithDateTimeFormat:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 2014-04-29T18:30:38Z + + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + dateTime: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time on the target shape works like normal timestamps + */ +it("QueryXmlTimestampsWithDateTimeOnTargetFormat:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 2014-04-29T18:30:38Z + + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + dateTimeOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds works + */ +it("QueryXmlTimestampsWithEpochSecondsFormat:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 1398796238 + + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + epochSeconds: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds on the target shape works + */ +it("QueryXmlTimestampsWithEpochSecondsOnTargetFormat:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + 1398796238 + + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + epochSecondsOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date works + */ +it("QueryXmlTimestampsWithHttpDateFormat:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + Tue, 29 Apr 2014 18:30:38 GMT + + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + httpDate: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date on the target shape works + */ +it("QueryXmlTimestampsWithHttpDateOnTargetFormat:Response", async () => { + const client = new QueryProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/xml", + }, + ` + + Tue, 29 Apr 2014 18:30:38 GMT + + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + httpDateOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentFormUrlencodedBodies = (expectedBody: string, generatedBody: string): Object => { + const fromEntries = (components: string[][]): Record => { + const parts: Record = {}; + + components.forEach((component) => { + parts[component[0]] = component[1]; + }); + + return parts; + }; + + // Generate to k:v maps from query components + const expectedParts = fromEntries(expectedBody.split("&").map((part) => part.trim().split("="))); + const generatedParts = fromEntries(generatedBody.split("&").map((part) => part.trim().split("="))); + + return compareParts(expectedParts, generatedParts); +}; + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentUnknownTypeBodies = ( + utf8Encoder: __Encoder, + expectedBody: string, + generatedBody: string | Uint8Array +): Object => { + const expectedParts = { Value: expectedBody }; + const generatedParts = { + Value: generatedBody instanceof Uint8Array ? utf8Encoder(generatedBody) : generatedBody, + }; + + return compareParts(expectedParts, generatedParts); +}; diff --git a/private/aws-protocoltests-query-schema/tsconfig.cjs.json b/private/aws-protocoltests-query-schema/tsconfig.cjs.json new file mode 100644 index 0000000000000..9224176da7f72 --- /dev/null +++ b/private/aws-protocoltests-query-schema/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-query-schema/tsconfig.es.json b/private/aws-protocoltests-query-schema/tsconfig.es.json new file mode 100644 index 0000000000000..5a76fb6593463 --- /dev/null +++ b/private/aws-protocoltests-query-schema/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "ESNext", + "moduleResolution": "bundler", + "outDir": "dist-es", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-query-schema/tsconfig.json b/private/aws-protocoltests-query-schema/tsconfig.json new file mode 100644 index 0000000000000..956bed461a6ce --- /dev/null +++ b/private/aws-protocoltests-query-schema/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/private/aws-protocoltests-query-schema/tsconfig.types.json b/private/aws-protocoltests-query-schema/tsconfig.types.json new file mode 100644 index 0000000000000..b9a5eb7844868 --- /dev/null +++ b/private/aws-protocoltests-query-schema/tsconfig.types.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true, + "noCheck": false + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/private/aws-protocoltests-query-schema/vite.config.js b/private/aws-protocoltests-query-schema/vite.config.js new file mode 100644 index 0000000000000..e7147d3ac9e1d --- /dev/null +++ b/private/aws-protocoltests-query-schema/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-restjson-schema/.gitignore b/private/aws-protocoltests-restjson-schema/.gitignore new file mode 100644 index 0000000000000..54f14c9aef253 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/private/aws-protocoltests-restjson-schema/LICENSE b/private/aws-protocoltests-restjson-schema/LICENSE new file mode 100644 index 0000000000000..ba9d6d1526906 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/private/aws-protocoltests-restjson-schema/README.md b/private/aws-protocoltests-restjson-schema/README.md new file mode 100644 index 0000000000000..f0b5c5230f06c --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/README.md @@ -0,0 +1,2565 @@ + + +# @aws-sdk/aws-protocoltests-restjson-schema + +## Description + +AWS SDK for JavaScript RestJsonProtocol Client for Node.js, Browser and React Native. + +A REST JSON service that sends JSON requests and responses. + +## Installing + +To install this package, simply type add or install @aws-sdk/aws-protocoltests-restjson-schema +using your favorite package manager: + +- `npm install @aws-sdk/aws-protocoltests-restjson-schema` +- `yarn add @aws-sdk/aws-protocoltests-restjson-schema` +- `pnpm add @aws-sdk/aws-protocoltests-restjson-schema` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RestJsonProtocolClient` and +the commands you need, for example `JsonBlobsCommand`: + +```js +// ES5 example +const { RestJsonProtocolClient, JsonBlobsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); +``` + +```ts +// ES6+ example +import { RestJsonProtocolClient, JsonBlobsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new RestJsonProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new JsonBlobsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-protocoltests-restjson-schema"; +const client = new AWS.RestJsonProtocol({ region: "REGION" }); + +// async/await. +try { + const data = await client.jsonBlobs(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .jsonBlobs(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.jsonBlobs(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-protocoltests-restjson-schema` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EmptyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyOperationCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +KitchenSinkOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/KitchenSinkOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/KitchenSinkOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/KitchenSinkOperationCommandOutput/) + +
+
+ +NullOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NullOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullOperationCommandOutput/) + +
+
+ +OperationWithOptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithOptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithOptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithOptionalInputOutputCommandOutput/) + +
+
+ +PutAndGetInlineDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PutAndGetInlineDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutAndGetInlineDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutAndGetInlineDocumentsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseNullsOperationCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +OperationWithRequiredMembers + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithRequiredMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithRequiredMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithRequiredMembersCommandOutput/) + +
+
+ +OperationWithRequiredMembersWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithRequiredMembersWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +AcceptHeaderStarService + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/AcceptHeaderStarServiceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/AcceptHeaderStarServiceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/AcceptHeaderStarServiceCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryMapsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +DocumentType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DocumentTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DocumentTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DocumentTypeCommandOutput/) + +
+
+ +DocumentTypeAsMapValue + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DocumentTypeAsMapValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DocumentTypeAsMapValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DocumentTypeAsMapValueCommandOutput/) + +
+
+ +DocumentTypeAsPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DocumentTypeAsPayloadCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +HttpChecksumRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpChecksumRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpChecksumRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpChecksumRequiredCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpPrefixHeadersInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPrefixHeadersInResponseCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpRequestWithRegexLiteral + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithRegexLiteralCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithRegexLiteralCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithRegexLiteralCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +JsonBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonBlobsCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonListsCommandOutput/) + +
+
+ +JsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonMapsCommandOutput/) + +
+
+ +JsonTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonTimestampsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +MalformedAcceptWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedAcceptWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedAcceptWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedAcceptWithBodyCommandOutput/) + +
+
+ +MalformedAcceptWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedAcceptWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedAcceptWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedAcceptWithGenericStringCommandOutput/) + +
+
+ +MalformedAcceptWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedAcceptWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedAcceptWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedAcceptWithPayloadCommandOutput/) + +
+
+ +MalformedBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedBlobCommandOutput/) + +
+
+ +MalformedBoolean + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedBooleanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedBooleanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedBooleanCommandOutput/) + +
+
+ +MalformedByte + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedByteCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedByteCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedByteCommandOutput/) + +
+
+ +MalformedContentTypeWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedContentTypeWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedContentTypeWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithGenericStringCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedContentTypeWithoutBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithoutBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithoutBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBodyEmptyInput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedContentTypeWithoutBodyEmptyInputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandOutput/) + +
+
+ +MalformedContentTypeWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedContentTypeWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedContentTypeWithPayloadCommandOutput/) + +
+
+ +MalformedDouble + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedDoubleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedDoubleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedDoubleCommandOutput/) + +
+
+ +MalformedFloat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedFloatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedFloatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedFloatCommandOutput/) + +
+
+ +MalformedInteger + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedIntegerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedIntegerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedIntegerCommandOutput/) + +
+
+ +MalformedList + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedListCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedListCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedListCommandOutput/) + +
+
+ +MalformedLong + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedLongCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLongCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLongCommandOutput/) + +
+
+ +MalformedMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedMapCommandOutput/) + +
+
+ +MalformedRequestBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedRequestBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRequestBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRequestBodyCommandOutput/) + +
+
+ +MalformedShort + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedShortCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedShortCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedShortCommandOutput/) + +
+
+ +MalformedString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedStringCommandOutput/) + +
+
+ +MalformedTimestampBodyDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampBodyDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampBodyDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampBodyDateTimeCommandOutput/) + +
+
+ +MalformedTimestampBodyDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampBodyDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampBodyDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampBodyDefaultCommandOutput/) + +
+
+ +MalformedTimestampBodyHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampBodyHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampBodyHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampBodyHttpDateCommandOutput/) + +
+
+ +MalformedTimestampHeaderDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampHeaderDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampHeaderDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampHeaderDateTimeCommandOutput/) + +
+
+ +MalformedTimestampHeaderDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampHeaderDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampHeaderDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampHeaderDefaultCommandOutput/) + +
+
+ +MalformedTimestampHeaderEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampHeaderEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampHeaderEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampHeaderEpochCommandOutput/) + +
+
+ +MalformedTimestampPathDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampPathDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampPathDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampPathDefaultCommandOutput/) + +
+
+ +MalformedTimestampPathEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampPathEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampPathEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampPathEpochCommandOutput/) + +
+
+ +MalformedTimestampPathHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampPathHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampPathHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampPathHttpDateCommandOutput/) + +
+
+ +MalformedTimestampQueryDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampQueryDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampQueryDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampQueryDefaultCommandOutput/) + +
+
+ +MalformedTimestampQueryEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampQueryEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampQueryEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampQueryEpochCommandOutput/) + +
+
+ +MalformedTimestampQueryHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedTimestampQueryHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampQueryHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedTimestampQueryHttpDateCommandOutput/) + +
+
+ +MalformedUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedUnionCommandOutput/) + +
+
+ +MediaTypeHeader + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MediaTypeHeaderCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MediaTypeHeaderCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MediaTypeHeaderCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +OmitsSerializingEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OmitsSerializingEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OmitsSerializingEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OmitsSerializingEmptyListsCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +PostPlayerAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PostPlayerActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PostPlayerActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PostPlayerActionCommandOutput/) + +
+
+ +PostUnionWithJsonName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PostUnionWithJsonNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PostUnionWithJsonNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PostUnionWithJsonNameCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +ResponseCodeHttpFallback + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ResponseCodeHttpFallbackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ResponseCodeHttpFallbackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ResponseCodeHttpFallbackCommandOutput/) + +
+
+ +ResponseCodeRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ResponseCodeRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ResponseCodeRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ResponseCodeRequiredCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseJsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SparseJsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseJsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseJsonListsCommandOutput/) + +
+
+ +SparseJsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SparseJsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseJsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseJsonMapsCommandOutput/) + +
+
+ +StreamingTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/StreamingTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/StreamingTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/StreamingTraitsCommandOutput/) + +
+
+ +StreamingTraitsRequireLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/StreamingTraitsRequireLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/StreamingTraitsRequireLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/StreamingTraitsRequireLengthCommandOutput/) + +
+
+ +StreamingTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/StreamingTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/StreamingTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/StreamingTraitsWithMediaTypeCommandOutput/) + +
+
+ +TestBodyStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TestBodyStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestBodyStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestBodyStructureCommandOutput/) + +
+
+ +TestGetNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TestGetNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestGetNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestGetNoInputNoPayloadCommandOutput/) + +
+
+ +TestGetNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TestGetNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestGetNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestGetNoPayloadCommandOutput/) + +
+
+ +TestPayloadBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TestPayloadBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPayloadBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPayloadBlobCommandOutput/) + +
+
+ +TestPayloadStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TestPayloadStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPayloadStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPayloadStructureCommandOutput/) + +
+
+ +TestPostNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TestPostNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPostNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPostNoInputNoPayloadCommandOutput/) + +
+
+ +TestPostNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TestPostNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPostNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TestPostNoPayloadCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +UnitInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/UnitInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/UnitInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/UnitInputAndOutputCommandOutput/) + +
+
+ +MalformedEnum + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedEnumCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedEnumCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedEnumCommandOutput/) + +
+
+ +MalformedLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLengthCommandOutput/) + +
+
+ +MalformedLengthOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedLengthOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLengthOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLengthOverrideCommandOutput/) + +
+
+ +MalformedLengthQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedLengthQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLengthQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedLengthQueryStringCommandOutput/) + +
+
+ +MalformedPattern + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedPatternCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedPatternCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedPatternCommandOutput/) + +
+
+ +MalformedPatternOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedPatternOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedPatternOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedPatternOverrideCommandOutput/) + +
+
+ +MalformedRange + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedRangeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRangeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRangeCommandOutput/) + +
+
+ +MalformedRangeOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedRangeOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRangeOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRangeOverrideCommandOutput/) + +
+
+ +MalformedRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedRequiredCommandOutput/) + +
+
+ +MalformedUniqueItems + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/MalformedUniqueItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedUniqueItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/MalformedUniqueItemsCommandOutput/) + +
+
+ +RecursiveStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RecursiveStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveStructuresCommandOutput/) + +
+
+ +SensitiveValidation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SensitiveValidationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SensitiveValidationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SensitiveValidationCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +BodyWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/BodyWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/BodyWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/BodyWithXmlNameCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelHeaderOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointWithHostLabelHeaderOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithMemberXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithMemberXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithMemberXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithMemberXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPayloadWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithXmlNamespaceCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespaceAndPrefix + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPayloadWithXmlNamespaceAndPrefixCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +NestedXmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NestedXmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedXmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedXmlMapsCommandOutput/) + +
+
+ +NestedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NestedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NestedXmlMapWithXmlNameCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +XmlAttributes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlAttributesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlAttributesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlAttributesCommandOutput/) + +
+
+ +XmlAttributesOnPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlAttributesOnPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlAttributesOnPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlAttributesOnPayloadCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEmptyStrings + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEmptyStringsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyStringsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEmptyStringsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +XmlTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlTimestampsCommandOutput/) + +
+
+ +XmlUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/XmlUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/XmlUnionsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +GetRestApis + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GetRestApisCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GetRestApisCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GetRestApisCommandOutput/) + +
+
+ +UploadArchive + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/UploadArchiveCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/UploadArchiveCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/UploadArchiveCommandOutput/) + +
+
+ +UploadMultipartPart + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/UploadMultipartPartCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/UploadMultipartPartCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/UploadMultipartPartCommandOutput/) + +
+
+ +Predict + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/PredictCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PredictCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/PredictCommandOutput/) + +
+
+ +DeleteObjectTagging + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DeleteObjectTaggingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DeleteObjectTaggingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DeleteObjectTaggingCommandOutput/) + +
+
+ +GetBucketLocation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GetBucketLocationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GetBucketLocationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GetBucketLocationCommandOutput/) + +
+
+ +GetObject + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GetObjectCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GetObjectCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GetObjectCommandOutput/) + +
+
+ +ListObjectsV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/ListObjectsV2Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ListObjectsV2CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/ListObjectsV2CommandOutput/) + +
+
+ +EmptyInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/EmptyInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/EmptyInputOutputCommandOutput/) + +
+
+ +Float16 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/Float16Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/Float16CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/Float16CommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +NoInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/NoInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/NoInputOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OptionalInputOutputCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +RpcV2CborDenseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RpcV2CborDenseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RpcV2CborDenseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RpcV2CborDenseMapsCommandOutput/) + +
+
+ +RpcV2CborLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RpcV2CborListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RpcV2CborListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RpcV2CborListsCommandOutput/) + +
+
+ +RpcV2CborSparseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/RpcV2CborSparseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RpcV2CborSparseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/RpcV2CborSparseMapsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/SparseNullsOperationCommandOutput/) + +
diff --git a/private/aws-protocoltests-restjson-schema/api-extractor.json b/private/aws-protocoltests-restjson-schema/api-extractor.json new file mode 100644 index 0000000000000..d5bf5ffeee851 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/private/aws-protocoltests-restjson-schema/package.json b/private/aws-protocoltests-restjson-schema/package.json new file mode 100644 index 0000000000000..a8776e07ba98e --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/package.json @@ -0,0 +1,110 @@ +{ + "name": "@aws-sdk/aws-protocoltests-restjson-schema", + "description": "@aws-sdk/aws-protocoltests-restjson-schema client", + "version": "1.0.0-alpha.1", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "test": "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.5.2", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/hash-blob-browser": "^4.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/hash-stream-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/md5-js": "^4.0.4", + "@smithy/middleware-apply-body-checksum": "^4.1.2", + "@smithy/middleware-compression": "^4.1.10", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.10", + "@smithy/middleware-retry": "^4.1.11", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/smithy-client": "^4.4.2", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.18", + "@smithy/util-defaults-mode-node": "^4.0.18", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "@smithy/util-stream": "^4.2.2", + "@smithy/util-utf8": "^4.0.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@tsconfig/node18": "18.2.4", + "@types/node": "^18.19.69", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~5.8.3", + "vitest": "2.1.8" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "private": true, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-protocoltests-restjson-schema", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/aws-protocoltests-restjson-schema" + } +} diff --git a/private/aws-protocoltests-restjson-schema/src/RestJsonProtocol.ts b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocol.ts new file mode 100644 index 0000000000000..09c418beedef1 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocol.ts @@ -0,0 +1,2373 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + AllQueryStringTypesCommand, + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, +} from "./commands/AllQueryStringTypesCommand"; +import { + ConstantAndVariableQueryStringCommand, + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, +} from "./commands/ConstantAndVariableQueryStringCommand"; +import { + ConstantQueryStringCommand, + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, +} from "./commands/ConstantQueryStringCommand"; +import { + ContentTypeParametersCommand, + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { + DatetimeOffsetsCommand, + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, +} from "./commands/DatetimeOffsetsCommand"; +import { + DocumentTypeAsMapValueCommand, + DocumentTypeAsMapValueCommandInput, + DocumentTypeAsMapValueCommandOutput, +} from "./commands/DocumentTypeAsMapValueCommand"; +import { + DocumentTypeAsPayloadCommand, + DocumentTypeAsPayloadCommandInput, + DocumentTypeAsPayloadCommandOutput, +} from "./commands/DocumentTypeAsPayloadCommand"; +import { + DocumentTypeCommand, + DocumentTypeCommandInput, + DocumentTypeCommandOutput, +} from "./commands/DocumentTypeCommand"; +import { + EmptyInputAndEmptyOutputCommand, + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { + EndpointOperationCommand, + EndpointOperationCommandInput, + EndpointOperationCommandOutput, +} from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommand, + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { + FractionalSecondsCommand, + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, +} from "./commands/FractionalSecondsCommand"; +import { + GreetingWithErrorsCommand, + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, +} from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommand, + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { + HttpChecksumRequiredCommand, + HttpChecksumRequiredCommandInput, + HttpChecksumRequiredCommandOutput, +} from "./commands/HttpChecksumRequiredCommand"; +import { + HttpEmptyPrefixHeadersCommand, + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, +} from "./commands/HttpEmptyPrefixHeadersCommand"; +import { + HttpEnumPayloadCommand, + HttpEnumPayloadCommandInput, + HttpEnumPayloadCommandOutput, +} from "./commands/HttpEnumPayloadCommand"; +import { + HttpPayloadTraitsCommand, + HttpPayloadTraitsCommandInput, + HttpPayloadTraitsCommandOutput, +} from "./commands/HttpPayloadTraitsCommand"; +import { + HttpPayloadTraitsWithMediaTypeCommand, + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, +} from "./commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { + HttpPayloadWithStructureCommand, + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, +} from "./commands/HttpPayloadWithStructureCommand"; +import { + HttpPayloadWithUnionCommand, + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, +} from "./commands/HttpPayloadWithUnionCommand"; +import { + HttpPrefixHeadersCommand, + HttpPrefixHeadersCommandInput, + HttpPrefixHeadersCommandOutput, +} from "./commands/HttpPrefixHeadersCommand"; +import { + HttpPrefixHeadersInResponseCommand, + HttpPrefixHeadersInResponseCommandInput, + HttpPrefixHeadersInResponseCommandOutput, +} from "./commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpRequestWithFloatLabelsCommand, + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, +} from "./commands/HttpRequestWithFloatLabelsCommand"; +import { + HttpRequestWithGreedyLabelInPathCommand, + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, +} from "./commands/HttpRequestWithGreedyLabelInPathCommand"; +import { + HttpRequestWithLabelsAndTimestampFormatCommand, + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, +} from "./commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { + HttpRequestWithLabelsCommand, + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, +} from "./commands/HttpRequestWithLabelsCommand"; +import { + HttpRequestWithRegexLiteralCommand, + HttpRequestWithRegexLiteralCommandInput, + HttpRequestWithRegexLiteralCommandOutput, +} from "./commands/HttpRequestWithRegexLiteralCommand"; +import { + HttpResponseCodeCommand, + HttpResponseCodeCommandInput, + HttpResponseCodeCommandOutput, +} from "./commands/HttpResponseCodeCommand"; +import { + HttpStringPayloadCommand, + HttpStringPayloadCommandInput, + HttpStringPayloadCommandOutput, +} from "./commands/HttpStringPayloadCommand"; +import { + IgnoreQueryParamsInResponseCommand, + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, +} from "./commands/IgnoreQueryParamsInResponseCommand"; +import { + InputAndOutputWithHeadersCommand, + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, +} from "./commands/InputAndOutputWithHeadersCommand"; +import { JsonBlobsCommand, JsonBlobsCommandInput, JsonBlobsCommandOutput } from "./commands/JsonBlobsCommand"; +import { JsonEnumsCommand, JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; +import { + JsonIntEnumsCommand, + JsonIntEnumsCommandInput, + JsonIntEnumsCommandOutput, +} from "./commands/JsonIntEnumsCommand"; +import { JsonListsCommand, JsonListsCommandInput, JsonListsCommandOutput } from "./commands/JsonListsCommand"; +import { JsonMapsCommand, JsonMapsCommandInput, JsonMapsCommandOutput } from "./commands/JsonMapsCommand"; +import { + JsonTimestampsCommand, + JsonTimestampsCommandInput, + JsonTimestampsCommandOutput, +} from "./commands/JsonTimestampsCommand"; +import { JsonUnionsCommand, JsonUnionsCommandInput, JsonUnionsCommandOutput } from "./commands/JsonUnionsCommand"; +import { + MalformedAcceptWithBodyCommand, + MalformedAcceptWithBodyCommandInput, + MalformedAcceptWithBodyCommandOutput, +} from "./commands/MalformedAcceptWithBodyCommand"; +import { + MalformedAcceptWithGenericStringCommand, + MalformedAcceptWithGenericStringCommandInput, + MalformedAcceptWithGenericStringCommandOutput, +} from "./commands/MalformedAcceptWithGenericStringCommand"; +import { + MalformedAcceptWithPayloadCommand, + MalformedAcceptWithPayloadCommandInput, + MalformedAcceptWithPayloadCommandOutput, +} from "./commands/MalformedAcceptWithPayloadCommand"; +import { + MalformedBlobCommand, + MalformedBlobCommandInput, + MalformedBlobCommandOutput, +} from "./commands/MalformedBlobCommand"; +import { + MalformedBooleanCommand, + MalformedBooleanCommandInput, + MalformedBooleanCommandOutput, +} from "./commands/MalformedBooleanCommand"; +import { + MalformedByteCommand, + MalformedByteCommandInput, + MalformedByteCommandOutput, +} from "./commands/MalformedByteCommand"; +import { + MalformedContentTypeWithBodyCommand, + MalformedContentTypeWithBodyCommandInput, + MalformedContentTypeWithBodyCommandOutput, +} from "./commands/MalformedContentTypeWithBodyCommand"; +import { + MalformedContentTypeWithGenericStringCommand, + MalformedContentTypeWithGenericStringCommandInput, + MalformedContentTypeWithGenericStringCommandOutput, +} from "./commands/MalformedContentTypeWithGenericStringCommand"; +import { + MalformedContentTypeWithoutBodyCommand, + MalformedContentTypeWithoutBodyCommandInput, + MalformedContentTypeWithoutBodyCommandOutput, +} from "./commands/MalformedContentTypeWithoutBodyCommand"; +import { + MalformedContentTypeWithoutBodyEmptyInputCommand, + MalformedContentTypeWithoutBodyEmptyInputCommandInput, + MalformedContentTypeWithoutBodyEmptyInputCommandOutput, +} from "./commands/MalformedContentTypeWithoutBodyEmptyInputCommand"; +import { + MalformedContentTypeWithPayloadCommand, + MalformedContentTypeWithPayloadCommandInput, + MalformedContentTypeWithPayloadCommandOutput, +} from "./commands/MalformedContentTypeWithPayloadCommand"; +import { + MalformedDoubleCommand, + MalformedDoubleCommandInput, + MalformedDoubleCommandOutput, +} from "./commands/MalformedDoubleCommand"; +import { + MalformedFloatCommand, + MalformedFloatCommandInput, + MalformedFloatCommandOutput, +} from "./commands/MalformedFloatCommand"; +import { + MalformedIntegerCommand, + MalformedIntegerCommandInput, + MalformedIntegerCommandOutput, +} from "./commands/MalformedIntegerCommand"; +import { + MalformedListCommand, + MalformedListCommandInput, + MalformedListCommandOutput, +} from "./commands/MalformedListCommand"; +import { + MalformedLongCommand, + MalformedLongCommandInput, + MalformedLongCommandOutput, +} from "./commands/MalformedLongCommand"; +import { + MalformedMapCommand, + MalformedMapCommandInput, + MalformedMapCommandOutput, +} from "./commands/MalformedMapCommand"; +import { + MalformedRequestBodyCommand, + MalformedRequestBodyCommandInput, + MalformedRequestBodyCommandOutput, +} from "./commands/MalformedRequestBodyCommand"; +import { + MalformedShortCommand, + MalformedShortCommandInput, + MalformedShortCommandOutput, +} from "./commands/MalformedShortCommand"; +import { + MalformedStringCommand, + MalformedStringCommandInput, + MalformedStringCommandOutput, +} from "./commands/MalformedStringCommand"; +import { + MalformedTimestampBodyDateTimeCommand, + MalformedTimestampBodyDateTimeCommandInput, + MalformedTimestampBodyDateTimeCommandOutput, +} from "./commands/MalformedTimestampBodyDateTimeCommand"; +import { + MalformedTimestampBodyDefaultCommand, + MalformedTimestampBodyDefaultCommandInput, + MalformedTimestampBodyDefaultCommandOutput, +} from "./commands/MalformedTimestampBodyDefaultCommand"; +import { + MalformedTimestampBodyHttpDateCommand, + MalformedTimestampBodyHttpDateCommandInput, + MalformedTimestampBodyHttpDateCommandOutput, +} from "./commands/MalformedTimestampBodyHttpDateCommand"; +import { + MalformedTimestampHeaderDateTimeCommand, + MalformedTimestampHeaderDateTimeCommandInput, + MalformedTimestampHeaderDateTimeCommandOutput, +} from "./commands/MalformedTimestampHeaderDateTimeCommand"; +import { + MalformedTimestampHeaderDefaultCommand, + MalformedTimestampHeaderDefaultCommandInput, + MalformedTimestampHeaderDefaultCommandOutput, +} from "./commands/MalformedTimestampHeaderDefaultCommand"; +import { + MalformedTimestampHeaderEpochCommand, + MalformedTimestampHeaderEpochCommandInput, + MalformedTimestampHeaderEpochCommandOutput, +} from "./commands/MalformedTimestampHeaderEpochCommand"; +import { + MalformedTimestampPathDefaultCommand, + MalformedTimestampPathDefaultCommandInput, + MalformedTimestampPathDefaultCommandOutput, +} from "./commands/MalformedTimestampPathDefaultCommand"; +import { + MalformedTimestampPathEpochCommand, + MalformedTimestampPathEpochCommandInput, + MalformedTimestampPathEpochCommandOutput, +} from "./commands/MalformedTimestampPathEpochCommand"; +import { + MalformedTimestampPathHttpDateCommand, + MalformedTimestampPathHttpDateCommandInput, + MalformedTimestampPathHttpDateCommandOutput, +} from "./commands/MalformedTimestampPathHttpDateCommand"; +import { + MalformedTimestampQueryDefaultCommand, + MalformedTimestampQueryDefaultCommandInput, + MalformedTimestampQueryDefaultCommandOutput, +} from "./commands/MalformedTimestampQueryDefaultCommand"; +import { + MalformedTimestampQueryEpochCommand, + MalformedTimestampQueryEpochCommandInput, + MalformedTimestampQueryEpochCommandOutput, +} from "./commands/MalformedTimestampQueryEpochCommand"; +import { + MalformedTimestampQueryHttpDateCommand, + MalformedTimestampQueryHttpDateCommandInput, + MalformedTimestampQueryHttpDateCommandOutput, +} from "./commands/MalformedTimestampQueryHttpDateCommand"; +import { + MalformedUnionCommand, + MalformedUnionCommandInput, + MalformedUnionCommandOutput, +} from "./commands/MalformedUnionCommand"; +import { + MediaTypeHeaderCommand, + MediaTypeHeaderCommandInput, + MediaTypeHeaderCommandOutput, +} from "./commands/MediaTypeHeaderCommand"; +import { + NoInputAndNoOutputCommand, + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, +} from "./commands/NoInputAndNoOutputCommand"; +import { + NoInputAndOutputCommand, + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, +} from "./commands/NoInputAndOutputCommand"; +import { + NullAndEmptyHeadersClientCommand, + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, +} from "./commands/NullAndEmptyHeadersClientCommand"; +import { + NullAndEmptyHeadersServerCommand, + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, +} from "./commands/NullAndEmptyHeadersServerCommand"; +import { + OmitsNullSerializesEmptyStringCommand, + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, +} from "./commands/OmitsNullSerializesEmptyStringCommand"; +import { + OmitsSerializingEmptyListsCommand, + OmitsSerializingEmptyListsCommandInput, + OmitsSerializingEmptyListsCommandOutput, +} from "./commands/OmitsSerializingEmptyListsCommand"; +import { + OperationWithDefaultsCommand, + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, +} from "./commands/OperationWithDefaultsCommand"; +import { + OperationWithNestedStructureCommand, + OperationWithNestedStructureCommandInput, + OperationWithNestedStructureCommandOutput, +} from "./commands/OperationWithNestedStructureCommand"; +import { + PostPlayerActionCommand, + PostPlayerActionCommandInput, + PostPlayerActionCommandOutput, +} from "./commands/PostPlayerActionCommand"; +import { + PostUnionWithJsonNameCommand, + PostUnionWithJsonNameCommandInput, + PostUnionWithJsonNameCommandOutput, +} from "./commands/PostUnionWithJsonNameCommand"; +import { + PutWithContentEncodingCommand, + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommand, + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { + QueryParamsAsStringListMapCommand, + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, +} from "./commands/QueryParamsAsStringListMapCommand"; +import { + QueryPrecedenceCommand, + QueryPrecedenceCommandInput, + QueryPrecedenceCommandOutput, +} from "./commands/QueryPrecedenceCommand"; +import { + RecursiveShapesCommand, + RecursiveShapesCommandInput, + RecursiveShapesCommandOutput, +} from "./commands/RecursiveShapesCommand"; +import { + ResponseCodeHttpFallbackCommand, + ResponseCodeHttpFallbackCommandInput, + ResponseCodeHttpFallbackCommandOutput, +} from "./commands/ResponseCodeHttpFallbackCommand"; +import { + ResponseCodeRequiredCommand, + ResponseCodeRequiredCommandInput, + ResponseCodeRequiredCommandOutput, +} from "./commands/ResponseCodeRequiredCommand"; +import { + SimpleScalarPropertiesCommand, + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + SparseJsonListsCommand, + SparseJsonListsCommandInput, + SparseJsonListsCommandOutput, +} from "./commands/SparseJsonListsCommand"; +import { + SparseJsonMapsCommand, + SparseJsonMapsCommandInput, + SparseJsonMapsCommandOutput, +} from "./commands/SparseJsonMapsCommand"; +import { + StreamingTraitsCommand, + StreamingTraitsCommandInput, + StreamingTraitsCommandOutput, +} from "./commands/StreamingTraitsCommand"; +import { + StreamingTraitsRequireLengthCommand, + StreamingTraitsRequireLengthCommandInput, + StreamingTraitsRequireLengthCommandOutput, +} from "./commands/StreamingTraitsRequireLengthCommand"; +import { + StreamingTraitsWithMediaTypeCommand, + StreamingTraitsWithMediaTypeCommandInput, + StreamingTraitsWithMediaTypeCommandOutput, +} from "./commands/StreamingTraitsWithMediaTypeCommand"; +import { + TestBodyStructureCommand, + TestBodyStructureCommandInput, + TestBodyStructureCommandOutput, +} from "./commands/TestBodyStructureCommand"; +import { + TestGetNoInputNoPayloadCommand, + TestGetNoInputNoPayloadCommandInput, + TestGetNoInputNoPayloadCommandOutput, +} from "./commands/TestGetNoInputNoPayloadCommand"; +import { + TestGetNoPayloadCommand, + TestGetNoPayloadCommandInput, + TestGetNoPayloadCommandOutput, +} from "./commands/TestGetNoPayloadCommand"; +import { + TestPayloadBlobCommand, + TestPayloadBlobCommandInput, + TestPayloadBlobCommandOutput, +} from "./commands/TestPayloadBlobCommand"; +import { + TestPayloadStructureCommand, + TestPayloadStructureCommandInput, + TestPayloadStructureCommandOutput, +} from "./commands/TestPayloadStructureCommand"; +import { + TestPostNoInputNoPayloadCommand, + TestPostNoInputNoPayloadCommandInput, + TestPostNoInputNoPayloadCommandOutput, +} from "./commands/TestPostNoInputNoPayloadCommand"; +import { + TestPostNoPayloadCommand, + TestPostNoPayloadCommandInput, + TestPostNoPayloadCommandOutput, +} from "./commands/TestPostNoPayloadCommand"; +import { + TimestampFormatHeadersCommand, + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, +} from "./commands/TimestampFormatHeadersCommand"; +import { + UnitInputAndOutputCommand, + UnitInputAndOutputCommandInput, + UnitInputAndOutputCommandOutput, +} from "./commands/UnitInputAndOutputCommand"; +import { RestJsonProtocolClient, RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; + +const commands = { + AllQueryStringTypesCommand, + ConstantAndVariableQueryStringCommand, + ConstantQueryStringCommand, + ContentTypeParametersCommand, + DatetimeOffsetsCommand, + DocumentTypeCommand, + DocumentTypeAsMapValueCommand, + DocumentTypeAsPayloadCommand, + EmptyInputAndEmptyOutputCommand, + EndpointOperationCommand, + EndpointWithHostLabelOperationCommand, + FractionalSecondsCommand, + GreetingWithErrorsCommand, + HostWithPathOperationCommand, + HttpChecksumRequiredCommand, + HttpEmptyPrefixHeadersCommand, + HttpEnumPayloadCommand, + HttpPayloadTraitsCommand, + HttpPayloadTraitsWithMediaTypeCommand, + HttpPayloadWithStructureCommand, + HttpPayloadWithUnionCommand, + HttpPrefixHeadersCommand, + HttpPrefixHeadersInResponseCommand, + HttpRequestWithFloatLabelsCommand, + HttpRequestWithGreedyLabelInPathCommand, + HttpRequestWithLabelsCommand, + HttpRequestWithLabelsAndTimestampFormatCommand, + HttpRequestWithRegexLiteralCommand, + HttpResponseCodeCommand, + HttpStringPayloadCommand, + IgnoreQueryParamsInResponseCommand, + InputAndOutputWithHeadersCommand, + JsonBlobsCommand, + JsonEnumsCommand, + JsonIntEnumsCommand, + JsonListsCommand, + JsonMapsCommand, + JsonTimestampsCommand, + JsonUnionsCommand, + MalformedAcceptWithBodyCommand, + MalformedAcceptWithGenericStringCommand, + MalformedAcceptWithPayloadCommand, + MalformedBlobCommand, + MalformedBooleanCommand, + MalformedByteCommand, + MalformedContentTypeWithBodyCommand, + MalformedContentTypeWithGenericStringCommand, + MalformedContentTypeWithoutBodyCommand, + MalformedContentTypeWithoutBodyEmptyInputCommand, + MalformedContentTypeWithPayloadCommand, + MalformedDoubleCommand, + MalformedFloatCommand, + MalformedIntegerCommand, + MalformedListCommand, + MalformedLongCommand, + MalformedMapCommand, + MalformedRequestBodyCommand, + MalformedShortCommand, + MalformedStringCommand, + MalformedTimestampBodyDateTimeCommand, + MalformedTimestampBodyDefaultCommand, + MalformedTimestampBodyHttpDateCommand, + MalformedTimestampHeaderDateTimeCommand, + MalformedTimestampHeaderDefaultCommand, + MalformedTimestampHeaderEpochCommand, + MalformedTimestampPathDefaultCommand, + MalformedTimestampPathEpochCommand, + MalformedTimestampPathHttpDateCommand, + MalformedTimestampQueryDefaultCommand, + MalformedTimestampQueryEpochCommand, + MalformedTimestampQueryHttpDateCommand, + MalformedUnionCommand, + MediaTypeHeaderCommand, + NoInputAndNoOutputCommand, + NoInputAndOutputCommand, + NullAndEmptyHeadersClientCommand, + NullAndEmptyHeadersServerCommand, + OmitsNullSerializesEmptyStringCommand, + OmitsSerializingEmptyListsCommand, + OperationWithDefaultsCommand, + OperationWithNestedStructureCommand, + PostPlayerActionCommand, + PostUnionWithJsonNameCommand, + PutWithContentEncodingCommand, + QueryIdempotencyTokenAutoFillCommand, + QueryParamsAsStringListMapCommand, + QueryPrecedenceCommand, + RecursiveShapesCommand, + ResponseCodeHttpFallbackCommand, + ResponseCodeRequiredCommand, + SimpleScalarPropertiesCommand, + SparseJsonListsCommand, + SparseJsonMapsCommand, + StreamingTraitsCommand, + StreamingTraitsRequireLengthCommand, + StreamingTraitsWithMediaTypeCommand, + TestBodyStructureCommand, + TestGetNoInputNoPayloadCommand, + TestGetNoPayloadCommand, + TestPayloadBlobCommand, + TestPayloadStructureCommand, + TestPostNoInputNoPayloadCommand, + TestPostNoPayloadCommand, + TimestampFormatHeadersCommand, + UnitInputAndOutputCommand, +}; + +export interface RestJsonProtocol { + /** + * @see {@link AllQueryStringTypesCommand} + */ + allQueryStringTypes(): Promise; + allQueryStringTypes( + args: AllQueryStringTypesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + allQueryStringTypes( + args: AllQueryStringTypesCommandInput, + cb: (err: any, data?: AllQueryStringTypesCommandOutput) => void + ): void; + allQueryStringTypes( + args: AllQueryStringTypesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AllQueryStringTypesCommandOutput) => void + ): void; + + /** + * @see {@link ConstantAndVariableQueryStringCommand} + */ + constantAndVariableQueryString(): Promise; + constantAndVariableQueryString( + args: ConstantAndVariableQueryStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + constantAndVariableQueryString( + args: ConstantAndVariableQueryStringCommandInput, + cb: (err: any, data?: ConstantAndVariableQueryStringCommandOutput) => void + ): void; + constantAndVariableQueryString( + args: ConstantAndVariableQueryStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ConstantAndVariableQueryStringCommandOutput) => void + ): void; + + /** + * @see {@link ConstantQueryStringCommand} + */ + constantQueryString( + args: ConstantQueryStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + constantQueryString( + args: ConstantQueryStringCommandInput, + cb: (err: any, data?: ConstantQueryStringCommandOutput) => void + ): void; + constantQueryString( + args: ConstantQueryStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ConstantQueryStringCommandOutput) => void + ): void; + + /** + * @see {@link ContentTypeParametersCommand} + */ + contentTypeParameters(): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + + /** + * @see {@link DatetimeOffsetsCommand} + */ + datetimeOffsets(): Promise; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + datetimeOffsets(args: DatetimeOffsetsCommandInput, cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void): void; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void + ): void; + + /** + * @see {@link DocumentTypeCommand} + */ + documentType(): Promise; + documentType(args: DocumentTypeCommandInput, options?: __HttpHandlerOptions): Promise; + documentType(args: DocumentTypeCommandInput, cb: (err: any, data?: DocumentTypeCommandOutput) => void): void; + documentType( + args: DocumentTypeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DocumentTypeCommandOutput) => void + ): void; + + /** + * @see {@link DocumentTypeAsMapValueCommand} + */ + documentTypeAsMapValue(): Promise; + documentTypeAsMapValue( + args: DocumentTypeAsMapValueCommandInput, + options?: __HttpHandlerOptions + ): Promise; + documentTypeAsMapValue( + args: DocumentTypeAsMapValueCommandInput, + cb: (err: any, data?: DocumentTypeAsMapValueCommandOutput) => void + ): void; + documentTypeAsMapValue( + args: DocumentTypeAsMapValueCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DocumentTypeAsMapValueCommandOutput) => void + ): void; + + /** + * @see {@link DocumentTypeAsPayloadCommand} + */ + documentTypeAsPayload(): Promise; + documentTypeAsPayload( + args: DocumentTypeAsPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + documentTypeAsPayload( + args: DocumentTypeAsPayloadCommandInput, + cb: (err: any, data?: DocumentTypeAsPayloadCommandOutput) => void + ): void; + documentTypeAsPayload( + args: DocumentTypeAsPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DocumentTypeAsPayloadCommandOutput) => void + ): void; + + /** + * @see {@link EmptyInputAndEmptyOutputCommand} + */ + emptyInputAndEmptyOutput(): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + + /** + * @see {@link EndpointOperationCommand} + */ + endpointOperation(): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + endpointOperation( + args: EndpointOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointWithHostLabelOperationCommand} + */ + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + + /** + * @see {@link FractionalSecondsCommand} + */ + fractionalSeconds(): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + + /** + * @see {@link GreetingWithErrorsCommand} + */ + greetingWithErrors(): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + + /** + * @see {@link HostWithPathOperationCommand} + */ + hostWithPathOperation(): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + hostWithPathOperation( + args: HostWithPathOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HostWithPathOperationCommandOutput) => void + ): void; + + /** + * @see {@link HttpChecksumRequiredCommand} + */ + httpChecksumRequired(): Promise; + httpChecksumRequired( + args: HttpChecksumRequiredCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpChecksumRequired( + args: HttpChecksumRequiredCommandInput, + cb: (err: any, data?: HttpChecksumRequiredCommandOutput) => void + ): void; + httpChecksumRequired( + args: HttpChecksumRequiredCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpChecksumRequiredCommandOutput) => void + ): void; + + /** + * @see {@link HttpEmptyPrefixHeadersCommand} + */ + httpEmptyPrefixHeaders(): Promise; + httpEmptyPrefixHeaders( + args: HttpEmptyPrefixHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpEmptyPrefixHeaders( + args: HttpEmptyPrefixHeadersCommandInput, + cb: (err: any, data?: HttpEmptyPrefixHeadersCommandOutput) => void + ): void; + httpEmptyPrefixHeaders( + args: HttpEmptyPrefixHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpEmptyPrefixHeadersCommandOutput) => void + ): void; + + /** + * @see {@link HttpEnumPayloadCommand} + */ + httpEnumPayload(): Promise; + httpEnumPayload( + args: HttpEnumPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpEnumPayload(args: HttpEnumPayloadCommandInput, cb: (err: any, data?: HttpEnumPayloadCommandOutput) => void): void; + httpEnumPayload( + args: HttpEnumPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpEnumPayloadCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadTraitsCommand} + */ + httpPayloadTraits(): Promise; + httpPayloadTraits( + args: HttpPayloadTraitsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadTraits( + args: HttpPayloadTraitsCommandInput, + cb: (err: any, data?: HttpPayloadTraitsCommandOutput) => void + ): void; + httpPayloadTraits( + args: HttpPayloadTraitsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadTraitsCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadTraitsWithMediaTypeCommand} + */ + httpPayloadTraitsWithMediaType(): Promise; + httpPayloadTraitsWithMediaType( + args: HttpPayloadTraitsWithMediaTypeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadTraitsWithMediaType( + args: HttpPayloadTraitsWithMediaTypeCommandInput, + cb: (err: any, data?: HttpPayloadTraitsWithMediaTypeCommandOutput) => void + ): void; + httpPayloadTraitsWithMediaType( + args: HttpPayloadTraitsWithMediaTypeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadTraitsWithMediaTypeCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithStructureCommand} + */ + httpPayloadWithStructure(): Promise; + httpPayloadWithStructure( + args: HttpPayloadWithStructureCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithStructure( + args: HttpPayloadWithStructureCommandInput, + cb: (err: any, data?: HttpPayloadWithStructureCommandOutput) => void + ): void; + httpPayloadWithStructure( + args: HttpPayloadWithStructureCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithStructureCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithUnionCommand} + */ + httpPayloadWithUnion(): Promise; + httpPayloadWithUnion( + args: HttpPayloadWithUnionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithUnion( + args: HttpPayloadWithUnionCommandInput, + cb: (err: any, data?: HttpPayloadWithUnionCommandOutput) => void + ): void; + httpPayloadWithUnion( + args: HttpPayloadWithUnionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithUnionCommandOutput) => void + ): void; + + /** + * @see {@link HttpPrefixHeadersCommand} + */ + httpPrefixHeaders(): Promise; + httpPrefixHeaders( + args: HttpPrefixHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPrefixHeaders( + args: HttpPrefixHeadersCommandInput, + cb: (err: any, data?: HttpPrefixHeadersCommandOutput) => void + ): void; + httpPrefixHeaders( + args: HttpPrefixHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPrefixHeadersCommandOutput) => void + ): void; + + /** + * @see {@link HttpPrefixHeadersInResponseCommand} + */ + httpPrefixHeadersInResponse(): Promise; + httpPrefixHeadersInResponse( + args: HttpPrefixHeadersInResponseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPrefixHeadersInResponse( + args: HttpPrefixHeadersInResponseCommandInput, + cb: (err: any, data?: HttpPrefixHeadersInResponseCommandOutput) => void + ): void; + httpPrefixHeadersInResponse( + args: HttpPrefixHeadersInResponseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPrefixHeadersInResponseCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithFloatLabelsCommand} + */ + httpRequestWithFloatLabels( + args: HttpRequestWithFloatLabelsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithFloatLabels( + args: HttpRequestWithFloatLabelsCommandInput, + cb: (err: any, data?: HttpRequestWithFloatLabelsCommandOutput) => void + ): void; + httpRequestWithFloatLabels( + args: HttpRequestWithFloatLabelsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithFloatLabelsCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithGreedyLabelInPathCommand} + */ + httpRequestWithGreedyLabelInPath( + args: HttpRequestWithGreedyLabelInPathCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithGreedyLabelInPath( + args: HttpRequestWithGreedyLabelInPathCommandInput, + cb: (err: any, data?: HttpRequestWithGreedyLabelInPathCommandOutput) => void + ): void; + httpRequestWithGreedyLabelInPath( + args: HttpRequestWithGreedyLabelInPathCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithGreedyLabelInPathCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithLabelsCommand} + */ + httpRequestWithLabels( + args: HttpRequestWithLabelsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithLabels( + args: HttpRequestWithLabelsCommandInput, + cb: (err: any, data?: HttpRequestWithLabelsCommandOutput) => void + ): void; + httpRequestWithLabels( + args: HttpRequestWithLabelsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithLabelsCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithLabelsAndTimestampFormatCommand} + */ + httpRequestWithLabelsAndTimestampFormat( + args: HttpRequestWithLabelsAndTimestampFormatCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithLabelsAndTimestampFormat( + args: HttpRequestWithLabelsAndTimestampFormatCommandInput, + cb: (err: any, data?: HttpRequestWithLabelsAndTimestampFormatCommandOutput) => void + ): void; + httpRequestWithLabelsAndTimestampFormat( + args: HttpRequestWithLabelsAndTimestampFormatCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithLabelsAndTimestampFormatCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithRegexLiteralCommand} + */ + httpRequestWithRegexLiteral( + args: HttpRequestWithRegexLiteralCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithRegexLiteral( + args: HttpRequestWithRegexLiteralCommandInput, + cb: (err: any, data?: HttpRequestWithRegexLiteralCommandOutput) => void + ): void; + httpRequestWithRegexLiteral( + args: HttpRequestWithRegexLiteralCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithRegexLiteralCommandOutput) => void + ): void; + + /** + * @see {@link HttpResponseCodeCommand} + */ + httpResponseCode(): Promise; + httpResponseCode( + args: HttpResponseCodeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpResponseCode( + args: HttpResponseCodeCommandInput, + cb: (err: any, data?: HttpResponseCodeCommandOutput) => void + ): void; + httpResponseCode( + args: HttpResponseCodeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpResponseCodeCommandOutput) => void + ): void; + + /** + * @see {@link HttpStringPayloadCommand} + */ + httpStringPayload(): Promise; + httpStringPayload( + args: HttpStringPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpStringPayload( + args: HttpStringPayloadCommandInput, + cb: (err: any, data?: HttpStringPayloadCommandOutput) => void + ): void; + httpStringPayload( + args: HttpStringPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpStringPayloadCommandOutput) => void + ): void; + + /** + * @see {@link IgnoreQueryParamsInResponseCommand} + */ + ignoreQueryParamsInResponse(): Promise; + ignoreQueryParamsInResponse( + args: IgnoreQueryParamsInResponseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + ignoreQueryParamsInResponse( + args: IgnoreQueryParamsInResponseCommandInput, + cb: (err: any, data?: IgnoreQueryParamsInResponseCommandOutput) => void + ): void; + ignoreQueryParamsInResponse( + args: IgnoreQueryParamsInResponseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: IgnoreQueryParamsInResponseCommandOutput) => void + ): void; + + /** + * @see {@link InputAndOutputWithHeadersCommand} + */ + inputAndOutputWithHeaders(): Promise; + inputAndOutputWithHeaders( + args: InputAndOutputWithHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + inputAndOutputWithHeaders( + args: InputAndOutputWithHeadersCommandInput, + cb: (err: any, data?: InputAndOutputWithHeadersCommandOutput) => void + ): void; + inputAndOutputWithHeaders( + args: InputAndOutputWithHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InputAndOutputWithHeadersCommandOutput) => void + ): void; + + /** + * @see {@link JsonBlobsCommand} + */ + jsonBlobs(): Promise; + jsonBlobs(args: JsonBlobsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonBlobs(args: JsonBlobsCommandInput, cb: (err: any, data?: JsonBlobsCommandOutput) => void): void; + jsonBlobs( + args: JsonBlobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonBlobsCommandOutput) => void + ): void; + + /** + * @see {@link JsonEnumsCommand} + */ + jsonEnums(): Promise; + jsonEnums(args: JsonEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonEnums(args: JsonEnumsCommandInput, cb: (err: any, data?: JsonEnumsCommandOutput) => void): void; + jsonEnums( + args: JsonEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonEnumsCommandOutput) => void + ): void; + + /** + * @see {@link JsonIntEnumsCommand} + */ + jsonIntEnums(): Promise; + jsonIntEnums(args: JsonIntEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonIntEnums(args: JsonIntEnumsCommandInput, cb: (err: any, data?: JsonIntEnumsCommandOutput) => void): void; + jsonIntEnums( + args: JsonIntEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonIntEnumsCommandOutput) => void + ): void; + + /** + * @see {@link JsonListsCommand} + */ + jsonLists(): Promise; + jsonLists(args: JsonListsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonLists(args: JsonListsCommandInput, cb: (err: any, data?: JsonListsCommandOutput) => void): void; + jsonLists( + args: JsonListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonListsCommandOutput) => void + ): void; + + /** + * @see {@link JsonMapsCommand} + */ + jsonMaps(): Promise; + jsonMaps(args: JsonMapsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonMaps(args: JsonMapsCommandInput, cb: (err: any, data?: JsonMapsCommandOutput) => void): void; + jsonMaps( + args: JsonMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonMapsCommandOutput) => void + ): void; + + /** + * @see {@link JsonTimestampsCommand} + */ + jsonTimestamps(): Promise; + jsonTimestamps( + args: JsonTimestampsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + jsonTimestamps(args: JsonTimestampsCommandInput, cb: (err: any, data?: JsonTimestampsCommandOutput) => void): void; + jsonTimestamps( + args: JsonTimestampsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonTimestampsCommandOutput) => void + ): void; + + /** + * @see {@link JsonUnionsCommand} + */ + jsonUnions(): Promise; + jsonUnions(args: JsonUnionsCommandInput, options?: __HttpHandlerOptions): Promise; + jsonUnions(args: JsonUnionsCommandInput, cb: (err: any, data?: JsonUnionsCommandOutput) => void): void; + jsonUnions( + args: JsonUnionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: JsonUnionsCommandOutput) => void + ): void; + + /** + * @see {@link MalformedAcceptWithBodyCommand} + */ + malformedAcceptWithBody(): Promise; + malformedAcceptWithBody( + args: MalformedAcceptWithBodyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedAcceptWithBody( + args: MalformedAcceptWithBodyCommandInput, + cb: (err: any, data?: MalformedAcceptWithBodyCommandOutput) => void + ): void; + malformedAcceptWithBody( + args: MalformedAcceptWithBodyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedAcceptWithBodyCommandOutput) => void + ): void; + + /** + * @see {@link MalformedAcceptWithGenericStringCommand} + */ + malformedAcceptWithGenericString(): Promise; + malformedAcceptWithGenericString( + args: MalformedAcceptWithGenericStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedAcceptWithGenericString( + args: MalformedAcceptWithGenericStringCommandInput, + cb: (err: any, data?: MalformedAcceptWithGenericStringCommandOutput) => void + ): void; + malformedAcceptWithGenericString( + args: MalformedAcceptWithGenericStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedAcceptWithGenericStringCommandOutput) => void + ): void; + + /** + * @see {@link MalformedAcceptWithPayloadCommand} + */ + malformedAcceptWithPayload(): Promise; + malformedAcceptWithPayload( + args: MalformedAcceptWithPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedAcceptWithPayload( + args: MalformedAcceptWithPayloadCommandInput, + cb: (err: any, data?: MalformedAcceptWithPayloadCommandOutput) => void + ): void; + malformedAcceptWithPayload( + args: MalformedAcceptWithPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedAcceptWithPayloadCommandOutput) => void + ): void; + + /** + * @see {@link MalformedBlobCommand} + */ + malformedBlob(): Promise; + malformedBlob(args: MalformedBlobCommandInput, options?: __HttpHandlerOptions): Promise; + malformedBlob(args: MalformedBlobCommandInput, cb: (err: any, data?: MalformedBlobCommandOutput) => void): void; + malformedBlob( + args: MalformedBlobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedBlobCommandOutput) => void + ): void; + + /** + * @see {@link MalformedBooleanCommand} + */ + malformedBoolean( + args: MalformedBooleanCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedBoolean( + args: MalformedBooleanCommandInput, + cb: (err: any, data?: MalformedBooleanCommandOutput) => void + ): void; + malformedBoolean( + args: MalformedBooleanCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedBooleanCommandOutput) => void + ): void; + + /** + * @see {@link MalformedByteCommand} + */ + malformedByte(args: MalformedByteCommandInput, options?: __HttpHandlerOptions): Promise; + malformedByte(args: MalformedByteCommandInput, cb: (err: any, data?: MalformedByteCommandOutput) => void): void; + malformedByte( + args: MalformedByteCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedByteCommandOutput) => void + ): void; + + /** + * @see {@link MalformedContentTypeWithBodyCommand} + */ + malformedContentTypeWithBody(): Promise; + malformedContentTypeWithBody( + args: MalformedContentTypeWithBodyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedContentTypeWithBody( + args: MalformedContentTypeWithBodyCommandInput, + cb: (err: any, data?: MalformedContentTypeWithBodyCommandOutput) => void + ): void; + malformedContentTypeWithBody( + args: MalformedContentTypeWithBodyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedContentTypeWithBodyCommandOutput) => void + ): void; + + /** + * @see {@link MalformedContentTypeWithGenericStringCommand} + */ + malformedContentTypeWithGenericString(): Promise; + malformedContentTypeWithGenericString( + args: MalformedContentTypeWithGenericStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedContentTypeWithGenericString( + args: MalformedContentTypeWithGenericStringCommandInput, + cb: (err: any, data?: MalformedContentTypeWithGenericStringCommandOutput) => void + ): void; + malformedContentTypeWithGenericString( + args: MalformedContentTypeWithGenericStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedContentTypeWithGenericStringCommandOutput) => void + ): void; + + /** + * @see {@link MalformedContentTypeWithoutBodyCommand} + */ + malformedContentTypeWithoutBody(): Promise; + malformedContentTypeWithoutBody( + args: MalformedContentTypeWithoutBodyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedContentTypeWithoutBody( + args: MalformedContentTypeWithoutBodyCommandInput, + cb: (err: any, data?: MalformedContentTypeWithoutBodyCommandOutput) => void + ): void; + malformedContentTypeWithoutBody( + args: MalformedContentTypeWithoutBodyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedContentTypeWithoutBodyCommandOutput) => void + ): void; + + /** + * @see {@link MalformedContentTypeWithoutBodyEmptyInputCommand} + */ + malformedContentTypeWithoutBodyEmptyInput(): Promise; + malformedContentTypeWithoutBodyEmptyInput( + args: MalformedContentTypeWithoutBodyEmptyInputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedContentTypeWithoutBodyEmptyInput( + args: MalformedContentTypeWithoutBodyEmptyInputCommandInput, + cb: (err: any, data?: MalformedContentTypeWithoutBodyEmptyInputCommandOutput) => void + ): void; + malformedContentTypeWithoutBodyEmptyInput( + args: MalformedContentTypeWithoutBodyEmptyInputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedContentTypeWithoutBodyEmptyInputCommandOutput) => void + ): void; + + /** + * @see {@link MalformedContentTypeWithPayloadCommand} + */ + malformedContentTypeWithPayload(): Promise; + malformedContentTypeWithPayload( + args: MalformedContentTypeWithPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedContentTypeWithPayload( + args: MalformedContentTypeWithPayloadCommandInput, + cb: (err: any, data?: MalformedContentTypeWithPayloadCommandOutput) => void + ): void; + malformedContentTypeWithPayload( + args: MalformedContentTypeWithPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedContentTypeWithPayloadCommandOutput) => void + ): void; + + /** + * @see {@link MalformedDoubleCommand} + */ + malformedDouble( + args: MalformedDoubleCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedDouble(args: MalformedDoubleCommandInput, cb: (err: any, data?: MalformedDoubleCommandOutput) => void): void; + malformedDouble( + args: MalformedDoubleCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedDoubleCommandOutput) => void + ): void; + + /** + * @see {@link MalformedFloatCommand} + */ + malformedFloat( + args: MalformedFloatCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedFloat(args: MalformedFloatCommandInput, cb: (err: any, data?: MalformedFloatCommandOutput) => void): void; + malformedFloat( + args: MalformedFloatCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedFloatCommandOutput) => void + ): void; + + /** + * @see {@link MalformedIntegerCommand} + */ + malformedInteger( + args: MalformedIntegerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedInteger( + args: MalformedIntegerCommandInput, + cb: (err: any, data?: MalformedIntegerCommandOutput) => void + ): void; + malformedInteger( + args: MalformedIntegerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedIntegerCommandOutput) => void + ): void; + + /** + * @see {@link MalformedListCommand} + */ + malformedList(): Promise; + malformedList(args: MalformedListCommandInput, options?: __HttpHandlerOptions): Promise; + malformedList(args: MalformedListCommandInput, cb: (err: any, data?: MalformedListCommandOutput) => void): void; + malformedList( + args: MalformedListCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedListCommandOutput) => void + ): void; + + /** + * @see {@link MalformedLongCommand} + */ + malformedLong(args: MalformedLongCommandInput, options?: __HttpHandlerOptions): Promise; + malformedLong(args: MalformedLongCommandInput, cb: (err: any, data?: MalformedLongCommandOutput) => void): void; + malformedLong( + args: MalformedLongCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedLongCommandOutput) => void + ): void; + + /** + * @see {@link MalformedMapCommand} + */ + malformedMap(): Promise; + malformedMap(args: MalformedMapCommandInput, options?: __HttpHandlerOptions): Promise; + malformedMap(args: MalformedMapCommandInput, cb: (err: any, data?: MalformedMapCommandOutput) => void): void; + malformedMap( + args: MalformedMapCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedMapCommandOutput) => void + ): void; + + /** + * @see {@link MalformedRequestBodyCommand} + */ + malformedRequestBody(): Promise; + malformedRequestBody( + args: MalformedRequestBodyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedRequestBody( + args: MalformedRequestBodyCommandInput, + cb: (err: any, data?: MalformedRequestBodyCommandOutput) => void + ): void; + malformedRequestBody( + args: MalformedRequestBodyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedRequestBodyCommandOutput) => void + ): void; + + /** + * @see {@link MalformedShortCommand} + */ + malformedShort( + args: MalformedShortCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedShort(args: MalformedShortCommandInput, cb: (err: any, data?: MalformedShortCommandOutput) => void): void; + malformedShort( + args: MalformedShortCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedShortCommandOutput) => void + ): void; + + /** + * @see {@link MalformedStringCommand} + */ + malformedString(): Promise; + malformedString( + args: MalformedStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedString(args: MalformedStringCommandInput, cb: (err: any, data?: MalformedStringCommandOutput) => void): void; + malformedString( + args: MalformedStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedStringCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampBodyDateTimeCommand} + */ + malformedTimestampBodyDateTime( + args: MalformedTimestampBodyDateTimeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampBodyDateTime( + args: MalformedTimestampBodyDateTimeCommandInput, + cb: (err: any, data?: MalformedTimestampBodyDateTimeCommandOutput) => void + ): void; + malformedTimestampBodyDateTime( + args: MalformedTimestampBodyDateTimeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampBodyDateTimeCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampBodyDefaultCommand} + */ + malformedTimestampBodyDefault( + args: MalformedTimestampBodyDefaultCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampBodyDefault( + args: MalformedTimestampBodyDefaultCommandInput, + cb: (err: any, data?: MalformedTimestampBodyDefaultCommandOutput) => void + ): void; + malformedTimestampBodyDefault( + args: MalformedTimestampBodyDefaultCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampBodyDefaultCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampBodyHttpDateCommand} + */ + malformedTimestampBodyHttpDate( + args: MalformedTimestampBodyHttpDateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampBodyHttpDate( + args: MalformedTimestampBodyHttpDateCommandInput, + cb: (err: any, data?: MalformedTimestampBodyHttpDateCommandOutput) => void + ): void; + malformedTimestampBodyHttpDate( + args: MalformedTimestampBodyHttpDateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampBodyHttpDateCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampHeaderDateTimeCommand} + */ + malformedTimestampHeaderDateTime( + args: MalformedTimestampHeaderDateTimeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampHeaderDateTime( + args: MalformedTimestampHeaderDateTimeCommandInput, + cb: (err: any, data?: MalformedTimestampHeaderDateTimeCommandOutput) => void + ): void; + malformedTimestampHeaderDateTime( + args: MalformedTimestampHeaderDateTimeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampHeaderDateTimeCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampHeaderDefaultCommand} + */ + malformedTimestampHeaderDefault( + args: MalformedTimestampHeaderDefaultCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampHeaderDefault( + args: MalformedTimestampHeaderDefaultCommandInput, + cb: (err: any, data?: MalformedTimestampHeaderDefaultCommandOutput) => void + ): void; + malformedTimestampHeaderDefault( + args: MalformedTimestampHeaderDefaultCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampHeaderDefaultCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampHeaderEpochCommand} + */ + malformedTimestampHeaderEpoch( + args: MalformedTimestampHeaderEpochCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampHeaderEpoch( + args: MalformedTimestampHeaderEpochCommandInput, + cb: (err: any, data?: MalformedTimestampHeaderEpochCommandOutput) => void + ): void; + malformedTimestampHeaderEpoch( + args: MalformedTimestampHeaderEpochCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampHeaderEpochCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampPathDefaultCommand} + */ + malformedTimestampPathDefault( + args: MalformedTimestampPathDefaultCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampPathDefault( + args: MalformedTimestampPathDefaultCommandInput, + cb: (err: any, data?: MalformedTimestampPathDefaultCommandOutput) => void + ): void; + malformedTimestampPathDefault( + args: MalformedTimestampPathDefaultCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampPathDefaultCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampPathEpochCommand} + */ + malformedTimestampPathEpoch( + args: MalformedTimestampPathEpochCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampPathEpoch( + args: MalformedTimestampPathEpochCommandInput, + cb: (err: any, data?: MalformedTimestampPathEpochCommandOutput) => void + ): void; + malformedTimestampPathEpoch( + args: MalformedTimestampPathEpochCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampPathEpochCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampPathHttpDateCommand} + */ + malformedTimestampPathHttpDate( + args: MalformedTimestampPathHttpDateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampPathHttpDate( + args: MalformedTimestampPathHttpDateCommandInput, + cb: (err: any, data?: MalformedTimestampPathHttpDateCommandOutput) => void + ): void; + malformedTimestampPathHttpDate( + args: MalformedTimestampPathHttpDateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampPathHttpDateCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampQueryDefaultCommand} + */ + malformedTimestampQueryDefault( + args: MalformedTimestampQueryDefaultCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampQueryDefault( + args: MalformedTimestampQueryDefaultCommandInput, + cb: (err: any, data?: MalformedTimestampQueryDefaultCommandOutput) => void + ): void; + malformedTimestampQueryDefault( + args: MalformedTimestampQueryDefaultCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampQueryDefaultCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampQueryEpochCommand} + */ + malformedTimestampQueryEpoch( + args: MalformedTimestampQueryEpochCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampQueryEpoch( + args: MalformedTimestampQueryEpochCommandInput, + cb: (err: any, data?: MalformedTimestampQueryEpochCommandOutput) => void + ): void; + malformedTimestampQueryEpoch( + args: MalformedTimestampQueryEpochCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampQueryEpochCommandOutput) => void + ): void; + + /** + * @see {@link MalformedTimestampQueryHttpDateCommand} + */ + malformedTimestampQueryHttpDate( + args: MalformedTimestampQueryHttpDateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedTimestampQueryHttpDate( + args: MalformedTimestampQueryHttpDateCommandInput, + cb: (err: any, data?: MalformedTimestampQueryHttpDateCommandOutput) => void + ): void; + malformedTimestampQueryHttpDate( + args: MalformedTimestampQueryHttpDateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedTimestampQueryHttpDateCommandOutput) => void + ): void; + + /** + * @see {@link MalformedUnionCommand} + */ + malformedUnion(): Promise; + malformedUnion( + args: MalformedUnionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + malformedUnion(args: MalformedUnionCommandInput, cb: (err: any, data?: MalformedUnionCommandOutput) => void): void; + malformedUnion( + args: MalformedUnionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MalformedUnionCommandOutput) => void + ): void; + + /** + * @see {@link MediaTypeHeaderCommand} + */ + mediaTypeHeader(): Promise; + mediaTypeHeader( + args: MediaTypeHeaderCommandInput, + options?: __HttpHandlerOptions + ): Promise; + mediaTypeHeader(args: MediaTypeHeaderCommandInput, cb: (err: any, data?: MediaTypeHeaderCommandOutput) => void): void; + mediaTypeHeader( + args: MediaTypeHeaderCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MediaTypeHeaderCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndNoOutputCommand} + */ + noInputAndNoOutput(): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndOutputCommand} + */ + noInputAndOutput(): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + + /** + * @see {@link NullAndEmptyHeadersClientCommand} + */ + nullAndEmptyHeadersClient(): Promise; + nullAndEmptyHeadersClient( + args: NullAndEmptyHeadersClientCommandInput, + options?: __HttpHandlerOptions + ): Promise; + nullAndEmptyHeadersClient( + args: NullAndEmptyHeadersClientCommandInput, + cb: (err: any, data?: NullAndEmptyHeadersClientCommandOutput) => void + ): void; + nullAndEmptyHeadersClient( + args: NullAndEmptyHeadersClientCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NullAndEmptyHeadersClientCommandOutput) => void + ): void; + + /** + * @see {@link NullAndEmptyHeadersServerCommand} + */ + nullAndEmptyHeadersServer(): Promise; + nullAndEmptyHeadersServer( + args: NullAndEmptyHeadersServerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + nullAndEmptyHeadersServer( + args: NullAndEmptyHeadersServerCommandInput, + cb: (err: any, data?: NullAndEmptyHeadersServerCommandOutput) => void + ): void; + nullAndEmptyHeadersServer( + args: NullAndEmptyHeadersServerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NullAndEmptyHeadersServerCommandOutput) => void + ): void; + + /** + * @see {@link OmitsNullSerializesEmptyStringCommand} + */ + omitsNullSerializesEmptyString(): Promise; + omitsNullSerializesEmptyString( + args: OmitsNullSerializesEmptyStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + omitsNullSerializesEmptyString( + args: OmitsNullSerializesEmptyStringCommandInput, + cb: (err: any, data?: OmitsNullSerializesEmptyStringCommandOutput) => void + ): void; + omitsNullSerializesEmptyString( + args: OmitsNullSerializesEmptyStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OmitsNullSerializesEmptyStringCommandOutput) => void + ): void; + + /** + * @see {@link OmitsSerializingEmptyListsCommand} + */ + omitsSerializingEmptyLists(): Promise; + omitsSerializingEmptyLists( + args: OmitsSerializingEmptyListsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + omitsSerializingEmptyLists( + args: OmitsSerializingEmptyListsCommandInput, + cb: (err: any, data?: OmitsSerializingEmptyListsCommandOutput) => void + ): void; + omitsSerializingEmptyLists( + args: OmitsSerializingEmptyListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OmitsSerializingEmptyListsCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithDefaultsCommand} + */ + operationWithDefaults(): Promise; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void + ): void; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithNestedStructureCommand} + */ + operationWithNestedStructure( + args: OperationWithNestedStructureCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithNestedStructure( + args: OperationWithNestedStructureCommandInput, + cb: (err: any, data?: OperationWithNestedStructureCommandOutput) => void + ): void; + operationWithNestedStructure( + args: OperationWithNestedStructureCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithNestedStructureCommandOutput) => void + ): void; + + /** + * @see {@link PostPlayerActionCommand} + */ + postPlayerAction(): Promise; + postPlayerAction( + args: PostPlayerActionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + postPlayerAction( + args: PostPlayerActionCommandInput, + cb: (err: any, data?: PostPlayerActionCommandOutput) => void + ): void; + postPlayerAction( + args: PostPlayerActionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PostPlayerActionCommandOutput) => void + ): void; + + /** + * @see {@link PostUnionWithJsonNameCommand} + */ + postUnionWithJsonName(): Promise; + postUnionWithJsonName( + args: PostUnionWithJsonNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + postUnionWithJsonName( + args: PostUnionWithJsonNameCommandInput, + cb: (err: any, data?: PostUnionWithJsonNameCommandOutput) => void + ): void; + postUnionWithJsonName( + args: PostUnionWithJsonNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PostUnionWithJsonNameCommandOutput) => void + ): void; + + /** + * @see {@link PutWithContentEncodingCommand} + */ + putWithContentEncoding(): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + + /** + * @see {@link QueryIdempotencyTokenAutoFillCommand} + */ + queryIdempotencyTokenAutoFill(): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + + /** + * @see {@link QueryParamsAsStringListMapCommand} + */ + queryParamsAsStringListMap(): Promise; + queryParamsAsStringListMap( + args: QueryParamsAsStringListMapCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryParamsAsStringListMap( + args: QueryParamsAsStringListMapCommandInput, + cb: (err: any, data?: QueryParamsAsStringListMapCommandOutput) => void + ): void; + queryParamsAsStringListMap( + args: QueryParamsAsStringListMapCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryParamsAsStringListMapCommandOutput) => void + ): void; + + /** + * @see {@link QueryPrecedenceCommand} + */ + queryPrecedence(): Promise; + queryPrecedence( + args: QueryPrecedenceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryPrecedence(args: QueryPrecedenceCommandInput, cb: (err: any, data?: QueryPrecedenceCommandOutput) => void): void; + queryPrecedence( + args: QueryPrecedenceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryPrecedenceCommandOutput) => void + ): void; + + /** + * @see {@link RecursiveShapesCommand} + */ + recursiveShapes(): Promise; + recursiveShapes( + args: RecursiveShapesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + recursiveShapes(args: RecursiveShapesCommandInput, cb: (err: any, data?: RecursiveShapesCommandOutput) => void): void; + recursiveShapes( + args: RecursiveShapesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RecursiveShapesCommandOutput) => void + ): void; + + /** + * @see {@link ResponseCodeHttpFallbackCommand} + */ + responseCodeHttpFallback(): Promise; + responseCodeHttpFallback( + args: ResponseCodeHttpFallbackCommandInput, + options?: __HttpHandlerOptions + ): Promise; + responseCodeHttpFallback( + args: ResponseCodeHttpFallbackCommandInput, + cb: (err: any, data?: ResponseCodeHttpFallbackCommandOutput) => void + ): void; + responseCodeHttpFallback( + args: ResponseCodeHttpFallbackCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ResponseCodeHttpFallbackCommandOutput) => void + ): void; + + /** + * @see {@link ResponseCodeRequiredCommand} + */ + responseCodeRequired(): Promise; + responseCodeRequired( + args: ResponseCodeRequiredCommandInput, + options?: __HttpHandlerOptions + ): Promise; + responseCodeRequired( + args: ResponseCodeRequiredCommandInput, + cb: (err: any, data?: ResponseCodeRequiredCommandOutput) => void + ): void; + responseCodeRequired( + args: ResponseCodeRequiredCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ResponseCodeRequiredCommandOutput) => void + ): void; + + /** + * @see {@link SimpleScalarPropertiesCommand} + */ + simpleScalarProperties(): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + + /** + * @see {@link SparseJsonListsCommand} + */ + sparseJsonLists(): Promise; + sparseJsonLists( + args: SparseJsonListsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + sparseJsonLists(args: SparseJsonListsCommandInput, cb: (err: any, data?: SparseJsonListsCommandOutput) => void): void; + sparseJsonLists( + args: SparseJsonListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SparseJsonListsCommandOutput) => void + ): void; + + /** + * @see {@link SparseJsonMapsCommand} + */ + sparseJsonMaps(): Promise; + sparseJsonMaps( + args: SparseJsonMapsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + sparseJsonMaps(args: SparseJsonMapsCommandInput, cb: (err: any, data?: SparseJsonMapsCommandOutput) => void): void; + sparseJsonMaps( + args: SparseJsonMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SparseJsonMapsCommandOutput) => void + ): void; + + /** + * @see {@link StreamingTraitsCommand} + */ + streamingTraits(): Promise; + streamingTraits( + args: StreamingTraitsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + streamingTraits(args: StreamingTraitsCommandInput, cb: (err: any, data?: StreamingTraitsCommandOutput) => void): void; + streamingTraits( + args: StreamingTraitsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StreamingTraitsCommandOutput) => void + ): void; + + /** + * @see {@link StreamingTraitsRequireLengthCommand} + */ + streamingTraitsRequireLength(): Promise; + streamingTraitsRequireLength( + args: StreamingTraitsRequireLengthCommandInput, + options?: __HttpHandlerOptions + ): Promise; + streamingTraitsRequireLength( + args: StreamingTraitsRequireLengthCommandInput, + cb: (err: any, data?: StreamingTraitsRequireLengthCommandOutput) => void + ): void; + streamingTraitsRequireLength( + args: StreamingTraitsRequireLengthCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StreamingTraitsRequireLengthCommandOutput) => void + ): void; + + /** + * @see {@link StreamingTraitsWithMediaTypeCommand} + */ + streamingTraitsWithMediaType(): Promise; + streamingTraitsWithMediaType( + args: StreamingTraitsWithMediaTypeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + streamingTraitsWithMediaType( + args: StreamingTraitsWithMediaTypeCommandInput, + cb: (err: any, data?: StreamingTraitsWithMediaTypeCommandOutput) => void + ): void; + streamingTraitsWithMediaType( + args: StreamingTraitsWithMediaTypeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StreamingTraitsWithMediaTypeCommandOutput) => void + ): void; + + /** + * @see {@link TestBodyStructureCommand} + */ + testBodyStructure(): Promise; + testBodyStructure( + args: TestBodyStructureCommandInput, + options?: __HttpHandlerOptions + ): Promise; + testBodyStructure( + args: TestBodyStructureCommandInput, + cb: (err: any, data?: TestBodyStructureCommandOutput) => void + ): void; + testBodyStructure( + args: TestBodyStructureCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestBodyStructureCommandOutput) => void + ): void; + + /** + * @see {@link TestGetNoInputNoPayloadCommand} + */ + testGetNoInputNoPayload(): Promise; + testGetNoInputNoPayload( + args: TestGetNoInputNoPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + testGetNoInputNoPayload( + args: TestGetNoInputNoPayloadCommandInput, + cb: (err: any, data?: TestGetNoInputNoPayloadCommandOutput) => void + ): void; + testGetNoInputNoPayload( + args: TestGetNoInputNoPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestGetNoInputNoPayloadCommandOutput) => void + ): void; + + /** + * @see {@link TestGetNoPayloadCommand} + */ + testGetNoPayload(): Promise; + testGetNoPayload( + args: TestGetNoPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + testGetNoPayload( + args: TestGetNoPayloadCommandInput, + cb: (err: any, data?: TestGetNoPayloadCommandOutput) => void + ): void; + testGetNoPayload( + args: TestGetNoPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestGetNoPayloadCommandOutput) => void + ): void; + + /** + * @see {@link TestPayloadBlobCommand} + */ + testPayloadBlob(): Promise; + testPayloadBlob( + args: TestPayloadBlobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + testPayloadBlob(args: TestPayloadBlobCommandInput, cb: (err: any, data?: TestPayloadBlobCommandOutput) => void): void; + testPayloadBlob( + args: TestPayloadBlobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestPayloadBlobCommandOutput) => void + ): void; + + /** + * @see {@link TestPayloadStructureCommand} + */ + testPayloadStructure(): Promise; + testPayloadStructure( + args: TestPayloadStructureCommandInput, + options?: __HttpHandlerOptions + ): Promise; + testPayloadStructure( + args: TestPayloadStructureCommandInput, + cb: (err: any, data?: TestPayloadStructureCommandOutput) => void + ): void; + testPayloadStructure( + args: TestPayloadStructureCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestPayloadStructureCommandOutput) => void + ): void; + + /** + * @see {@link TestPostNoInputNoPayloadCommand} + */ + testPostNoInputNoPayload(): Promise; + testPostNoInputNoPayload( + args: TestPostNoInputNoPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + testPostNoInputNoPayload( + args: TestPostNoInputNoPayloadCommandInput, + cb: (err: any, data?: TestPostNoInputNoPayloadCommandOutput) => void + ): void; + testPostNoInputNoPayload( + args: TestPostNoInputNoPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestPostNoInputNoPayloadCommandOutput) => void + ): void; + + /** + * @see {@link TestPostNoPayloadCommand} + */ + testPostNoPayload(): Promise; + testPostNoPayload( + args: TestPostNoPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + testPostNoPayload( + args: TestPostNoPayloadCommandInput, + cb: (err: any, data?: TestPostNoPayloadCommandOutput) => void + ): void; + testPostNoPayload( + args: TestPostNoPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestPostNoPayloadCommandOutput) => void + ): void; + + /** + * @see {@link TimestampFormatHeadersCommand} + */ + timestampFormatHeaders(): Promise; + timestampFormatHeaders( + args: TimestampFormatHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + timestampFormatHeaders( + args: TimestampFormatHeadersCommandInput, + cb: (err: any, data?: TimestampFormatHeadersCommandOutput) => void + ): void; + timestampFormatHeaders( + args: TimestampFormatHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TimestampFormatHeadersCommandOutput) => void + ): void; + + /** + * @see {@link UnitInputAndOutputCommand} + */ + unitInputAndOutput(): Promise; + unitInputAndOutput( + args: UnitInputAndOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + unitInputAndOutput( + args: UnitInputAndOutputCommandInput, + cb: (err: any, data?: UnitInputAndOutputCommandOutput) => void + ): void; + unitInputAndOutput( + args: UnitInputAndOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UnitInputAndOutputCommandOutput) => void + ): void; +} + +/** + * A REST JSON service that sends JSON requests and responses. + * @public + */ +export class RestJsonProtocol extends RestJsonProtocolClient implements RestJsonProtocol {} +createAggregatedClient(commands, RestJsonProtocol); diff --git a/private/aws-protocoltests-restjson-schema/src/RestJsonProtocolClient.ts b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocolClient.ts new file mode 100644 index 0000000000000..cc019186eac03 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocolClient.ts @@ -0,0 +1,869 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + Checksum as __Checksum, + ChecksumConstructor as __ChecksumConstructor, + ClientProtocol, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + HttpRequest, + HttpResponse, + Logger as __Logger, + Provider as __Provider, + Provider, + SdkStreamMixinInjector as __SdkStreamMixinInjector, + StreamCollector as __StreamCollector, + StreamHasher as __StreamHasher, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; +import { Readable } from "stream"; + +import { + defaultRestJsonProtocolHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, +} from "./commands/AllQueryStringTypesCommand"; +import { + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, +} from "./commands/ConstantAndVariableQueryStringCommand"; +import { + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, +} from "./commands/ConstantQueryStringCommand"; +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "./commands/DatetimeOffsetsCommand"; +import { + DocumentTypeAsMapValueCommandInput, + DocumentTypeAsMapValueCommandOutput, +} from "./commands/DocumentTypeAsMapValueCommand"; +import { + DocumentTypeAsPayloadCommandInput, + DocumentTypeAsPayloadCommandOutput, +} from "./commands/DocumentTypeAsPayloadCommand"; +import { DocumentTypeCommandInput, DocumentTypeCommandOutput } from "./commands/DocumentTypeCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "./commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "./commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "./commands/HostWithPathOperationCommand"; +import { + HttpChecksumRequiredCommandInput, + HttpChecksumRequiredCommandOutput, +} from "./commands/HttpChecksumRequiredCommand"; +import { + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, +} from "./commands/HttpEmptyPrefixHeadersCommand"; +import { HttpEnumPayloadCommandInput, HttpEnumPayloadCommandOutput } from "./commands/HttpEnumPayloadCommand"; +import { HttpPayloadTraitsCommandInput, HttpPayloadTraitsCommandOutput } from "./commands/HttpPayloadTraitsCommand"; +import { + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, +} from "./commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, +} from "./commands/HttpPayloadWithStructureCommand"; +import { + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, +} from "./commands/HttpPayloadWithUnionCommand"; +import { HttpPrefixHeadersCommandInput, HttpPrefixHeadersCommandOutput } from "./commands/HttpPrefixHeadersCommand"; +import { + HttpPrefixHeadersInResponseCommandInput, + HttpPrefixHeadersInResponseCommandOutput, +} from "./commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, +} from "./commands/HttpRequestWithFloatLabelsCommand"; +import { + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, +} from "./commands/HttpRequestWithGreedyLabelInPathCommand"; +import { + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, +} from "./commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, +} from "./commands/HttpRequestWithLabelsCommand"; +import { + HttpRequestWithRegexLiteralCommandInput, + HttpRequestWithRegexLiteralCommandOutput, +} from "./commands/HttpRequestWithRegexLiteralCommand"; +import { HttpResponseCodeCommandInput, HttpResponseCodeCommandOutput } from "./commands/HttpResponseCodeCommand"; +import { HttpStringPayloadCommandInput, HttpStringPayloadCommandOutput } from "./commands/HttpStringPayloadCommand"; +import { + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, +} from "./commands/IgnoreQueryParamsInResponseCommand"; +import { + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, +} from "./commands/InputAndOutputWithHeadersCommand"; +import { JsonBlobsCommandInput, JsonBlobsCommandOutput } from "./commands/JsonBlobsCommand"; +import { JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; +import { JsonIntEnumsCommandInput, JsonIntEnumsCommandOutput } from "./commands/JsonIntEnumsCommand"; +import { JsonListsCommandInput, JsonListsCommandOutput } from "./commands/JsonListsCommand"; +import { JsonMapsCommandInput, JsonMapsCommandOutput } from "./commands/JsonMapsCommand"; +import { JsonTimestampsCommandInput, JsonTimestampsCommandOutput } from "./commands/JsonTimestampsCommand"; +import { JsonUnionsCommandInput, JsonUnionsCommandOutput } from "./commands/JsonUnionsCommand"; +import { + MalformedAcceptWithBodyCommandInput, + MalformedAcceptWithBodyCommandOutput, +} from "./commands/MalformedAcceptWithBodyCommand"; +import { + MalformedAcceptWithGenericStringCommandInput, + MalformedAcceptWithGenericStringCommandOutput, +} from "./commands/MalformedAcceptWithGenericStringCommand"; +import { + MalformedAcceptWithPayloadCommandInput, + MalformedAcceptWithPayloadCommandOutput, +} from "./commands/MalformedAcceptWithPayloadCommand"; +import { MalformedBlobCommandInput, MalformedBlobCommandOutput } from "./commands/MalformedBlobCommand"; +import { MalformedBooleanCommandInput, MalformedBooleanCommandOutput } from "./commands/MalformedBooleanCommand"; +import { MalformedByteCommandInput, MalformedByteCommandOutput } from "./commands/MalformedByteCommand"; +import { + MalformedContentTypeWithBodyCommandInput, + MalformedContentTypeWithBodyCommandOutput, +} from "./commands/MalformedContentTypeWithBodyCommand"; +import { + MalformedContentTypeWithGenericStringCommandInput, + MalformedContentTypeWithGenericStringCommandOutput, +} from "./commands/MalformedContentTypeWithGenericStringCommand"; +import { + MalformedContentTypeWithoutBodyCommandInput, + MalformedContentTypeWithoutBodyCommandOutput, +} from "./commands/MalformedContentTypeWithoutBodyCommand"; +import { + MalformedContentTypeWithoutBodyEmptyInputCommandInput, + MalformedContentTypeWithoutBodyEmptyInputCommandOutput, +} from "./commands/MalformedContentTypeWithoutBodyEmptyInputCommand"; +import { + MalformedContentTypeWithPayloadCommandInput, + MalformedContentTypeWithPayloadCommandOutput, +} from "./commands/MalformedContentTypeWithPayloadCommand"; +import { MalformedDoubleCommandInput, MalformedDoubleCommandOutput } from "./commands/MalformedDoubleCommand"; +import { MalformedFloatCommandInput, MalformedFloatCommandOutput } from "./commands/MalformedFloatCommand"; +import { MalformedIntegerCommandInput, MalformedIntegerCommandOutput } from "./commands/MalformedIntegerCommand"; +import { MalformedListCommandInput, MalformedListCommandOutput } from "./commands/MalformedListCommand"; +import { MalformedLongCommandInput, MalformedLongCommandOutput } from "./commands/MalformedLongCommand"; +import { MalformedMapCommandInput, MalformedMapCommandOutput } from "./commands/MalformedMapCommand"; +import { + MalformedRequestBodyCommandInput, + MalformedRequestBodyCommandOutput, +} from "./commands/MalformedRequestBodyCommand"; +import { MalformedShortCommandInput, MalformedShortCommandOutput } from "./commands/MalformedShortCommand"; +import { MalformedStringCommandInput, MalformedStringCommandOutput } from "./commands/MalformedStringCommand"; +import { + MalformedTimestampBodyDateTimeCommandInput, + MalformedTimestampBodyDateTimeCommandOutput, +} from "./commands/MalformedTimestampBodyDateTimeCommand"; +import { + MalformedTimestampBodyDefaultCommandInput, + MalformedTimestampBodyDefaultCommandOutput, +} from "./commands/MalformedTimestampBodyDefaultCommand"; +import { + MalformedTimestampBodyHttpDateCommandInput, + MalformedTimestampBodyHttpDateCommandOutput, +} from "./commands/MalformedTimestampBodyHttpDateCommand"; +import { + MalformedTimestampHeaderDateTimeCommandInput, + MalformedTimestampHeaderDateTimeCommandOutput, +} from "./commands/MalformedTimestampHeaderDateTimeCommand"; +import { + MalformedTimestampHeaderDefaultCommandInput, + MalformedTimestampHeaderDefaultCommandOutput, +} from "./commands/MalformedTimestampHeaderDefaultCommand"; +import { + MalformedTimestampHeaderEpochCommandInput, + MalformedTimestampHeaderEpochCommandOutput, +} from "./commands/MalformedTimestampHeaderEpochCommand"; +import { + MalformedTimestampPathDefaultCommandInput, + MalformedTimestampPathDefaultCommandOutput, +} from "./commands/MalformedTimestampPathDefaultCommand"; +import { + MalformedTimestampPathEpochCommandInput, + MalformedTimestampPathEpochCommandOutput, +} from "./commands/MalformedTimestampPathEpochCommand"; +import { + MalformedTimestampPathHttpDateCommandInput, + MalformedTimestampPathHttpDateCommandOutput, +} from "./commands/MalformedTimestampPathHttpDateCommand"; +import { + MalformedTimestampQueryDefaultCommandInput, + MalformedTimestampQueryDefaultCommandOutput, +} from "./commands/MalformedTimestampQueryDefaultCommand"; +import { + MalformedTimestampQueryEpochCommandInput, + MalformedTimestampQueryEpochCommandOutput, +} from "./commands/MalformedTimestampQueryEpochCommand"; +import { + MalformedTimestampQueryHttpDateCommandInput, + MalformedTimestampQueryHttpDateCommandOutput, +} from "./commands/MalformedTimestampQueryHttpDateCommand"; +import { MalformedUnionCommandInput, MalformedUnionCommandOutput } from "./commands/MalformedUnionCommand"; +import { MediaTypeHeaderCommandInput, MediaTypeHeaderCommandOutput } from "./commands/MediaTypeHeaderCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "./commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "./commands/NoInputAndOutputCommand"; +import { + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, +} from "./commands/NullAndEmptyHeadersClientCommand"; +import { + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, +} from "./commands/NullAndEmptyHeadersServerCommand"; +import { + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, +} from "./commands/OmitsNullSerializesEmptyStringCommand"; +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, + PostUnionWithJsonNameCommandOutput, +} from "./commands/PostUnionWithJsonNameCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, +} from "./commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommandInput, QueryPrecedenceCommandOutput } from "./commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from "./commands/RecursiveShapesCommand"; +import { + ResponseCodeHttpFallbackCommandInput, + ResponseCodeHttpFallbackCommandOutput, +} from "./commands/ResponseCodeHttpFallbackCommand"; +import { + ResponseCodeRequiredCommandInput, + ResponseCodeRequiredCommandOutput, +} from "./commands/ResponseCodeRequiredCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { SparseJsonListsCommandInput, SparseJsonListsCommandOutput } from "./commands/SparseJsonListsCommand"; +import { SparseJsonMapsCommandInput, SparseJsonMapsCommandOutput } from "./commands/SparseJsonMapsCommand"; +import { StreamingTraitsCommandInput, StreamingTraitsCommandOutput } from "./commands/StreamingTraitsCommand"; +import { + StreamingTraitsRequireLengthCommandInput, + StreamingTraitsRequireLengthCommandOutput, +} from "./commands/StreamingTraitsRequireLengthCommand"; +import { + StreamingTraitsWithMediaTypeCommandInput, + StreamingTraitsWithMediaTypeCommandOutput, +} from "./commands/StreamingTraitsWithMediaTypeCommand"; +import { TestBodyStructureCommandInput, TestBodyStructureCommandOutput } from "./commands/TestBodyStructureCommand"; +import { + TestGetNoInputNoPayloadCommandInput, + TestGetNoInputNoPayloadCommandOutput, +} from "./commands/TestGetNoInputNoPayloadCommand"; +import { TestGetNoPayloadCommandInput, TestGetNoPayloadCommandOutput } from "./commands/TestGetNoPayloadCommand"; +import { TestPayloadBlobCommandInput, TestPayloadBlobCommandOutput } from "./commands/TestPayloadBlobCommand"; +import { + TestPayloadStructureCommandInput, + TestPayloadStructureCommandOutput, +} from "./commands/TestPayloadStructureCommand"; +import { + TestPostNoInputNoPayloadCommandInput, + TestPostNoInputNoPayloadCommandOutput, +} from "./commands/TestPostNoInputNoPayloadCommand"; +import { TestPostNoPayloadCommandInput, TestPostNoPayloadCommandOutput } from "./commands/TestPostNoPayloadCommand"; +import { + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, +} from "./commands/TimestampFormatHeadersCommand"; +import { UnitInputAndOutputCommandInput, UnitInputAndOutputCommandOutput } from "./commands/UnitInputAndOutputCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | AllQueryStringTypesCommandInput + | ConstantAndVariableQueryStringCommandInput + | ConstantQueryStringCommandInput + | ContentTypeParametersCommandInput + | DatetimeOffsetsCommandInput + | DocumentTypeAsMapValueCommandInput + | DocumentTypeAsPayloadCommandInput + | DocumentTypeCommandInput + | EmptyInputAndEmptyOutputCommandInput + | EndpointOperationCommandInput + | EndpointWithHostLabelOperationCommandInput + | FractionalSecondsCommandInput + | GreetingWithErrorsCommandInput + | HostWithPathOperationCommandInput + | HttpChecksumRequiredCommandInput + | HttpEmptyPrefixHeadersCommandInput + | HttpEnumPayloadCommandInput + | HttpPayloadTraitsCommandInput + | HttpPayloadTraitsWithMediaTypeCommandInput + | HttpPayloadWithStructureCommandInput + | HttpPayloadWithUnionCommandInput + | HttpPrefixHeadersCommandInput + | HttpPrefixHeadersInResponseCommandInput + | HttpRequestWithFloatLabelsCommandInput + | HttpRequestWithGreedyLabelInPathCommandInput + | HttpRequestWithLabelsAndTimestampFormatCommandInput + | HttpRequestWithLabelsCommandInput + | HttpRequestWithRegexLiteralCommandInput + | HttpResponseCodeCommandInput + | HttpStringPayloadCommandInput + | IgnoreQueryParamsInResponseCommandInput + | InputAndOutputWithHeadersCommandInput + | JsonBlobsCommandInput + | JsonEnumsCommandInput + | JsonIntEnumsCommandInput + | JsonListsCommandInput + | JsonMapsCommandInput + | JsonTimestampsCommandInput + | JsonUnionsCommandInput + | MalformedAcceptWithBodyCommandInput + | MalformedAcceptWithGenericStringCommandInput + | MalformedAcceptWithPayloadCommandInput + | MalformedBlobCommandInput + | MalformedBooleanCommandInput + | MalformedByteCommandInput + | MalformedContentTypeWithBodyCommandInput + | MalformedContentTypeWithGenericStringCommandInput + | MalformedContentTypeWithPayloadCommandInput + | MalformedContentTypeWithoutBodyCommandInput + | MalformedContentTypeWithoutBodyEmptyInputCommandInput + | MalformedDoubleCommandInput + | MalformedFloatCommandInput + | MalformedIntegerCommandInput + | MalformedListCommandInput + | MalformedLongCommandInput + | MalformedMapCommandInput + | MalformedRequestBodyCommandInput + | MalformedShortCommandInput + | MalformedStringCommandInput + | MalformedTimestampBodyDateTimeCommandInput + | MalformedTimestampBodyDefaultCommandInput + | MalformedTimestampBodyHttpDateCommandInput + | MalformedTimestampHeaderDateTimeCommandInput + | MalformedTimestampHeaderDefaultCommandInput + | MalformedTimestampHeaderEpochCommandInput + | MalformedTimestampPathDefaultCommandInput + | MalformedTimestampPathEpochCommandInput + | MalformedTimestampPathHttpDateCommandInput + | MalformedTimestampQueryDefaultCommandInput + | MalformedTimestampQueryEpochCommandInput + | MalformedTimestampQueryHttpDateCommandInput + | MalformedUnionCommandInput + | MediaTypeHeaderCommandInput + | NoInputAndNoOutputCommandInput + | NoInputAndOutputCommandInput + | NullAndEmptyHeadersClientCommandInput + | NullAndEmptyHeadersServerCommandInput + | OmitsNullSerializesEmptyStringCommandInput + | OmitsSerializingEmptyListsCommandInput + | OperationWithDefaultsCommandInput + | OperationWithNestedStructureCommandInput + | PostPlayerActionCommandInput + | PostUnionWithJsonNameCommandInput + | PutWithContentEncodingCommandInput + | QueryIdempotencyTokenAutoFillCommandInput + | QueryParamsAsStringListMapCommandInput + | QueryPrecedenceCommandInput + | RecursiveShapesCommandInput + | ResponseCodeHttpFallbackCommandInput + | ResponseCodeRequiredCommandInput + | SimpleScalarPropertiesCommandInput + | SparseJsonListsCommandInput + | SparseJsonMapsCommandInput + | StreamingTraitsCommandInput + | StreamingTraitsRequireLengthCommandInput + | StreamingTraitsWithMediaTypeCommandInput + | TestBodyStructureCommandInput + | TestGetNoInputNoPayloadCommandInput + | TestGetNoPayloadCommandInput + | TestPayloadBlobCommandInput + | TestPayloadStructureCommandInput + | TestPostNoInputNoPayloadCommandInput + | TestPostNoPayloadCommandInput + | TimestampFormatHeadersCommandInput + | UnitInputAndOutputCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | AllQueryStringTypesCommandOutput + | ConstantAndVariableQueryStringCommandOutput + | ConstantQueryStringCommandOutput + | ContentTypeParametersCommandOutput + | DatetimeOffsetsCommandOutput + | DocumentTypeAsMapValueCommandOutput + | DocumentTypeAsPayloadCommandOutput + | DocumentTypeCommandOutput + | EmptyInputAndEmptyOutputCommandOutput + | EndpointOperationCommandOutput + | EndpointWithHostLabelOperationCommandOutput + | FractionalSecondsCommandOutput + | GreetingWithErrorsCommandOutput + | HostWithPathOperationCommandOutput + | HttpChecksumRequiredCommandOutput + | HttpEmptyPrefixHeadersCommandOutput + | HttpEnumPayloadCommandOutput + | HttpPayloadTraitsCommandOutput + | HttpPayloadTraitsWithMediaTypeCommandOutput + | HttpPayloadWithStructureCommandOutput + | HttpPayloadWithUnionCommandOutput + | HttpPrefixHeadersCommandOutput + | HttpPrefixHeadersInResponseCommandOutput + | HttpRequestWithFloatLabelsCommandOutput + | HttpRequestWithGreedyLabelInPathCommandOutput + | HttpRequestWithLabelsAndTimestampFormatCommandOutput + | HttpRequestWithLabelsCommandOutput + | HttpRequestWithRegexLiteralCommandOutput + | HttpResponseCodeCommandOutput + | HttpStringPayloadCommandOutput + | IgnoreQueryParamsInResponseCommandOutput + | InputAndOutputWithHeadersCommandOutput + | JsonBlobsCommandOutput + | JsonEnumsCommandOutput + | JsonIntEnumsCommandOutput + | JsonListsCommandOutput + | JsonMapsCommandOutput + | JsonTimestampsCommandOutput + | JsonUnionsCommandOutput + | MalformedAcceptWithBodyCommandOutput + | MalformedAcceptWithGenericStringCommandOutput + | MalformedAcceptWithPayloadCommandOutput + | MalformedBlobCommandOutput + | MalformedBooleanCommandOutput + | MalformedByteCommandOutput + | MalformedContentTypeWithBodyCommandOutput + | MalformedContentTypeWithGenericStringCommandOutput + | MalformedContentTypeWithPayloadCommandOutput + | MalformedContentTypeWithoutBodyCommandOutput + | MalformedContentTypeWithoutBodyEmptyInputCommandOutput + | MalformedDoubleCommandOutput + | MalformedFloatCommandOutput + | MalformedIntegerCommandOutput + | MalformedListCommandOutput + | MalformedLongCommandOutput + | MalformedMapCommandOutput + | MalformedRequestBodyCommandOutput + | MalformedShortCommandOutput + | MalformedStringCommandOutput + | MalformedTimestampBodyDateTimeCommandOutput + | MalformedTimestampBodyDefaultCommandOutput + | MalformedTimestampBodyHttpDateCommandOutput + | MalformedTimestampHeaderDateTimeCommandOutput + | MalformedTimestampHeaderDefaultCommandOutput + | MalformedTimestampHeaderEpochCommandOutput + | MalformedTimestampPathDefaultCommandOutput + | MalformedTimestampPathEpochCommandOutput + | MalformedTimestampPathHttpDateCommandOutput + | MalformedTimestampQueryDefaultCommandOutput + | MalformedTimestampQueryEpochCommandOutput + | MalformedTimestampQueryHttpDateCommandOutput + | MalformedUnionCommandOutput + | MediaTypeHeaderCommandOutput + | NoInputAndNoOutputCommandOutput + | NoInputAndOutputCommandOutput + | NullAndEmptyHeadersClientCommandOutput + | NullAndEmptyHeadersServerCommandOutput + | OmitsNullSerializesEmptyStringCommandOutput + | OmitsSerializingEmptyListsCommandOutput + | OperationWithDefaultsCommandOutput + | OperationWithNestedStructureCommandOutput + | PostPlayerActionCommandOutput + | PostUnionWithJsonNameCommandOutput + | PutWithContentEncodingCommandOutput + | QueryIdempotencyTokenAutoFillCommandOutput + | QueryParamsAsStringListMapCommandOutput + | QueryPrecedenceCommandOutput + | RecursiveShapesCommandOutput + | ResponseCodeHttpFallbackCommandOutput + | ResponseCodeRequiredCommandOutput + | SimpleScalarPropertiesCommandOutput + | SparseJsonListsCommandOutput + | SparseJsonMapsCommandOutput + | StreamingTraitsCommandOutput + | StreamingTraitsRequireLengthCommandOutput + | StreamingTraitsWithMediaTypeCommandOutput + | TestBodyStructureCommandOutput + | TestGetNoInputNoPayloadCommandOutput + | TestGetNoPayloadCommandOutput + | TestPayloadBlobCommandOutput + | TestPayloadStructureCommandOutput + | TestPostNoInputNoPayloadCommandOutput + | TestPostNoPayloadCommandOutput + | TimestampFormatHeadersCommandOutput + | UnitInputAndOutputCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON) + * may be overridden. A default will always be set by the client. + * Available options depend on the service's supported protocols and will not be validated by + * the client. + * @alpha + * + */ + protocol?: ClientProtocol; + + /** + * A function that, given a hash constructor and a stream, calculates the + * hash of the streamed value. + * @internal + */ + streamHasher?: __StreamHasher | __StreamHasher; + + /** + * A constructor for a class implementing the {@link __Checksum} interface + * that computes MD5 hashes. + * @internal + */ + md5?: __ChecksumConstructor | __HashConstructor; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; + + /** + * The internal function that inject utilities to runtime-specific stream to help users consume the data + * @internal + */ + sdkStreamMixin?: __SdkStreamMixinInjector; +} + +/** + * @public + */ +export type RestJsonProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + CompressionInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of RestJsonProtocolClient class constructor that set the region, credentials and other options. + */ +export interface RestJsonProtocolClientConfig extends RestJsonProtocolClientConfigType {} + +/** + * @public + */ +export type RestJsonProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + CompressionResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of RestJsonProtocolClient class. This is resolved and normalized from the {@link RestJsonProtocolClientConfig | constructor configuration interface}. + */ +export interface RestJsonProtocolClientResolvedConfig extends RestJsonProtocolClientResolvedConfigType {} + +/** + * A REST JSON service that sends JSON requests and responses. + * @public + */ +export class RestJsonProtocolClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + RestJsonProtocolClientResolvedConfig +> { + /** + * The resolved configuration of RestJsonProtocolClient class. This is resolved and normalized from the {@link RestJsonProtocolClientConfig | constructor configuration interface}. + */ + readonly config: RestJsonProtocolClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + super(_config_0 as any); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveCompressionConfig(_config_7); + const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []); + this.config = _config_9; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultRestJsonProtocolHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: RestJsonProtocolClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/private/aws-protocoltests-restjson-schema/src/auth/httpAuthExtensionConfiguration.ts b/private/aws-protocoltests-restjson-schema/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 0000000000000..62fd1e214aa35 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { RestJsonProtocolHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: RestJsonProtocolHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): RestJsonProtocolHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: RestJsonProtocolHttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: RestJsonProtocolHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): RestJsonProtocolHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/private/aws-protocoltests-restjson-schema/src/auth/httpAuthSchemeProvider.ts b/private/aws-protocoltests-restjson-schema/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 0000000000000..9ad45d578e637 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,157 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, + Provider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { RestJsonProtocolClientConfig, RestJsonProtocolClientResolvedConfig } from "../RestJsonProtocolClient"; + +/** + * @internal + */ +export interface RestJsonProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface RestJsonProtocolHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + RestJsonProtocolClientResolvedConfig, + HandlerExecutionContext, + RestJsonProtocolHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultRestJsonProtocolHttpAuthSchemeParametersProvider = async ( + config: RestJsonProtocolClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption(authParameters: RestJsonProtocolHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "restjson", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface RestJsonProtocolHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultRestJsonProtocolHttpAuthSchemeProvider: RestJsonProtocolHttpAuthSchemeProvider = ( + authParameters +) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + authSchemePreference?: string[] | Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: RestJsonProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + readonly authSchemePreference: Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: RestJsonProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), + }) as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/private/aws-protocoltests-restjson-schema/src/commands/AllQueryStringTypesCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/AllQueryStringTypesCommand.ts new file mode 100644 index 0000000000000..bf8620548cb71 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/AllQueryStringTypesCommand.ts @@ -0,0 +1,128 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { AllQueryStringTypesInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { AllQueryStringTypes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link AllQueryStringTypesCommand}. + */ +export interface AllQueryStringTypesCommandInput extends AllQueryStringTypesInput {} +/** + * @public + * + * The output of {@link AllQueryStringTypesCommand}. + */ +export interface AllQueryStringTypesCommandOutput extends __MetadataBearer {} + +/** + * This example uses all query string types. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, AllQueryStringTypesCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, AllQueryStringTypesCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // AllQueryStringTypesInput + * queryString: "STRING_VALUE", + * queryStringList: [ // StringList + * "STRING_VALUE", + * ], + * queryStringSet: [ // StringSet + * "STRING_VALUE", + * ], + * queryByte: 0, // BYTE_VALUE + * queryShort: Number("short"), + * queryInteger: Number("int"), + * queryIntegerList: [ // IntegerList + * Number("int"), + * ], + * queryIntegerSet: [ // IntegerSet + * Number("int"), + * ], + * queryLong: Number("long"), + * queryFloat: Number("float"), + * queryDouble: Number("double"), + * queryDoubleList: [ // DoubleList + * Number("double"), + * ], + * queryBoolean: true || false, + * queryBooleanList: [ // BooleanList + * true || false, + * ], + * queryTimestamp: new Date("TIMESTAMP"), + * queryTimestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * queryEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * queryEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * queryIntegerEnum: 1 || 2 || 3, + * queryIntegerEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * queryParamsMapOfStringList: { // StringListMap + * "": [ + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new AllQueryStringTypesCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param AllQueryStringTypesCommandInput - {@link AllQueryStringTypesCommandInput} + * @returns {@link AllQueryStringTypesCommandOutput} + * @see {@link AllQueryStringTypesCommandInput} for command's `input` shape. + * @see {@link AllQueryStringTypesCommandOutput} 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 AllQueryStringTypesCommand extends $Command + .classBuilder< + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "AllQueryStringTypes", {}) + .n("RestJsonProtocolClient", "AllQueryStringTypesCommand") + .f(void 0, void 0) + .sc(AllQueryStringTypes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: AllQueryStringTypesInput; + output: {}; + }; + sdk: { + input: AllQueryStringTypesCommandInput; + output: AllQueryStringTypesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/ConstantAndVariableQueryStringCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/ConstantAndVariableQueryStringCommand.ts new file mode 100644 index 0000000000000..ad26d1720fc2d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/ConstantAndVariableQueryStringCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ConstantAndVariableQueryStringInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { ConstantAndVariableQueryString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ConstantAndVariableQueryStringCommand}. + */ +export interface ConstantAndVariableQueryStringCommandInput extends ConstantAndVariableQueryStringInput {} +/** + * @public + * + * The output of {@link ConstantAndVariableQueryStringCommand}. + */ +export interface ConstantAndVariableQueryStringCommandOutput extends __MetadataBearer {} + +/** + * This example uses fixed query string params and variable query string params. + * The fixed query string parameters and variable parameters must both be + * serialized (implementations may need to merge them together). + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, ConstantAndVariableQueryStringCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, ConstantAndVariableQueryStringCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // ConstantAndVariableQueryStringInput + * baz: "STRING_VALUE", + * maybeSet: "STRING_VALUE", + * }; + * const command = new ConstantAndVariableQueryStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ConstantAndVariableQueryStringCommandInput - {@link ConstantAndVariableQueryStringCommandInput} + * @returns {@link ConstantAndVariableQueryStringCommandOutput} + * @see {@link ConstantAndVariableQueryStringCommandInput} for command's `input` shape. + * @see {@link ConstantAndVariableQueryStringCommandOutput} 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 ConstantAndVariableQueryStringCommand extends $Command + .classBuilder< + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "ConstantAndVariableQueryString", {}) + .n("RestJsonProtocolClient", "ConstantAndVariableQueryStringCommand") + .f(void 0, void 0) + .sc(ConstantAndVariableQueryString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ConstantAndVariableQueryStringInput; + output: {}; + }; + sdk: { + input: ConstantAndVariableQueryStringCommandInput; + output: ConstantAndVariableQueryStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/ConstantQueryStringCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/ConstantQueryStringCommand.ts new file mode 100644 index 0000000000000..7cce2eb60db88 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/ConstantQueryStringCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ConstantQueryStringInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { ConstantQueryString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ConstantQueryStringCommand}. + */ +export interface ConstantQueryStringCommandInput extends ConstantQueryStringInput {} +/** + * @public + * + * The output of {@link ConstantQueryStringCommand}. + */ +export interface ConstantQueryStringCommandOutput extends __MetadataBearer {} + +/** + * This example uses a constant query string parameters and a label. + * This simply tests that labels and query string parameters are + * compatible. The fixed query string parameter named "hello" should + * in no way conflict with the label, `\{hello\}`. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, ConstantQueryStringCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, ConstantQueryStringCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // ConstantQueryStringInput + * hello: "STRING_VALUE", // required + * }; + * const command = new ConstantQueryStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ConstantQueryStringCommandInput - {@link ConstantQueryStringCommandInput} + * @returns {@link ConstantQueryStringCommandOutput} + * @see {@link ConstantQueryStringCommandInput} for command's `input` shape. + * @see {@link ConstantQueryStringCommandOutput} 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 ConstantQueryStringCommand extends $Command + .classBuilder< + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "ConstantQueryString", {}) + .n("RestJsonProtocolClient", "ConstantQueryStringCommand") + .f(void 0, void 0) + .sc(ConstantQueryString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ConstantQueryStringInput; + output: {}; + }; + sdk: { + input: ConstantQueryStringCommandInput; + output: ConstantQueryStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/ContentTypeParametersCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/ContentTypeParametersCommand.ts new file mode 100644 index 0000000000000..79d180e3c2799 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/ContentTypeParametersCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ContentTypeParametersInput, ContentTypeParametersOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { ContentTypeParameters } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandInput extends ContentTypeParametersInput {} +/** + * @public + * + * The output of {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandOutput extends ContentTypeParametersOutput, __MetadataBearer {} + +/** + * The example tests how servers must support requests + * containing a `Content-Type` header with parameters. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, ContentTypeParametersCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, ContentTypeParametersCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // ContentTypeParametersInput + * value: Number("int"), + * }; + * const command = new ContentTypeParametersCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ContentTypeParametersCommandInput - {@link ContentTypeParametersCommandInput} + * @returns {@link ContentTypeParametersCommandOutput} + * @see {@link ContentTypeParametersCommandInput} for command's `input` shape. + * @see {@link ContentTypeParametersCommandOutput} 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 ContentTypeParametersCommand extends $Command + .classBuilder< + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "ContentTypeParameters", {}) + .n("RestJsonProtocolClient", "ContentTypeParametersCommand") + .f(void 0, void 0) + .sc(ContentTypeParameters) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ContentTypeParametersInput; + output: {}; + }; + sdk: { + input: ContentTypeParametersCommandInput; + output: ContentTypeParametersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/DatetimeOffsetsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/DatetimeOffsetsCommand.ts new file mode 100644 index 0000000000000..fee0e6fe12511 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/DatetimeOffsetsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DatetimeOffsetsOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { DatetimeOffsets } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandInput {} +/** + * @public + * + * The output of {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandOutput extends DatetimeOffsetsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DatetimeOffsetsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, DatetimeOffsetsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new DatetimeOffsetsCommand(input); + * const response = await client.send(command); + * // { // DatetimeOffsetsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param DatetimeOffsetsCommandInput - {@link DatetimeOffsetsCommandInput} + * @returns {@link DatetimeOffsetsCommandOutput} + * @see {@link DatetimeOffsetsCommandInput} for command's `input` shape. + * @see {@link DatetimeOffsetsCommandOutput} 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 DatetimeOffsetsCommand extends $Command + .classBuilder< + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "DatetimeOffsets", {}) + .n("RestJsonProtocolClient", "DatetimeOffsetsCommand") + .f(void 0, void 0) + .sc(DatetimeOffsets) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: DatetimeOffsetsOutput; + }; + sdk: { + input: DatetimeOffsetsCommandInput; + output: DatetimeOffsetsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeAsMapValueCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeAsMapValueCommand.ts new file mode 100644 index 0000000000000..b75df9e617cb8 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeAsMapValueCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DocumentTypeAsMapValueInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { DocumentTypeAsMapValue } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DocumentTypeAsMapValueCommand}. + */ +export interface DocumentTypeAsMapValueCommandInput extends DocumentTypeAsMapValueInputOutput {} +/** + * @public + * + * The output of {@link DocumentTypeAsMapValueCommand}. + */ +export interface DocumentTypeAsMapValueCommandOutput extends DocumentTypeAsMapValueInputOutput, __MetadataBearer {} + +/** + * This example serializes documents as the value of maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DocumentTypeAsMapValueCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, DocumentTypeAsMapValueCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // DocumentTypeAsMapValueInputOutput + * docValuedMap: { // DocumentValuedMap + * "": "DOCUMENT_VALUE", + * }, + * }; + * const command = new DocumentTypeAsMapValueCommand(input); + * const response = await client.send(command); + * // { // DocumentTypeAsMapValueInputOutput + * // docValuedMap: { // DocumentValuedMap + * // "": "DOCUMENT_VALUE", + * // }, + * // }; + * + * ``` + * + * @param DocumentTypeAsMapValueCommandInput - {@link DocumentTypeAsMapValueCommandInput} + * @returns {@link DocumentTypeAsMapValueCommandOutput} + * @see {@link DocumentTypeAsMapValueCommandInput} for command's `input` shape. + * @see {@link DocumentTypeAsMapValueCommandOutput} 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 DocumentTypeAsMapValueCommand extends $Command + .classBuilder< + DocumentTypeAsMapValueCommandInput, + DocumentTypeAsMapValueCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "DocumentTypeAsMapValue", {}) + .n("RestJsonProtocolClient", "DocumentTypeAsMapValueCommand") + .f(void 0, void 0) + .sc(DocumentTypeAsMapValue) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DocumentTypeAsMapValueInputOutput; + output: DocumentTypeAsMapValueInputOutput; + }; + sdk: { + input: DocumentTypeAsMapValueCommandInput; + output: DocumentTypeAsMapValueCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeAsPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeAsPayloadCommand.ts new file mode 100644 index 0000000000000..71abb8abede1d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeAsPayloadCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DocumentTypeAsPayloadInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { DocumentTypeAsPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DocumentTypeAsPayloadCommand}. + */ +export interface DocumentTypeAsPayloadCommandInput extends DocumentTypeAsPayloadInputOutput {} +/** + * @public + * + * The output of {@link DocumentTypeAsPayloadCommand}. + */ +export interface DocumentTypeAsPayloadCommandOutput extends DocumentTypeAsPayloadInputOutput, __MetadataBearer {} + +/** + * This example serializes a document as the entire HTTP payload. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DocumentTypeAsPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, DocumentTypeAsPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // DocumentTypeAsPayloadInputOutput + * documentValue: "DOCUMENT_VALUE", + * }; + * const command = new DocumentTypeAsPayloadCommand(input); + * const response = await client.send(command); + * // { // DocumentTypeAsPayloadInputOutput + * // documentValue: "DOCUMENT_VALUE", + * // }; + * + * ``` + * + * @param DocumentTypeAsPayloadCommandInput - {@link DocumentTypeAsPayloadCommandInput} + * @returns {@link DocumentTypeAsPayloadCommandOutput} + * @see {@link DocumentTypeAsPayloadCommandInput} for command's `input` shape. + * @see {@link DocumentTypeAsPayloadCommandOutput} 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 DocumentTypeAsPayloadCommand extends $Command + .classBuilder< + DocumentTypeAsPayloadCommandInput, + DocumentTypeAsPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "DocumentTypeAsPayload", {}) + .n("RestJsonProtocolClient", "DocumentTypeAsPayloadCommand") + .f(void 0, void 0) + .sc(DocumentTypeAsPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DocumentTypeAsPayloadInputOutput; + output: DocumentTypeAsPayloadInputOutput; + }; + sdk: { + input: DocumentTypeAsPayloadCommandInput; + output: DocumentTypeAsPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeCommand.ts new file mode 100644 index 0000000000000..4d9f75ae4db2b --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/DocumentTypeCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DocumentTypeInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { DocumentType } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DocumentTypeCommand}. + */ +export interface DocumentTypeCommandInput extends DocumentTypeInputOutput {} +/** + * @public + * + * The output of {@link DocumentTypeCommand}. + */ +export interface DocumentTypeCommandOutput extends DocumentTypeInputOutput, __MetadataBearer {} + +/** + * This example serializes a document as part of the payload. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DocumentTypeCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, DocumentTypeCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // DocumentTypeInputOutput + * stringValue: "STRING_VALUE", + * documentValue: "DOCUMENT_VALUE", + * }; + * const command = new DocumentTypeCommand(input); + * const response = await client.send(command); + * // { // DocumentTypeInputOutput + * // stringValue: "STRING_VALUE", + * // documentValue: "DOCUMENT_VALUE", + * // }; + * + * ``` + * + * @param DocumentTypeCommandInput - {@link DocumentTypeCommandInput} + * @returns {@link DocumentTypeCommandOutput} + * @see {@link DocumentTypeCommandInput} for command's `input` shape. + * @see {@link DocumentTypeCommandOutput} 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 DocumentTypeCommand extends $Command + .classBuilder< + DocumentTypeCommandInput, + DocumentTypeCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "DocumentType", {}) + .n("RestJsonProtocolClient", "DocumentTypeCommand") + .f(void 0, void 0) + .sc(DocumentType) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DocumentTypeInputOutput; + output: DocumentTypeInputOutput; + }; + sdk: { + input: DocumentTypeCommandInput; + output: DocumentTypeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts new file mode 100644 index 0000000000000..68f0115ee771d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { EmptyInputAndEmptyOutputInput, EmptyInputAndEmptyOutputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { EmptyInputAndEmptyOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandInput extends EmptyInputAndEmptyOutputInput {} +/** + * @public + * + * The output of {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandOutput extends EmptyInputAndEmptyOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has an empty input + * and empty output structure that reuses the same shape. While this should + * be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, EmptyInputAndEmptyOutputCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, EmptyInputAndEmptyOutputCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new EmptyInputAndEmptyOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EmptyInputAndEmptyOutputCommandInput - {@link EmptyInputAndEmptyOutputCommandInput} + * @returns {@link EmptyInputAndEmptyOutputCommandOutput} + * @see {@link EmptyInputAndEmptyOutputCommandInput} for command's `input` shape. + * @see {@link EmptyInputAndEmptyOutputCommandOutput} 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 EmptyInputAndEmptyOutputCommand extends $Command + .classBuilder< + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "EmptyInputAndEmptyOutput", {}) + .n("RestJsonProtocolClient", "EmptyInputAndEmptyOutputCommand") + .f(void 0, void 0) + .sc(EmptyInputAndEmptyOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EmptyInputAndEmptyOutputCommandInput; + output: EmptyInputAndEmptyOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/EndpointOperationCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/EndpointOperationCommand.ts new file mode 100644 index 0000000000000..bf164ee63be13 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/EndpointOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { EndpointOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandInput {} +/** + * @public + * + * The output of {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, EndpointOperationCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, EndpointOperationCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new EndpointOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointOperationCommandInput - {@link EndpointOperationCommandInput} + * @returns {@link EndpointOperationCommandOutput} + * @see {@link EndpointOperationCommandInput} for command's `input` shape. + * @see {@link EndpointOperationCommandOutput} 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 EndpointOperationCommand extends $Command + .classBuilder< + EndpointOperationCommandInput, + EndpointOperationCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "EndpointOperation", {}) + .n("RestJsonProtocolClient", "EndpointOperationCommand") + .f(void 0, void 0) + .sc(EndpointOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EndpointOperationCommandInput; + output: EndpointOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/EndpointWithHostLabelOperationCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/EndpointWithHostLabelOperationCommand.ts new file mode 100644 index 0000000000000..7eca8c39888c2 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/EndpointWithHostLabelOperationCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HostLabelInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { EndpointWithHostLabelOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandInput extends HostLabelInput {} +/** + * @public + * + * The output of {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, EndpointWithHostLabelOperationCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, EndpointWithHostLabelOperationCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HostLabelInput + * label: "STRING_VALUE", // required + * }; + * const command = new EndpointWithHostLabelOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointWithHostLabelOperationCommandInput - {@link EndpointWithHostLabelOperationCommandInput} + * @returns {@link EndpointWithHostLabelOperationCommandOutput} + * @see {@link EndpointWithHostLabelOperationCommandInput} for command's `input` shape. + * @see {@link EndpointWithHostLabelOperationCommandOutput} 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 EndpointWithHostLabelOperationCommand extends $Command + .classBuilder< + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "EndpointWithHostLabelOperation", {}) + .n("RestJsonProtocolClient", "EndpointWithHostLabelOperationCommand") + .f(void 0, void 0) + .sc(EndpointWithHostLabelOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HostLabelInput; + output: {}; + }; + sdk: { + input: EndpointWithHostLabelOperationCommandInput; + output: EndpointWithHostLabelOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/FractionalSecondsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/FractionalSecondsCommand.ts new file mode 100644 index 0000000000000..2bb9af5f8f37d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/FractionalSecondsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FractionalSecondsOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { FractionalSeconds } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandInput {} +/** + * @public + * + * The output of {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, FractionalSecondsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, FractionalSecondsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new FractionalSecondsCommand(input); + * const response = await client.send(command); + * // { // FractionalSecondsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput} + * @returns {@link FractionalSecondsCommandOutput} + * @see {@link FractionalSecondsCommandInput} for command's `input` shape. + * @see {@link FractionalSecondsCommandOutput} 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 FractionalSecondsCommand extends $Command + .classBuilder< + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "FractionalSeconds", {}) + .n("RestJsonProtocolClient", "FractionalSecondsCommand") + .f(void 0, void 0) + .sc(FractionalSeconds) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FractionalSecondsOutput; + }; + sdk: { + input: FractionalSecondsCommandInput; + output: FractionalSecondsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/GreetingWithErrorsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/GreetingWithErrorsCommand.ts new file mode 100644 index 0000000000000..bd6eea6c9557a --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/GreetingWithErrorsCommand.ts @@ -0,0 +1,105 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { GreetingWithErrorsOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { GreetingWithErrors } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandInput {} +/** + * @public + * + * The output of {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {} + +/** + * This operation has four possible return values: + * + * 1. A successful response in the form of GreetingWithErrorsOutput + * 2. An InvalidGreeting error. + * 3. A BadRequest error. + * 4. A FooError. + * + * Implementations must be able to successfully take a response and + * properly (de)serialize successful and error responses based on the + * the presence of the + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, GreetingWithErrorsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, GreetingWithErrorsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new GreetingWithErrorsCommand(input); + * const response = await client.send(command); + * // { // GreetingWithErrorsOutput + * // greeting: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput} + * @returns {@link GreetingWithErrorsCommandOutput} + * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape. + * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape. + * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape. + * + * @throws {@link InvalidGreeting} (client fault) + * This error is thrown when an invalid greeting value is provided. + * + * @throws {@link ComplexError} (client fault) + * This error is thrown when a request is invalid. + * + * @throws {@link FooError} (server fault) + * This error has test cases that test some of the dark corners of Amazon service + * framework history. It should only be implemented by clients. + * + * @throws {@link RestJsonProtocolServiceException} + *

Base exception class for all service exceptions from RestJsonProtocol service.

+ * + * + * @public + */ +export class GreetingWithErrorsCommand extends $Command + .classBuilder< + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "GreetingWithErrors", {}) + .n("RestJsonProtocolClient", "GreetingWithErrorsCommand") + .f(void 0, void 0) + .sc(GreetingWithErrors) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: GreetingWithErrorsOutput; + }; + sdk: { + input: GreetingWithErrorsCommandInput; + output: GreetingWithErrorsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HostWithPathOperationCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HostWithPathOperationCommand.ts new file mode 100644 index 0000000000000..94013aa66acb7 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HostWithPathOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HostWithPathOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandInput {} +/** + * @public + * + * The output of {@link HostWithPathOperationCommand}. + */ +export interface HostWithPathOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HostWithPathOperationCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HostWithPathOperationCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new HostWithPathOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HostWithPathOperationCommandInput - {@link HostWithPathOperationCommandInput} + * @returns {@link HostWithPathOperationCommandOutput} + * @see {@link HostWithPathOperationCommandInput} for command's `input` shape. + * @see {@link HostWithPathOperationCommandOutput} 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 HostWithPathOperationCommand extends $Command + .classBuilder< + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HostWithPathOperation", {}) + .n("RestJsonProtocolClient", "HostWithPathOperationCommand") + .f(void 0, void 0) + .sc(HostWithPathOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: HostWithPathOperationCommandInput; + output: HostWithPathOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpChecksumRequiredCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpChecksumRequiredCommand.ts new file mode 100644 index 0000000000000..029664a413b9e --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpChecksumRequiredCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getApplyMd5BodyChecksumPlugin } from "@smithy/middleware-apply-body-checksum"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpChecksumRequiredInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpChecksumRequired } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpChecksumRequiredCommand}. + */ +export interface HttpChecksumRequiredCommandInput extends HttpChecksumRequiredInputOutput {} +/** + * @public + * + * The output of {@link HttpChecksumRequiredCommand}. + */ +export interface HttpChecksumRequiredCommandOutput extends HttpChecksumRequiredInputOutput, __MetadataBearer {} + +/** + * This example tests httpChecksumRequired trait + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpChecksumRequiredCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpChecksumRequiredCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpChecksumRequiredInputOutput + * foo: "STRING_VALUE", + * }; + * const command = new HttpChecksumRequiredCommand(input); + * const response = await client.send(command); + * // { // HttpChecksumRequiredInputOutput + * // foo: "STRING_VALUE", + * // }; + * + * ``` + * + * @param HttpChecksumRequiredCommandInput - {@link HttpChecksumRequiredCommandInput} + * @returns {@link HttpChecksumRequiredCommandOutput} + * @see {@link HttpChecksumRequiredCommandInput} for command's `input` shape. + * @see {@link HttpChecksumRequiredCommandOutput} 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 HttpChecksumRequiredCommand extends $Command + .classBuilder< + HttpChecksumRequiredCommandInput, + HttpChecksumRequiredCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getApplyMd5BodyChecksumPlugin(config), + ]; + }) + .s("RestJson", "HttpChecksumRequired", {}) + .n("RestJsonProtocolClient", "HttpChecksumRequiredCommand") + .f(void 0, void 0) + .sc(HttpChecksumRequired) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpChecksumRequiredInputOutput; + output: HttpChecksumRequiredInputOutput; + }; + sdk: { + input: HttpChecksumRequiredCommandInput; + output: HttpChecksumRequiredCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpEmptyPrefixHeadersCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpEmptyPrefixHeadersCommand.ts new file mode 100644 index 0000000000000..8f459a8e167ed --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpEmptyPrefixHeadersCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpEmptyPrefixHeadersInput, HttpEmptyPrefixHeadersOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpEmptyPrefixHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpEmptyPrefixHeadersCommand}. + */ +export interface HttpEmptyPrefixHeadersCommandInput extends HttpEmptyPrefixHeadersInput {} +/** + * @public + * + * The output of {@link HttpEmptyPrefixHeadersCommand}. + */ +export interface HttpEmptyPrefixHeadersCommandOutput extends HttpEmptyPrefixHeadersOutput, __MetadataBearer {} + +/** + * Clients that perform this test extract all headers from the response. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpEmptyPrefixHeadersCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpEmptyPrefixHeadersCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpEmptyPrefixHeadersInput + * prefixHeaders: { // StringMap + * "": "STRING_VALUE", + * }, + * specificHeader: "STRING_VALUE", + * }; + * const command = new HttpEmptyPrefixHeadersCommand(input); + * const response = await client.send(command); + * // { // HttpEmptyPrefixHeadersOutput + * // prefixHeaders: { // StringMap + * // "": "STRING_VALUE", + * // }, + * // specificHeader: "STRING_VALUE", + * // }; + * + * ``` + * + * @param HttpEmptyPrefixHeadersCommandInput - {@link HttpEmptyPrefixHeadersCommandInput} + * @returns {@link HttpEmptyPrefixHeadersCommandOutput} + * @see {@link HttpEmptyPrefixHeadersCommandInput} for command's `input` shape. + * @see {@link HttpEmptyPrefixHeadersCommandOutput} 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 HttpEmptyPrefixHeadersCommand extends $Command + .classBuilder< + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpEmptyPrefixHeaders", {}) + .n("RestJsonProtocolClient", "HttpEmptyPrefixHeadersCommand") + .f(void 0, void 0) + .sc(HttpEmptyPrefixHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpEmptyPrefixHeadersInput; + output: HttpEmptyPrefixHeadersOutput; + }; + sdk: { + input: HttpEmptyPrefixHeadersCommandInput; + output: HttpEmptyPrefixHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpEnumPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpEnumPayloadCommand.ts new file mode 100644 index 0000000000000..7a104ac970b4e --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpEnumPayloadCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { EnumPayloadInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpEnumPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpEnumPayloadCommand}. + */ +export interface HttpEnumPayloadCommandInput extends EnumPayloadInput {} +/** + * @public + * + * The output of {@link HttpEnumPayloadCommand}. + */ +export interface HttpEnumPayloadCommandOutput extends EnumPayloadInput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpEnumPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpEnumPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // EnumPayloadInput + * payload: "enumvalue", + * }; + * const command = new HttpEnumPayloadCommand(input); + * const response = await client.send(command); + * // { // EnumPayloadInput + * // payload: "enumvalue", + * // }; + * + * ``` + * + * @param HttpEnumPayloadCommandInput - {@link HttpEnumPayloadCommandInput} + * @returns {@link HttpEnumPayloadCommandOutput} + * @see {@link HttpEnumPayloadCommandInput} for command's `input` shape. + * @see {@link HttpEnumPayloadCommandOutput} 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 HttpEnumPayloadCommand extends $Command + .classBuilder< + HttpEnumPayloadCommandInput, + HttpEnumPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpEnumPayload", {}) + .n("RestJsonProtocolClient", "HttpEnumPayloadCommand") + .f(void 0, void 0) + .sc(HttpEnumPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: EnumPayloadInput; + output: EnumPayloadInput; + }; + sdk: { + input: HttpEnumPayloadCommandInput; + output: HttpEnumPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadTraitsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadTraitsCommand.ts new file mode 100644 index 0000000000000..20eb93d72a38c --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadTraitsCommand.ts @@ -0,0 +1,108 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { BlobPayloadInputTypes, MetadataBearer as __MetadataBearer } from "@smithy/types"; +import { Uint8ArrayBlobAdapter } from "@smithy/util-stream"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadTraitsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpPayloadTraits } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + */ +export type HttpPayloadTraitsCommandInputType = Omit & { + blob?: BlobPayloadInputTypes; +}; + +/** + * @public + * + * The input for {@link HttpPayloadTraitsCommand}. + */ +export interface HttpPayloadTraitsCommandInput extends HttpPayloadTraitsCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsCommandOutputType = Omit & { + blob?: Uint8ArrayBlobAdapter; +}; + +/** + * @public + * + * The output of {@link HttpPayloadTraitsCommand}. + */ +export interface HttpPayloadTraitsCommandOutput extends HttpPayloadTraitsCommandOutputType, __MetadataBearer {} + +/** + * This example serializes a blob shape in the payload. + * + * In this example, no JSON document is synthesized because the payload is + * not a structure or a union type. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpPayloadTraitsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpPayloadTraitsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpPayloadTraitsInputOutput + * foo: "STRING_VALUE", + * blob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new HttpPayloadTraitsCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadTraitsInputOutput + * // foo: "STRING_VALUE", + * // blob: new Uint8Array(), + * // }; + * + * ``` + * + * @param HttpPayloadTraitsCommandInput - {@link HttpPayloadTraitsCommandInput} + * @returns {@link HttpPayloadTraitsCommandOutput} + * @see {@link HttpPayloadTraitsCommandInput} for command's `input` shape. + * @see {@link HttpPayloadTraitsCommandOutput} 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 HttpPayloadTraitsCommand extends $Command + .classBuilder< + HttpPayloadTraitsCommandInput, + HttpPayloadTraitsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpPayloadTraits", {}) + .n("RestJsonProtocolClient", "HttpPayloadTraitsCommand") + .f(void 0, void 0) + .sc(HttpPayloadTraits) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadTraitsInputOutput; + output: HttpPayloadTraitsInputOutput; + }; + sdk: { + input: HttpPayloadTraitsCommandInput; + output: HttpPayloadTraitsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts new file mode 100644 index 0000000000000..c82179281af1f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts @@ -0,0 +1,111 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { BlobPayloadInputTypes, MetadataBearer as __MetadataBearer } from "@smithy/types"; +import { Uint8ArrayBlobAdapter } from "@smithy/util-stream"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadTraitsWithMediaTypeInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpPayloadTraitsWithMediaType } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandInputType = Omit & { + blob?: BlobPayloadInputTypes; +}; + +/** + * @public + * + * The input for {@link HttpPayloadTraitsWithMediaTypeCommand}. + */ +export interface HttpPayloadTraitsWithMediaTypeCommandInput extends HttpPayloadTraitsWithMediaTypeCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandOutputType = Omit< + HttpPayloadTraitsWithMediaTypeInputOutput, + "blob" +> & { + blob?: Uint8ArrayBlobAdapter; +}; + +/** + * @public + * + * The output of {@link HttpPayloadTraitsWithMediaTypeCommand}. + */ +export interface HttpPayloadTraitsWithMediaTypeCommandOutput + extends HttpPayloadTraitsWithMediaTypeCommandOutputType, + __MetadataBearer {} + +/** + * This example uses a `@mediaType` trait on the payload to force a custom + * content-type to be serialized. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpPayloadTraitsWithMediaTypeCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpPayloadTraitsWithMediaTypeCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpPayloadTraitsWithMediaTypeInputOutput + * foo: "STRING_VALUE", + * blob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new HttpPayloadTraitsWithMediaTypeCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadTraitsWithMediaTypeInputOutput + * // foo: "STRING_VALUE", + * // blob: new Uint8Array(), + * // }; + * + * ``` + * + * @param HttpPayloadTraitsWithMediaTypeCommandInput - {@link HttpPayloadTraitsWithMediaTypeCommandInput} + * @returns {@link HttpPayloadTraitsWithMediaTypeCommandOutput} + * @see {@link HttpPayloadTraitsWithMediaTypeCommandInput} for command's `input` shape. + * @see {@link HttpPayloadTraitsWithMediaTypeCommandOutput} 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 HttpPayloadTraitsWithMediaTypeCommand extends $Command + .classBuilder< + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpPayloadTraitsWithMediaType", {}) + .n("RestJsonProtocolClient", "HttpPayloadTraitsWithMediaTypeCommand") + .f(void 0, void 0) + .sc(HttpPayloadTraitsWithMediaType) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadTraitsWithMediaTypeInputOutput; + output: HttpPayloadTraitsWithMediaTypeInputOutput; + }; + sdk: { + input: HttpPayloadTraitsWithMediaTypeCommandInput; + output: HttpPayloadTraitsWithMediaTypeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadWithStructureCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadWithStructureCommand.ts new file mode 100644 index 0000000000000..61cac8f4087e8 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadWithStructureCommand.ts @@ -0,0 +1,97 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithStructureInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpPayloadWithStructure } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithStructureCommand}. + */ +export interface HttpPayloadWithStructureCommandInput extends HttpPayloadWithStructureInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithStructureCommand}. + */ +export interface HttpPayloadWithStructureCommandOutput extends HttpPayloadWithStructureInputOutput, __MetadataBearer {} + +/** + * This example serializes a structure in the payload. + * + * Note that serializing a structure changes the wrapper element name + * to match the targeted structure. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpPayloadWithStructureCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpPayloadWithStructureCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpPayloadWithStructureInputOutput + * nested: { // NestedPayload + * greeting: "STRING_VALUE", + * name: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithStructureCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithStructureInputOutput + * // nested: { // NestedPayload + * // greeting: "STRING_VALUE", + * // name: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithStructureCommandInput - {@link HttpPayloadWithStructureCommandInput} + * @returns {@link HttpPayloadWithStructureCommandOutput} + * @see {@link HttpPayloadWithStructureCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithStructureCommandOutput} 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 HttpPayloadWithStructureCommand extends $Command + .classBuilder< + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpPayloadWithStructure", {}) + .n("RestJsonProtocolClient", "HttpPayloadWithStructureCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithStructure) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithStructureInputOutput; + output: HttpPayloadWithStructureInputOutput; + }; + sdk: { + input: HttpPayloadWithStructureCommandInput; + output: HttpPayloadWithStructureCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadWithUnionCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadWithUnionCommand.ts new file mode 100644 index 0000000000000..84dcd69be5cca --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpPayloadWithUnionCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithUnionInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpPayloadWithUnion } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithUnionCommand}. + */ +export interface HttpPayloadWithUnionCommandInput extends HttpPayloadWithUnionInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithUnionCommand}. + */ +export interface HttpPayloadWithUnionCommandOutput extends HttpPayloadWithUnionInputOutput, __MetadataBearer {} + +/** + * This example serializes a union in the payload. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpPayloadWithUnionCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpPayloadWithUnionCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpPayloadWithUnionInputOutput + * nested: { // UnionPayload Union: only one key present + * greeting: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithUnionCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithUnionInputOutput + * // nested: { // UnionPayload Union: only one key present + * // greeting: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithUnionCommandInput - {@link HttpPayloadWithUnionCommandInput} + * @returns {@link HttpPayloadWithUnionCommandOutput} + * @see {@link HttpPayloadWithUnionCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithUnionCommandOutput} 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 HttpPayloadWithUnionCommand extends $Command + .classBuilder< + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpPayloadWithUnion", {}) + .n("RestJsonProtocolClient", "HttpPayloadWithUnionCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithUnion) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithUnionInputOutput; + output: HttpPayloadWithUnionInputOutput; + }; + sdk: { + input: HttpPayloadWithUnionCommandInput; + output: HttpPayloadWithUnionCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpPrefixHeadersCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpPrefixHeadersCommand.ts new file mode 100644 index 0000000000000..f6ba58afba1ca --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpPrefixHeadersCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPrefixHeadersInput, HttpPrefixHeadersOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpPrefixHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPrefixHeadersCommand}. + */ +export interface HttpPrefixHeadersCommandInput extends HttpPrefixHeadersInput {} +/** + * @public + * + * The output of {@link HttpPrefixHeadersCommand}. + */ +export interface HttpPrefixHeadersCommandOutput extends HttpPrefixHeadersOutput, __MetadataBearer {} + +/** + * This examples adds headers to the input of a request and response by prefix. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpPrefixHeadersCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpPrefixHeadersCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpPrefixHeadersInput + * foo: "STRING_VALUE", + * fooMap: { // StringMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new HttpPrefixHeadersCommand(input); + * const response = await client.send(command); + * // { // HttpPrefixHeadersOutput + * // foo: "STRING_VALUE", + * // fooMap: { // StringMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPrefixHeadersCommandInput - {@link HttpPrefixHeadersCommandInput} + * @returns {@link HttpPrefixHeadersCommandOutput} + * @see {@link HttpPrefixHeadersCommandInput} for command's `input` shape. + * @see {@link HttpPrefixHeadersCommandOutput} 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 HttpPrefixHeadersCommand extends $Command + .classBuilder< + HttpPrefixHeadersCommandInput, + HttpPrefixHeadersCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpPrefixHeaders", {}) + .n("RestJsonProtocolClient", "HttpPrefixHeadersCommand") + .f(void 0, void 0) + .sc(HttpPrefixHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPrefixHeadersInput; + output: HttpPrefixHeadersOutput; + }; + sdk: { + input: HttpPrefixHeadersCommandInput; + output: HttpPrefixHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpPrefixHeadersInResponseCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpPrefixHeadersInResponseCommand.ts new file mode 100644 index 0000000000000..a664ada0eb239 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpPrefixHeadersInResponseCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPrefixHeadersInResponseInput, HttpPrefixHeadersInResponseOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpPrefixHeadersInResponse } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPrefixHeadersInResponseCommand}. + */ +export interface HttpPrefixHeadersInResponseCommandInput extends HttpPrefixHeadersInResponseInput {} +/** + * @public + * + * The output of {@link HttpPrefixHeadersInResponseCommand}. + */ +export interface HttpPrefixHeadersInResponseCommandOutput extends HttpPrefixHeadersInResponseOutput, __MetadataBearer {} + +/** + * Clients that perform this test extract all headers from the response. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpPrefixHeadersInResponseCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpPrefixHeadersInResponseCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new HttpPrefixHeadersInResponseCommand(input); + * const response = await client.send(command); + * // { // HttpPrefixHeadersInResponseOutput + * // prefixHeaders: { // StringMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPrefixHeadersInResponseCommandInput - {@link HttpPrefixHeadersInResponseCommandInput} + * @returns {@link HttpPrefixHeadersInResponseCommandOutput} + * @see {@link HttpPrefixHeadersInResponseCommandInput} for command's `input` shape. + * @see {@link HttpPrefixHeadersInResponseCommandOutput} 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 HttpPrefixHeadersInResponseCommand extends $Command + .classBuilder< + HttpPrefixHeadersInResponseCommandInput, + HttpPrefixHeadersInResponseCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpPrefixHeadersInResponse", {}) + .n("RestJsonProtocolClient", "HttpPrefixHeadersInResponseCommand") + .f(void 0, void 0) + .sc(HttpPrefixHeadersInResponse) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: HttpPrefixHeadersInResponseOutput; + }; + sdk: { + input: HttpPrefixHeadersInResponseCommandInput; + output: HttpPrefixHeadersInResponseCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithFloatLabelsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithFloatLabelsCommand.ts new file mode 100644 index 0000000000000..4d91128c0d92d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithFloatLabelsCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithFloatLabelsInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpRequestWithFloatLabels } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithFloatLabelsCommand}. + */ +export interface HttpRequestWithFloatLabelsCommandInput extends HttpRequestWithFloatLabelsInput {} +/** + * @public + * + * The output of {@link HttpRequestWithFloatLabelsCommand}. + */ +export interface HttpRequestWithFloatLabelsCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpRequestWithFloatLabelsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpRequestWithFloatLabelsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpRequestWithFloatLabelsInput + * float: Number("float"), // required + * double: Number("double"), // required + * }; + * const command = new HttpRequestWithFloatLabelsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithFloatLabelsCommandInput - {@link HttpRequestWithFloatLabelsCommandInput} + * @returns {@link HttpRequestWithFloatLabelsCommandOutput} + * @see {@link HttpRequestWithFloatLabelsCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithFloatLabelsCommandOutput} 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 HttpRequestWithFloatLabelsCommand extends $Command + .classBuilder< + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpRequestWithFloatLabels", {}) + .n("RestJsonProtocolClient", "HttpRequestWithFloatLabelsCommand") + .f(void 0, void 0) + .sc(HttpRequestWithFloatLabels) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithFloatLabelsInput; + output: {}; + }; + sdk: { + input: HttpRequestWithFloatLabelsCommandInput; + output: HttpRequestWithFloatLabelsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts new file mode 100644 index 0000000000000..7f23484550742 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithGreedyLabelInPathInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpRequestWithGreedyLabelInPath } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithGreedyLabelInPathCommand}. + */ +export interface HttpRequestWithGreedyLabelInPathCommandInput extends HttpRequestWithGreedyLabelInPathInput {} +/** + * @public + * + * The output of {@link HttpRequestWithGreedyLabelInPathCommand}. + */ +export interface HttpRequestWithGreedyLabelInPathCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpRequestWithGreedyLabelInPathCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpRequestWithGreedyLabelInPathCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpRequestWithGreedyLabelInPathInput + * foo: "STRING_VALUE", // required + * baz: "STRING_VALUE", // required + * }; + * const command = new HttpRequestWithGreedyLabelInPathCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithGreedyLabelInPathCommandInput - {@link HttpRequestWithGreedyLabelInPathCommandInput} + * @returns {@link HttpRequestWithGreedyLabelInPathCommandOutput} + * @see {@link HttpRequestWithGreedyLabelInPathCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithGreedyLabelInPathCommandOutput} 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 HttpRequestWithGreedyLabelInPathCommand extends $Command + .classBuilder< + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpRequestWithGreedyLabelInPath", {}) + .n("RestJsonProtocolClient", "HttpRequestWithGreedyLabelInPathCommand") + .f(void 0, void 0) + .sc(HttpRequestWithGreedyLabelInPath) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithGreedyLabelInPathInput; + output: {}; + }; + sdk: { + input: HttpRequestWithGreedyLabelInPathCommandInput; + output: HttpRequestWithGreedyLabelInPathCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts new file mode 100644 index 0000000000000..df5c1b9ee3696 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithLabelsAndTimestampFormatInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpRequestWithLabelsAndTimestampFormat } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithLabelsAndTimestampFormatCommand}. + */ +export interface HttpRequestWithLabelsAndTimestampFormatCommandInput + extends HttpRequestWithLabelsAndTimestampFormatInput {} +/** + * @public + * + * The output of {@link HttpRequestWithLabelsAndTimestampFormatCommand}. + */ +export interface HttpRequestWithLabelsAndTimestampFormatCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests serialize different timestamp formats in the + * URI path. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpRequestWithLabelsAndTimestampFormatCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpRequestWithLabelsAndTimestampFormatCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpRequestWithLabelsAndTimestampFormatInput + * memberEpochSeconds: new Date("TIMESTAMP"), // required + * memberHttpDate: new Date("TIMESTAMP"), // required + * memberDateTime: new Date("TIMESTAMP"), // required + * defaultFormat: new Date("TIMESTAMP"), // required + * targetEpochSeconds: new Date("TIMESTAMP"), // required + * targetHttpDate: new Date("TIMESTAMP"), // required + * targetDateTime: new Date("TIMESTAMP"), // required + * }; + * const command = new HttpRequestWithLabelsAndTimestampFormatCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithLabelsAndTimestampFormatCommandInput - {@link HttpRequestWithLabelsAndTimestampFormatCommandInput} + * @returns {@link HttpRequestWithLabelsAndTimestampFormatCommandOutput} + * @see {@link HttpRequestWithLabelsAndTimestampFormatCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithLabelsAndTimestampFormatCommandOutput} 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 HttpRequestWithLabelsAndTimestampFormatCommand extends $Command + .classBuilder< + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpRequestWithLabelsAndTimestampFormat", {}) + .n("RestJsonProtocolClient", "HttpRequestWithLabelsAndTimestampFormatCommand") + .f(void 0, void 0) + .sc(HttpRequestWithLabelsAndTimestampFormat) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithLabelsAndTimestampFormatInput; + output: {}; + }; + sdk: { + input: HttpRequestWithLabelsAndTimestampFormatCommandInput; + output: HttpRequestWithLabelsAndTimestampFormatCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithLabelsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithLabelsCommand.ts new file mode 100644 index 0000000000000..02d942c45465f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithLabelsCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithLabelsInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpRequestWithLabels } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithLabelsCommand}. + */ +export interface HttpRequestWithLabelsCommandInput extends HttpRequestWithLabelsInput {} +/** + * @public + * + * The output of {@link HttpRequestWithLabelsCommand}. + */ +export interface HttpRequestWithLabelsCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests are serialized when there's no input + * payload but there are HTTP labels. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpRequestWithLabelsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpRequestWithLabelsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpRequestWithLabelsInput + * string: "STRING_VALUE", // required + * short: Number("short"), // required + * integer: Number("int"), // required + * long: Number("long"), // required + * float: Number("float"), // required + * double: Number("double"), // required + * boolean: true || false, // required + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new HttpRequestWithLabelsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithLabelsCommandInput - {@link HttpRequestWithLabelsCommandInput} + * @returns {@link HttpRequestWithLabelsCommandOutput} + * @see {@link HttpRequestWithLabelsCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithLabelsCommandOutput} 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 HttpRequestWithLabelsCommand extends $Command + .classBuilder< + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpRequestWithLabels", {}) + .n("RestJsonProtocolClient", "HttpRequestWithLabelsCommand") + .f(void 0, void 0) + .sc(HttpRequestWithLabels) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithLabelsInput; + output: {}; + }; + sdk: { + input: HttpRequestWithLabelsCommandInput; + output: HttpRequestWithLabelsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithRegexLiteralCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithRegexLiteralCommand.ts new file mode 100644 index 0000000000000..1331927be8507 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpRequestWithRegexLiteralCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithRegexLiteralInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpRequestWithRegexLiteral } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithRegexLiteralCommand}. + */ +export interface HttpRequestWithRegexLiteralCommandInput extends HttpRequestWithRegexLiteralInput {} +/** + * @public + * + * The output of {@link HttpRequestWithRegexLiteralCommand}. + */ +export interface HttpRequestWithRegexLiteralCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpRequestWithRegexLiteralCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpRequestWithRegexLiteralCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpRequestWithRegexLiteralInput + * str: "STRING_VALUE", // required + * }; + * const command = new HttpRequestWithRegexLiteralCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithRegexLiteralCommandInput - {@link HttpRequestWithRegexLiteralCommandInput} + * @returns {@link HttpRequestWithRegexLiteralCommandOutput} + * @see {@link HttpRequestWithRegexLiteralCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithRegexLiteralCommandOutput} 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 HttpRequestWithRegexLiteralCommand extends $Command + .classBuilder< + HttpRequestWithRegexLiteralCommandInput, + HttpRequestWithRegexLiteralCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpRequestWithRegexLiteral", {}) + .n("RestJsonProtocolClient", "HttpRequestWithRegexLiteralCommand") + .f(void 0, void 0) + .sc(HttpRequestWithRegexLiteral) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithRegexLiteralInput; + output: {}; + }; + sdk: { + input: HttpRequestWithRegexLiteralCommandInput; + output: HttpRequestWithRegexLiteralCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpResponseCodeCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpResponseCodeCommand.ts new file mode 100644 index 0000000000000..dd5ef2e0a0c91 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpResponseCodeCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpResponseCodeOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpResponseCode } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpResponseCodeCommand}. + */ +export interface HttpResponseCodeCommandInput {} +/** + * @public + * + * The output of {@link HttpResponseCodeCommand}. + */ +export interface HttpResponseCodeCommandOutput extends HttpResponseCodeOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpResponseCodeCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpResponseCodeCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new HttpResponseCodeCommand(input); + * const response = await client.send(command); + * // { // HttpResponseCodeOutput + * // Status: Number("int"), + * // }; + * + * ``` + * + * @param HttpResponseCodeCommandInput - {@link HttpResponseCodeCommandInput} + * @returns {@link HttpResponseCodeCommandOutput} + * @see {@link HttpResponseCodeCommandInput} for command's `input` shape. + * @see {@link HttpResponseCodeCommandOutput} 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 HttpResponseCodeCommand extends $Command + .classBuilder< + HttpResponseCodeCommandInput, + HttpResponseCodeCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpResponseCode", {}) + .n("RestJsonProtocolClient", "HttpResponseCodeCommand") + .f(void 0, void 0) + .sc(HttpResponseCode) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: HttpResponseCodeOutput; + }; + sdk: { + input: HttpResponseCodeCommandInput; + output: HttpResponseCodeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpStringPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpStringPayloadCommand.ts new file mode 100644 index 0000000000000..7d57896eadec8 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpStringPayloadCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { StringPayloadInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpStringPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpStringPayloadCommand}. + */ +export interface HttpStringPayloadCommandInput extends StringPayloadInput {} +/** + * @public + * + * The output of {@link HttpStringPayloadCommand}. + */ +export interface HttpStringPayloadCommandOutput extends StringPayloadInput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpStringPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpStringPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // StringPayloadInput + * payload: "STRING_VALUE", + * }; + * const command = new HttpStringPayloadCommand(input); + * const response = await client.send(command); + * // { // StringPayloadInput + * // payload: "STRING_VALUE", + * // }; + * + * ``` + * + * @param HttpStringPayloadCommandInput - {@link HttpStringPayloadCommandInput} + * @returns {@link HttpStringPayloadCommandOutput} + * @see {@link HttpStringPayloadCommandInput} for command's `input` shape. + * @see {@link HttpStringPayloadCommandOutput} 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 HttpStringPayloadCommand extends $Command + .classBuilder< + HttpStringPayloadCommandInput, + HttpStringPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpStringPayload", {}) + .n("RestJsonProtocolClient", "HttpStringPayloadCommand") + .f(void 0, void 0) + .sc(HttpStringPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: StringPayloadInput; + output: StringPayloadInput; + }; + sdk: { + input: HttpStringPayloadCommandInput; + output: HttpStringPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/IgnoreQueryParamsInResponseCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/IgnoreQueryParamsInResponseCommand.ts new file mode 100644 index 0000000000000..ce3df65b2dc3b --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/IgnoreQueryParamsInResponseCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { IgnoreQueryParamsInResponseOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { IgnoreQueryParamsInResponse } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link IgnoreQueryParamsInResponseCommand}. + */ +export interface IgnoreQueryParamsInResponseCommandInput {} +/** + * @public + * + * The output of {@link IgnoreQueryParamsInResponseCommand}. + */ +export interface IgnoreQueryParamsInResponseCommandOutput extends IgnoreQueryParamsInResponseOutput, __MetadataBearer {} + +/** + * This example ensures that query string bound request parameters are + * serialized in the body of responses if the structure is used in both + * the request and response. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, IgnoreQueryParamsInResponseCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, IgnoreQueryParamsInResponseCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new IgnoreQueryParamsInResponseCommand(input); + * const response = await client.send(command); + * // { // IgnoreQueryParamsInResponseOutput + * // baz: "STRING_VALUE", + * // }; + * + * ``` + * + * @param IgnoreQueryParamsInResponseCommandInput - {@link IgnoreQueryParamsInResponseCommandInput} + * @returns {@link IgnoreQueryParamsInResponseCommandOutput} + * @see {@link IgnoreQueryParamsInResponseCommandInput} for command's `input` shape. + * @see {@link IgnoreQueryParamsInResponseCommandOutput} 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 IgnoreQueryParamsInResponseCommand extends $Command + .classBuilder< + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "IgnoreQueryParamsInResponse", {}) + .n("RestJsonProtocolClient", "IgnoreQueryParamsInResponseCommand") + .f(void 0, void 0) + .sc(IgnoreQueryParamsInResponse) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: IgnoreQueryParamsInResponseOutput; + }; + sdk: { + input: IgnoreQueryParamsInResponseCommandInput; + output: IgnoreQueryParamsInResponseCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/InputAndOutputWithHeadersCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/InputAndOutputWithHeadersCommand.ts new file mode 100644 index 0000000000000..052b3e2dcc7d2 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/InputAndOutputWithHeadersCommand.ts @@ -0,0 +1,151 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { InputAndOutputWithHeadersIO } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { InputAndOutputWithHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InputAndOutputWithHeadersCommand}. + */ +export interface InputAndOutputWithHeadersCommandInput extends InputAndOutputWithHeadersIO {} +/** + * @public + * + * The output of {@link InputAndOutputWithHeadersCommand}. + */ +export interface InputAndOutputWithHeadersCommandOutput extends InputAndOutputWithHeadersIO, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there is + * no input or output payload but there are HTTP header bindings. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, InputAndOutputWithHeadersCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, InputAndOutputWithHeadersCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // InputAndOutputWithHeadersIO + * headerString: "STRING_VALUE", + * headerByte: 0, // BYTE_VALUE + * headerShort: Number("short"), + * headerInteger: Number("int"), + * headerLong: Number("long"), + * headerFloat: Number("float"), + * headerDouble: Number("double"), + * headerTrueBool: true || false, + * headerFalseBool: true || false, + * headerStringList: [ // StringList + * "STRING_VALUE", + * ], + * headerStringSet: [ // StringSet + * "STRING_VALUE", + * ], + * headerIntegerList: [ // IntegerList + * Number("int"), + * ], + * headerBooleanList: [ // BooleanList + * true || false, + * ], + * headerTimestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * headerEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * headerEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * headerIntegerEnum: 1 || 2 || 3, + * headerIntegerEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * }; + * const command = new InputAndOutputWithHeadersCommand(input); + * const response = await client.send(command); + * // { // InputAndOutputWithHeadersIO + * // headerString: "STRING_VALUE", + * // headerByte: 0, // BYTE_VALUE + * // headerShort: Number("short"), + * // headerInteger: Number("int"), + * // headerLong: Number("long"), + * // headerFloat: Number("float"), + * // headerDouble: Number("double"), + * // headerTrueBool: true || false, + * // headerFalseBool: true || false, + * // headerStringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // headerStringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // headerIntegerList: [ // IntegerList + * // Number("int"), + * // ], + * // headerBooleanList: [ // BooleanList + * // true || false, + * // ], + * // headerTimestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // headerEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * // headerEnumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // headerIntegerEnum: 1 || 2 || 3, + * // headerIntegerEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // }; + * + * ``` + * + * @param InputAndOutputWithHeadersCommandInput - {@link InputAndOutputWithHeadersCommandInput} + * @returns {@link InputAndOutputWithHeadersCommandOutput} + * @see {@link InputAndOutputWithHeadersCommandInput} for command's `input` shape. + * @see {@link InputAndOutputWithHeadersCommandOutput} 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 InputAndOutputWithHeadersCommand extends $Command + .classBuilder< + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "InputAndOutputWithHeaders", {}) + .n("RestJsonProtocolClient", "InputAndOutputWithHeadersCommand") + .f(void 0, void 0) + .sc(InputAndOutputWithHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: InputAndOutputWithHeadersIO; + output: InputAndOutputWithHeadersIO; + }; + sdk: { + input: InputAndOutputWithHeadersCommandInput; + output: InputAndOutputWithHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/JsonBlobsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/JsonBlobsCommand.ts new file mode 100644 index 0000000000000..5c627cbb41005 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/JsonBlobsCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonBlobsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { JsonBlobs } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonBlobsCommand}. + */ +export interface JsonBlobsCommandInput extends JsonBlobsInputOutput {} +/** + * @public + * + * The output of {@link JsonBlobsCommand}. + */ +export interface JsonBlobsCommandOutput extends JsonBlobsInputOutput, __MetadataBearer {} + +/** + * Blobs are base64 encoded + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, JsonBlobsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, JsonBlobsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // JsonBlobsInputOutput + * data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new JsonBlobsCommand(input); + * const response = await client.send(command); + * // { // JsonBlobsInputOutput + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param JsonBlobsCommandInput - {@link JsonBlobsCommandInput} + * @returns {@link JsonBlobsCommandOutput} + * @see {@link JsonBlobsCommandInput} for command's `input` shape. + * @see {@link JsonBlobsCommandOutput} 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 JsonBlobsCommand extends $Command + .classBuilder< + JsonBlobsCommandInput, + JsonBlobsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "JsonBlobs", {}) + .n("RestJsonProtocolClient", "JsonBlobsCommand") + .f(void 0, void 0) + .sc(JsonBlobs) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonBlobsInputOutput; + output: JsonBlobsInputOutput; + }; + sdk: { + input: JsonBlobsCommandInput; + output: JsonBlobsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/JsonEnumsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/JsonEnumsCommand.ts new file mode 100644 index 0000000000000..1d6268907b424 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/JsonEnumsCommand.ts @@ -0,0 +1,110 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonEnumsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { JsonEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonEnumsCommand}. + */ +export interface JsonEnumsCommandInput extends JsonEnumsInputOutput {} +/** + * @public + * + * The output of {@link JsonEnumsCommand}. + */ +export interface JsonEnumsCommandOutput extends JsonEnumsInputOutput, __MetadataBearer {} + +/** + * This example serializes enums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, JsonEnumsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, JsonEnumsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // JsonEnumsInputOutput + * fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * fooEnumSet: [ // FooEnumSet + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * fooEnumMap: { // FooEnumMap + * "": "Foo" || "Baz" || "Bar" || "1" || "0", + * }, + * }; + * const command = new JsonEnumsCommand(input); + * const response = await client.send(command); + * // { // JsonEnumsInputOutput + * // fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumSet: [ // FooEnumSet + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumMap: { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }; + * + * ``` + * + * @param JsonEnumsCommandInput - {@link JsonEnumsCommandInput} + * @returns {@link JsonEnumsCommandOutput} + * @see {@link JsonEnumsCommandInput} for command's `input` shape. + * @see {@link JsonEnumsCommandOutput} 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 JsonEnumsCommand extends $Command + .classBuilder< + JsonEnumsCommandInput, + JsonEnumsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "JsonEnums", {}) + .n("RestJsonProtocolClient", "JsonEnumsCommand") + .f(void 0, void 0) + .sc(JsonEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonEnumsInputOutput; + output: JsonEnumsInputOutput; + }; + sdk: { + input: JsonEnumsCommandInput; + output: JsonEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/JsonIntEnumsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/JsonIntEnumsCommand.ts new file mode 100644 index 0000000000000..0af1f2c8c67a5 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/JsonIntEnumsCommand.ts @@ -0,0 +1,110 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonIntEnumsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { JsonIntEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonIntEnumsCommand}. + */ +export interface JsonIntEnumsCommandInput extends JsonIntEnumsInputOutput {} +/** + * @public + * + * The output of {@link JsonIntEnumsCommand}. + */ +export interface JsonIntEnumsCommandOutput extends JsonIntEnumsInputOutput, __MetadataBearer {} + +/** + * This example serializes intEnums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, JsonIntEnumsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, JsonIntEnumsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // JsonIntEnumsInputOutput + * integerEnum1: 1 || 2 || 3, + * integerEnum2: 1 || 2 || 3, + * integerEnum3: 1 || 2 || 3, + * integerEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * integerEnumSet: [ // IntegerEnumSet + * 1 || 2 || 3, + * ], + * integerEnumMap: { // IntegerEnumMap + * "": 1 || 2 || 3, + * }, + * }; + * const command = new JsonIntEnumsCommand(input); + * const response = await client.send(command); + * // { // JsonIntEnumsInputOutput + * // integerEnum1: 1 || 2 || 3, + * // integerEnum2: 1 || 2 || 3, + * // integerEnum3: 1 || 2 || 3, + * // integerEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // integerEnumSet: [ // IntegerEnumSet + * // 1 || 2 || 3, + * // ], + * // integerEnumMap: { // IntegerEnumMap + * // "": 1 || 2 || 3, + * // }, + * // }; + * + * ``` + * + * @param JsonIntEnumsCommandInput - {@link JsonIntEnumsCommandInput} + * @returns {@link JsonIntEnumsCommandOutput} + * @see {@link JsonIntEnumsCommandInput} for command's `input` shape. + * @see {@link JsonIntEnumsCommandOutput} 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 JsonIntEnumsCommand extends $Command + .classBuilder< + JsonIntEnumsCommandInput, + JsonIntEnumsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "JsonIntEnums", {}) + .n("RestJsonProtocolClient", "JsonIntEnumsCommand") + .f(void 0, void 0) + .sc(JsonIntEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonIntEnumsInputOutput; + output: JsonIntEnumsInputOutput; + }; + sdk: { + input: JsonIntEnumsCommandInput; + output: JsonIntEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/JsonListsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/JsonListsCommand.ts new file mode 100644 index 0000000000000..369802a188fb2 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/JsonListsCommand.ts @@ -0,0 +1,156 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonListsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { JsonLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonListsCommand}. + */ +export interface JsonListsCommandInput extends JsonListsInputOutput {} +/** + * @public + * + * The output of {@link JsonListsCommand}. + */ +export interface JsonListsCommandOutput extends JsonListsInputOutput, __MetadataBearer {} + +/** + * This test case serializes JSON lists for the following cases for both + * input and output: + * + * 1. Normal JSON lists. + * 2. Normal JSON sets. + * 3. JSON lists of lists. + * 4. Lists of structures. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, JsonListsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, JsonListsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // JsonListsInputOutput + * stringList: [ // StringList + * "STRING_VALUE", + * ], + * stringSet: [ // StringSet + * "STRING_VALUE", + * ], + * integerList: [ // IntegerList + * Number("int"), + * ], + * booleanList: [ // BooleanList + * true || false, + * ], + * timestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * enumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * intEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * nestedStringList: [ // NestedStringList + * [ + * "STRING_VALUE", + * ], + * ], + * structureList: [ // StructureList + * { // StructureListMember + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * }, + * ], + * }; + * const command = new JsonListsCommand(input); + * const response = await client.send(command); + * // { // JsonListsInputOutput + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param JsonListsCommandInput - {@link JsonListsCommandInput} + * @returns {@link JsonListsCommandOutput} + * @see {@link JsonListsCommandInput} for command's `input` shape. + * @see {@link JsonListsCommandOutput} 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 JsonListsCommand extends $Command + .classBuilder< + JsonListsCommandInput, + JsonListsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "JsonLists", {}) + .n("RestJsonProtocolClient", "JsonListsCommand") + .f(void 0, void 0) + .sc(JsonLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonListsInputOutput; + output: JsonListsInputOutput; + }; + sdk: { + input: JsonListsCommandInput; + output: JsonListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/JsonMapsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/JsonMapsCommand.ts new file mode 100644 index 0000000000000..39ca2f0c4bb79 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/JsonMapsCommand.ts @@ -0,0 +1,124 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonMapsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { JsonMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonMapsCommand}. + */ +export interface JsonMapsCommandInput extends JsonMapsInputOutput {} +/** + * @public + * + * The output of {@link JsonMapsCommand}. + */ +export interface JsonMapsCommandOutput extends JsonMapsInputOutput, __MetadataBearer {} + +/** + * The example tests basic map serialization. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, JsonMapsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, JsonMapsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // JsonMapsInputOutput + * denseStructMap: { // DenseStructMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * denseNumberMap: { // DenseNumberMap + * "": Number("int"), + * }, + * denseBooleanMap: { // DenseBooleanMap + * "": true || false, + * }, + * denseStringMap: { // DenseStringMap + * "": "STRING_VALUE", + * }, + * denseSetMap: { // DenseSetMap + * "": [ // StringSet + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new JsonMapsCommand(input); + * const response = await client.send(command); + * // { // JsonMapsInputOutput + * // denseStructMap: { // DenseStructMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // denseNumberMap: { // DenseNumberMap + * // "": Number("int"), + * // }, + * // denseBooleanMap: { // DenseBooleanMap + * // "": true || false, + * // }, + * // denseStringMap: { // DenseStringMap + * // "": "STRING_VALUE", + * // }, + * // denseSetMap: { // DenseSetMap + * // "": [ // StringSet + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param JsonMapsCommandInput - {@link JsonMapsCommandInput} + * @returns {@link JsonMapsCommandOutput} + * @see {@link JsonMapsCommandInput} for command's `input` shape. + * @see {@link JsonMapsCommandOutput} 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 JsonMapsCommand extends $Command + .classBuilder< + JsonMapsCommandInput, + JsonMapsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "JsonMaps", {}) + .n("RestJsonProtocolClient", "JsonMapsCommand") + .f(void 0, void 0) + .sc(JsonMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonMapsInputOutput; + output: JsonMapsInputOutput; + }; + sdk: { + input: JsonMapsCommandInput; + output: JsonMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/JsonTimestampsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/JsonTimestampsCommand.ts new file mode 100644 index 0000000000000..9094d620a1a01 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/JsonTimestampsCommand.ts @@ -0,0 +1,102 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { JsonTimestampsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { JsonTimestamps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonTimestampsCommand}. + */ +export interface JsonTimestampsCommandInput extends JsonTimestampsInputOutput {} +/** + * @public + * + * The output of {@link JsonTimestampsCommand}. + */ +export interface JsonTimestampsCommandOutput extends JsonTimestampsInputOutput, __MetadataBearer {} + +/** + * This tests how timestamps are serialized, including using the + * default format of date-time and various @timestampFormat trait + * values. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, JsonTimestampsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, JsonTimestampsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // JsonTimestampsInputOutput + * normal: new Date("TIMESTAMP"), + * dateTime: new Date("TIMESTAMP"), + * dateTimeOnTarget: new Date("TIMESTAMP"), + * epochSeconds: new Date("TIMESTAMP"), + * epochSecondsOnTarget: new Date("TIMESTAMP"), + * httpDate: new Date("TIMESTAMP"), + * httpDateOnTarget: new Date("TIMESTAMP"), + * }; + * const command = new JsonTimestampsCommand(input); + * const response = await client.send(command); + * // { // JsonTimestampsInputOutput + * // normal: new Date("TIMESTAMP"), + * // dateTime: new Date("TIMESTAMP"), + * // dateTimeOnTarget: new Date("TIMESTAMP"), + * // epochSeconds: new Date("TIMESTAMP"), + * // epochSecondsOnTarget: new Date("TIMESTAMP"), + * // httpDate: new Date("TIMESTAMP"), + * // httpDateOnTarget: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param JsonTimestampsCommandInput - {@link JsonTimestampsCommandInput} + * @returns {@link JsonTimestampsCommandOutput} + * @see {@link JsonTimestampsCommandInput} for command's `input` shape. + * @see {@link JsonTimestampsCommandOutput} 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 JsonTimestampsCommand extends $Command + .classBuilder< + JsonTimestampsCommandInput, + JsonTimestampsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "JsonTimestamps", {}) + .n("RestJsonProtocolClient", "JsonTimestampsCommand") + .f(void 0, void 0) + .sc(JsonTimestamps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: JsonTimestampsInputOutput; + output: JsonTimestampsInputOutput; + }; + sdk: { + input: JsonTimestampsCommandInput; + output: JsonTimestampsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/JsonUnionsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/JsonUnionsCommand.ts new file mode 100644 index 0000000000000..eae172015437d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/JsonUnionsCommand.ts @@ -0,0 +1,126 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { UnionInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { JsonUnions } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link JsonUnionsCommand}. + */ +export interface JsonUnionsCommandInput extends UnionInputOutput {} +/** + * @public + * + * The output of {@link JsonUnionsCommand}. + */ +export interface JsonUnionsCommandOutput extends UnionInputOutput, __MetadataBearer {} + +/** + * This operation uses unions for inputs and outputs. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, JsonUnionsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, JsonUnionsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // UnionInputOutput + * contents: { // MyUnion Union: only one key present + * stringValue: "STRING_VALUE", + * booleanValue: true || false, + * numberValue: Number("int"), + * blobValue: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * timestampValue: new Date("TIMESTAMP"), + * enumValue: "Foo" || "Baz" || "Bar" || "1" || "0", + * listValue: [ // StringList + * "STRING_VALUE", + * ], + * mapValue: { // StringMap + * "": "STRING_VALUE", + * }, + * structureValue: { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * renamedStructureValue: { // GreetingStruct + * salutation: "STRING_VALUE", + * }, + * }, + * }; + * const command = new JsonUnionsCommand(input); + * const response = await client.send(command); + * // { // UnionInputOutput + * // contents: { // MyUnion Union: only one key present + * // stringValue: "STRING_VALUE", + * // booleanValue: true || false, + * // numberValue: Number("int"), + * // blobValue: new Uint8Array(), + * // timestampValue: new Date("TIMESTAMP"), + * // enumValue: "Foo" || "Baz" || "Bar" || "1" || "0", + * // listValue: [ // StringList + * // "STRING_VALUE", + * // ], + * // mapValue: { // StringMap + * // "": "STRING_VALUE", + * // }, + * // structureValue: { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // renamedStructureValue: { // GreetingStruct + * // salutation: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param JsonUnionsCommandInput - {@link JsonUnionsCommandInput} + * @returns {@link JsonUnionsCommandOutput} + * @see {@link JsonUnionsCommandInput} for command's `input` shape. + * @see {@link JsonUnionsCommandOutput} 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 JsonUnionsCommand extends $Command + .classBuilder< + JsonUnionsCommandInput, + JsonUnionsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "JsonUnions", {}) + .n("RestJsonProtocolClient", "JsonUnionsCommand") + .f(void 0, void 0) + .sc(JsonUnions) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UnionInputOutput; + output: UnionInputOutput; + }; + sdk: { + input: JsonUnionsCommandInput; + output: JsonUnionsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithBodyCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithBodyCommand.ts new file mode 100644 index 0000000000000..6d2bdf37f2226 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithBodyCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { GreetingStruct } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedAcceptWithBody } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedAcceptWithBodyCommand}. + */ +export interface MalformedAcceptWithBodyCommandInput {} +/** + * @public + * + * The output of {@link MalformedAcceptWithBodyCommand}. + */ +export interface MalformedAcceptWithBodyCommandOutput extends GreetingStruct, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedAcceptWithBodyCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedAcceptWithBodyCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new MalformedAcceptWithBodyCommand(input); + * const response = await client.send(command); + * // { // GreetingStruct + * // hi: "STRING_VALUE", + * // }; + * + * ``` + * + * @param MalformedAcceptWithBodyCommandInput - {@link MalformedAcceptWithBodyCommandInput} + * @returns {@link MalformedAcceptWithBodyCommandOutput} + * @see {@link MalformedAcceptWithBodyCommandInput} for command's `input` shape. + * @see {@link MalformedAcceptWithBodyCommandOutput} 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 MalformedAcceptWithBodyCommand extends $Command + .classBuilder< + MalformedAcceptWithBodyCommandInput, + MalformedAcceptWithBodyCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedAcceptWithBody", {}) + .n("RestJsonProtocolClient", "MalformedAcceptWithBodyCommand") + .f(void 0, void 0) + .sc(MalformedAcceptWithBody) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: GreetingStruct; + }; + sdk: { + input: MalformedAcceptWithBodyCommandInput; + output: MalformedAcceptWithBodyCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithGenericStringCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithGenericStringCommand.ts new file mode 100644 index 0000000000000..aa6619d5fc194 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithGenericStringCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedAcceptWithGenericStringOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedAcceptWithGenericString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedAcceptWithGenericStringCommand}. + */ +export interface MalformedAcceptWithGenericStringCommandInput {} +/** + * @public + * + * The output of {@link MalformedAcceptWithGenericStringCommand}. + */ +export interface MalformedAcceptWithGenericStringCommandOutput + extends MalformedAcceptWithGenericStringOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedAcceptWithGenericStringCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedAcceptWithGenericStringCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new MalformedAcceptWithGenericStringCommand(input); + * const response = await client.send(command); + * // { // MalformedAcceptWithGenericStringOutput + * // payload: "STRING_VALUE", + * // }; + * + * ``` + * + * @param MalformedAcceptWithGenericStringCommandInput - {@link MalformedAcceptWithGenericStringCommandInput} + * @returns {@link MalformedAcceptWithGenericStringCommandOutput} + * @see {@link MalformedAcceptWithGenericStringCommandInput} for command's `input` shape. + * @see {@link MalformedAcceptWithGenericStringCommandOutput} 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 MalformedAcceptWithGenericStringCommand extends $Command + .classBuilder< + MalformedAcceptWithGenericStringCommandInput, + MalformedAcceptWithGenericStringCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedAcceptWithGenericString", {}) + .n("RestJsonProtocolClient", "MalformedAcceptWithGenericStringCommand") + .f(void 0, void 0) + .sc(MalformedAcceptWithGenericString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: MalformedAcceptWithGenericStringOutput; + }; + sdk: { + input: MalformedAcceptWithGenericStringCommandInput; + output: MalformedAcceptWithGenericStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithPayloadCommand.ts new file mode 100644 index 0000000000000..2d7e7478c2761 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedAcceptWithPayloadCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; +import { Uint8ArrayBlobAdapter } from "@smithy/util-stream"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedAcceptWithPayloadOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedAcceptWithPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedAcceptWithPayloadCommand}. + */ +export interface MalformedAcceptWithPayloadCommandInput {} +/** + * @public + */ +export type MalformedAcceptWithPayloadCommandOutputType = Omit & { + payload?: Uint8ArrayBlobAdapter; +}; + +/** + * @public + * + * The output of {@link MalformedAcceptWithPayloadCommand}. + */ +export interface MalformedAcceptWithPayloadCommandOutput + extends MalformedAcceptWithPayloadCommandOutputType, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedAcceptWithPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedAcceptWithPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new MalformedAcceptWithPayloadCommand(input); + * const response = await client.send(command); + * // { // MalformedAcceptWithPayloadOutput + * // payload: new Uint8Array(), + * // }; + * + * ``` + * + * @param MalformedAcceptWithPayloadCommandInput - {@link MalformedAcceptWithPayloadCommandInput} + * @returns {@link MalformedAcceptWithPayloadCommandOutput} + * @see {@link MalformedAcceptWithPayloadCommandInput} for command's `input` shape. + * @see {@link MalformedAcceptWithPayloadCommandOutput} 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 MalformedAcceptWithPayloadCommand extends $Command + .classBuilder< + MalformedAcceptWithPayloadCommandInput, + MalformedAcceptWithPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedAcceptWithPayload", {}) + .n("RestJsonProtocolClient", "MalformedAcceptWithPayloadCommand") + .f(void 0, void 0) + .sc(MalformedAcceptWithPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: MalformedAcceptWithPayloadOutput; + }; + sdk: { + input: MalformedAcceptWithPayloadCommandInput; + output: MalformedAcceptWithPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedBlobCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedBlobCommand.ts new file mode 100644 index 0000000000000..33b363e4b1a73 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedBlobCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedBlobInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedBlob } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedBlobCommand}. + */ +export interface MalformedBlobCommandInput extends MalformedBlobInput {} +/** + * @public + * + * The output of {@link MalformedBlobCommand}. + */ +export interface MalformedBlobCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedBlobCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedBlobCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedBlobInput + * blob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new MalformedBlobCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedBlobCommandInput - {@link MalformedBlobCommandInput} + * @returns {@link MalformedBlobCommandOutput} + * @see {@link MalformedBlobCommandInput} for command's `input` shape. + * @see {@link MalformedBlobCommandOutput} 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 MalformedBlobCommand extends $Command + .classBuilder< + MalformedBlobCommandInput, + MalformedBlobCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedBlob", {}) + .n("RestJsonProtocolClient", "MalformedBlobCommand") + .f(void 0, void 0) + .sc(MalformedBlob) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedBlobInput; + output: {}; + }; + sdk: { + input: MalformedBlobCommandInput; + output: MalformedBlobCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedBooleanCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedBooleanCommand.ts new file mode 100644 index 0000000000000..7bc674b8f478c --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedBooleanCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedBooleanInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedBoolean } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedBooleanCommand}. + */ +export interface MalformedBooleanCommandInput extends MalformedBooleanInput {} +/** + * @public + * + * The output of {@link MalformedBooleanCommand}. + */ +export interface MalformedBooleanCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedBooleanCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedBooleanCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedBooleanInput + * booleanInBody: true || false, + * booleanInPath: true || false, // required + * booleanInQuery: true || false, + * booleanInHeader: true || false, + * }; + * const command = new MalformedBooleanCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedBooleanCommandInput - {@link MalformedBooleanCommandInput} + * @returns {@link MalformedBooleanCommandOutput} + * @see {@link MalformedBooleanCommandInput} for command's `input` shape. + * @see {@link MalformedBooleanCommandOutput} 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 MalformedBooleanCommand extends $Command + .classBuilder< + MalformedBooleanCommandInput, + MalformedBooleanCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedBoolean", {}) + .n("RestJsonProtocolClient", "MalformedBooleanCommand") + .f(void 0, void 0) + .sc(MalformedBoolean) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedBooleanInput; + output: {}; + }; + sdk: { + input: MalformedBooleanCommandInput; + output: MalformedBooleanCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedByteCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedByteCommand.ts new file mode 100644 index 0000000000000..5d0db60477238 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedByteCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedByteInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedByte } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedByteCommand}. + */ +export interface MalformedByteCommandInput extends MalformedByteInput {} +/** + * @public + * + * The output of {@link MalformedByteCommand}. + */ +export interface MalformedByteCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedByteCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedByteCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedByteInput + * byteInBody: 0, // BYTE_VALUE + * byteInPath: 0, // BYTE_VALUE // required + * byteInQuery: 0, // BYTE_VALUE + * byteInHeader: 0, // BYTE_VALUE + * }; + * const command = new MalformedByteCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedByteCommandInput - {@link MalformedByteCommandInput} + * @returns {@link MalformedByteCommandOutput} + * @see {@link MalformedByteCommandInput} for command's `input` shape. + * @see {@link MalformedByteCommandOutput} 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 MalformedByteCommand extends $Command + .classBuilder< + MalformedByteCommandInput, + MalformedByteCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedByte", {}) + .n("RestJsonProtocolClient", "MalformedByteCommand") + .f(void 0, void 0) + .sc(MalformedByte) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedByteInput; + output: {}; + }; + sdk: { + input: MalformedByteCommandInput; + output: MalformedByteCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithBodyCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithBodyCommand.ts new file mode 100644 index 0000000000000..fc8e1ac495a3b --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithBodyCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { GreetingStruct } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedContentTypeWithBody } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedContentTypeWithBodyCommand}. + */ +export interface MalformedContentTypeWithBodyCommandInput extends GreetingStruct {} +/** + * @public + * + * The output of {@link MalformedContentTypeWithBodyCommand}. + */ +export interface MalformedContentTypeWithBodyCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedContentTypeWithBodyCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedContentTypeWithBodyCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // GreetingStruct + * hi: "STRING_VALUE", + * }; + * const command = new MalformedContentTypeWithBodyCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedContentTypeWithBodyCommandInput - {@link MalformedContentTypeWithBodyCommandInput} + * @returns {@link MalformedContentTypeWithBodyCommandOutput} + * @see {@link MalformedContentTypeWithBodyCommandInput} for command's `input` shape. + * @see {@link MalformedContentTypeWithBodyCommandOutput} 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 MalformedContentTypeWithBodyCommand extends $Command + .classBuilder< + MalformedContentTypeWithBodyCommandInput, + MalformedContentTypeWithBodyCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedContentTypeWithBody", {}) + .n("RestJsonProtocolClient", "MalformedContentTypeWithBodyCommand") + .f(void 0, void 0) + .sc(MalformedContentTypeWithBody) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GreetingStruct; + output: {}; + }; + sdk: { + input: MalformedContentTypeWithBodyCommandInput; + output: MalformedContentTypeWithBodyCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithGenericStringCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithGenericStringCommand.ts new file mode 100644 index 0000000000000..1bf3e5ea42de0 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithGenericStringCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedContentTypeWithGenericStringInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedContentTypeWithGenericString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedContentTypeWithGenericStringCommand}. + */ +export interface MalformedContentTypeWithGenericStringCommandInput extends MalformedContentTypeWithGenericStringInput {} +/** + * @public + * + * The output of {@link MalformedContentTypeWithGenericStringCommand}. + */ +export interface MalformedContentTypeWithGenericStringCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedContentTypeWithGenericStringCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedContentTypeWithGenericStringCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedContentTypeWithGenericStringInput + * payload: "STRING_VALUE", + * }; + * const command = new MalformedContentTypeWithGenericStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedContentTypeWithGenericStringCommandInput - {@link MalformedContentTypeWithGenericStringCommandInput} + * @returns {@link MalformedContentTypeWithGenericStringCommandOutput} + * @see {@link MalformedContentTypeWithGenericStringCommandInput} for command's `input` shape. + * @see {@link MalformedContentTypeWithGenericStringCommandOutput} 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 MalformedContentTypeWithGenericStringCommand extends $Command + .classBuilder< + MalformedContentTypeWithGenericStringCommandInput, + MalformedContentTypeWithGenericStringCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedContentTypeWithGenericString", {}) + .n("RestJsonProtocolClient", "MalformedContentTypeWithGenericStringCommand") + .f(void 0, void 0) + .sc(MalformedContentTypeWithGenericString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedContentTypeWithGenericStringInput; + output: {}; + }; + sdk: { + input: MalformedContentTypeWithGenericStringCommandInput; + output: MalformedContentTypeWithGenericStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithPayloadCommand.ts new file mode 100644 index 0000000000000..f8bdd3be538db --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithPayloadCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { BlobPayloadInputTypes, MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedContentTypeWithPayloadInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedContentTypeWithPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + */ +export type MalformedContentTypeWithPayloadCommandInputType = Omit & { + payload?: BlobPayloadInputTypes; +}; + +/** + * @public + * + * The input for {@link MalformedContentTypeWithPayloadCommand}. + */ +export interface MalformedContentTypeWithPayloadCommandInput extends MalformedContentTypeWithPayloadCommandInputType {} +/** + * @public + * + * The output of {@link MalformedContentTypeWithPayloadCommand}. + */ +export interface MalformedContentTypeWithPayloadCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedContentTypeWithPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedContentTypeWithPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedContentTypeWithPayloadInput + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new MalformedContentTypeWithPayloadCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedContentTypeWithPayloadCommandInput - {@link MalformedContentTypeWithPayloadCommandInput} + * @returns {@link MalformedContentTypeWithPayloadCommandOutput} + * @see {@link MalformedContentTypeWithPayloadCommandInput} for command's `input` shape. + * @see {@link MalformedContentTypeWithPayloadCommandOutput} 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 MalformedContentTypeWithPayloadCommand extends $Command + .classBuilder< + MalformedContentTypeWithPayloadCommandInput, + MalformedContentTypeWithPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedContentTypeWithPayload", {}) + .n("RestJsonProtocolClient", "MalformedContentTypeWithPayloadCommand") + .f(void 0, void 0) + .sc(MalformedContentTypeWithPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedContentTypeWithPayloadInput; + output: {}; + }; + sdk: { + input: MalformedContentTypeWithPayloadCommandInput; + output: MalformedContentTypeWithPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithoutBodyCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithoutBodyCommand.ts new file mode 100644 index 0000000000000..b9ec21bf246d6 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithoutBodyCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedContentTypeWithoutBody } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedContentTypeWithoutBodyCommand}. + */ +export interface MalformedContentTypeWithoutBodyCommandInput {} +/** + * @public + * + * The output of {@link MalformedContentTypeWithoutBodyCommand}. + */ +export interface MalformedContentTypeWithoutBodyCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedContentTypeWithoutBodyCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedContentTypeWithoutBodyCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new MalformedContentTypeWithoutBodyCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedContentTypeWithoutBodyCommandInput - {@link MalformedContentTypeWithoutBodyCommandInput} + * @returns {@link MalformedContentTypeWithoutBodyCommandOutput} + * @see {@link MalformedContentTypeWithoutBodyCommandInput} for command's `input` shape. + * @see {@link MalformedContentTypeWithoutBodyCommandOutput} 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 MalformedContentTypeWithoutBodyCommand extends $Command + .classBuilder< + MalformedContentTypeWithoutBodyCommandInput, + MalformedContentTypeWithoutBodyCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedContentTypeWithoutBody", {}) + .n("RestJsonProtocolClient", "MalformedContentTypeWithoutBodyCommand") + .f(void 0, void 0) + .sc(MalformedContentTypeWithoutBody) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: MalformedContentTypeWithoutBodyCommandInput; + output: MalformedContentTypeWithoutBodyCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithoutBodyEmptyInputCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithoutBodyEmptyInputCommand.ts new file mode 100644 index 0000000000000..2c6cda91f2109 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedContentTypeWithoutBodyEmptyInputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedContentTypeWithoutBodyEmptyInputInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedContentTypeWithoutBodyEmptyInput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedContentTypeWithoutBodyEmptyInputCommand}. + */ +export interface MalformedContentTypeWithoutBodyEmptyInputCommandInput + extends MalformedContentTypeWithoutBodyEmptyInputInput {} +/** + * @public + * + * The output of {@link MalformedContentTypeWithoutBodyEmptyInputCommand}. + */ +export interface MalformedContentTypeWithoutBodyEmptyInputCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedContentTypeWithoutBodyEmptyInputCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedContentTypeWithoutBodyEmptyInputCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedContentTypeWithoutBodyEmptyInputInput + * header: "STRING_VALUE", + * }; + * const command = new MalformedContentTypeWithoutBodyEmptyInputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedContentTypeWithoutBodyEmptyInputCommandInput - {@link MalformedContentTypeWithoutBodyEmptyInputCommandInput} + * @returns {@link MalformedContentTypeWithoutBodyEmptyInputCommandOutput} + * @see {@link MalformedContentTypeWithoutBodyEmptyInputCommandInput} for command's `input` shape. + * @see {@link MalformedContentTypeWithoutBodyEmptyInputCommandOutput} 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 MalformedContentTypeWithoutBodyEmptyInputCommand extends $Command + .classBuilder< + MalformedContentTypeWithoutBodyEmptyInputCommandInput, + MalformedContentTypeWithoutBodyEmptyInputCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedContentTypeWithoutBodyEmptyInput", {}) + .n("RestJsonProtocolClient", "MalformedContentTypeWithoutBodyEmptyInputCommand") + .f(void 0, void 0) + .sc(MalformedContentTypeWithoutBodyEmptyInput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedContentTypeWithoutBodyEmptyInputInput; + output: {}; + }; + sdk: { + input: MalformedContentTypeWithoutBodyEmptyInputCommandInput; + output: MalformedContentTypeWithoutBodyEmptyInputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedDoubleCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedDoubleCommand.ts new file mode 100644 index 0000000000000..1403f37fd79bb --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedDoubleCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedDoubleInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedDouble } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedDoubleCommand}. + */ +export interface MalformedDoubleCommandInput extends MalformedDoubleInput {} +/** + * @public + * + * The output of {@link MalformedDoubleCommand}. + */ +export interface MalformedDoubleCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedDoubleCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedDoubleCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedDoubleInput + * doubleInBody: Number("double"), + * doubleInPath: Number("double"), // required + * doubleInQuery: Number("double"), + * doubleInHeader: Number("double"), + * }; + * const command = new MalformedDoubleCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedDoubleCommandInput - {@link MalformedDoubleCommandInput} + * @returns {@link MalformedDoubleCommandOutput} + * @see {@link MalformedDoubleCommandInput} for command's `input` shape. + * @see {@link MalformedDoubleCommandOutput} 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 MalformedDoubleCommand extends $Command + .classBuilder< + MalformedDoubleCommandInput, + MalformedDoubleCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedDouble", {}) + .n("RestJsonProtocolClient", "MalformedDoubleCommand") + .f(void 0, void 0) + .sc(MalformedDouble) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedDoubleInput; + output: {}; + }; + sdk: { + input: MalformedDoubleCommandInput; + output: MalformedDoubleCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedFloatCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedFloatCommand.ts new file mode 100644 index 0000000000000..5abb35c0f0f4d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedFloatCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedFloatInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedFloat } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedFloatCommand}. + */ +export interface MalformedFloatCommandInput extends MalformedFloatInput {} +/** + * @public + * + * The output of {@link MalformedFloatCommand}. + */ +export interface MalformedFloatCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedFloatCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedFloatCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedFloatInput + * floatInBody: Number("float"), + * floatInPath: Number("float"), // required + * floatInQuery: Number("float"), + * floatInHeader: Number("float"), + * }; + * const command = new MalformedFloatCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedFloatCommandInput - {@link MalformedFloatCommandInput} + * @returns {@link MalformedFloatCommandOutput} + * @see {@link MalformedFloatCommandInput} for command's `input` shape. + * @see {@link MalformedFloatCommandOutput} 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 MalformedFloatCommand extends $Command + .classBuilder< + MalformedFloatCommandInput, + MalformedFloatCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedFloat", {}) + .n("RestJsonProtocolClient", "MalformedFloatCommand") + .f(void 0, void 0) + .sc(MalformedFloat) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedFloatInput; + output: {}; + }; + sdk: { + input: MalformedFloatCommandInput; + output: MalformedFloatCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedIntegerCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedIntegerCommand.ts new file mode 100644 index 0000000000000..649ed5bf80030 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedIntegerCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedIntegerInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedInteger } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedIntegerCommand}. + */ +export interface MalformedIntegerCommandInput extends MalformedIntegerInput {} +/** + * @public + * + * The output of {@link MalformedIntegerCommand}. + */ +export interface MalformedIntegerCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedIntegerCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedIntegerCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedIntegerInput + * integerInBody: Number("int"), + * integerInPath: Number("int"), // required + * integerInQuery: Number("int"), + * integerInHeader: Number("int"), + * }; + * const command = new MalformedIntegerCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedIntegerCommandInput - {@link MalformedIntegerCommandInput} + * @returns {@link MalformedIntegerCommandOutput} + * @see {@link MalformedIntegerCommandInput} for command's `input` shape. + * @see {@link MalformedIntegerCommandOutput} 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 MalformedIntegerCommand extends $Command + .classBuilder< + MalformedIntegerCommandInput, + MalformedIntegerCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedInteger", {}) + .n("RestJsonProtocolClient", "MalformedIntegerCommand") + .f(void 0, void 0) + .sc(MalformedInteger) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedIntegerInput; + output: {}; + }; + sdk: { + input: MalformedIntegerCommandInput; + output: MalformedIntegerCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedListCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedListCommand.ts new file mode 100644 index 0000000000000..395208c19cb57 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedListCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedListInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedList } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedListCommand}. + */ +export interface MalformedListCommandInput extends MalformedListInput {} +/** + * @public + * + * The output of {@link MalformedListCommand}. + */ +export interface MalformedListCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedListCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedListCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedListInput + * bodyList: [ // SimpleList + * "STRING_VALUE", + * ], + * }; + * const command = new MalformedListCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedListCommandInput - {@link MalformedListCommandInput} + * @returns {@link MalformedListCommandOutput} + * @see {@link MalformedListCommandInput} for command's `input` shape. + * @see {@link MalformedListCommandOutput} 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 MalformedListCommand extends $Command + .classBuilder< + MalformedListCommandInput, + MalformedListCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedList", {}) + .n("RestJsonProtocolClient", "MalformedListCommand") + .f(void 0, void 0) + .sc(MalformedList) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedListInput; + output: {}; + }; + sdk: { + input: MalformedListCommandInput; + output: MalformedListCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedLongCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedLongCommand.ts new file mode 100644 index 0000000000000..88771a7b68c74 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedLongCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedLongInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedLong } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedLongCommand}. + */ +export interface MalformedLongCommandInput extends MalformedLongInput {} +/** + * @public + * + * The output of {@link MalformedLongCommand}. + */ +export interface MalformedLongCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedLongCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedLongCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedLongInput + * longInBody: Number("long"), + * longInPath: Number("long"), // required + * longInQuery: Number("long"), + * longInHeader: Number("long"), + * }; + * const command = new MalformedLongCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedLongCommandInput - {@link MalformedLongCommandInput} + * @returns {@link MalformedLongCommandOutput} + * @see {@link MalformedLongCommandInput} for command's `input` shape. + * @see {@link MalformedLongCommandOutput} 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 MalformedLongCommand extends $Command + .classBuilder< + MalformedLongCommandInput, + MalformedLongCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedLong", {}) + .n("RestJsonProtocolClient", "MalformedLongCommand") + .f(void 0, void 0) + .sc(MalformedLong) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedLongInput; + output: {}; + }; + sdk: { + input: MalformedLongCommandInput; + output: MalformedLongCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedMapCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedMapCommand.ts new file mode 100644 index 0000000000000..91711e73fdc3a --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedMapCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedMapInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedMap } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedMapCommand}. + */ +export interface MalformedMapCommandInput extends MalformedMapInput {} +/** + * @public + * + * The output of {@link MalformedMapCommand}. + */ +export interface MalformedMapCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedMapCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedMapCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedMapInput + * bodyMap: { // SimpleMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new MalformedMapCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedMapCommandInput - {@link MalformedMapCommandInput} + * @returns {@link MalformedMapCommandOutput} + * @see {@link MalformedMapCommandInput} for command's `input` shape. + * @see {@link MalformedMapCommandOutput} 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 MalformedMapCommand extends $Command + .classBuilder< + MalformedMapCommandInput, + MalformedMapCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedMap", {}) + .n("RestJsonProtocolClient", "MalformedMapCommand") + .f(void 0, void 0) + .sc(MalformedMap) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedMapInput; + output: {}; + }; + sdk: { + input: MalformedMapCommandInput; + output: MalformedMapCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedRequestBodyCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedRequestBodyCommand.ts new file mode 100644 index 0000000000000..25f4d0fb99a77 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedRequestBodyCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedRequestBodyInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedRequestBody } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedRequestBodyCommand}. + */ +export interface MalformedRequestBodyCommandInput extends MalformedRequestBodyInput {} +/** + * @public + * + * The output of {@link MalformedRequestBodyCommand}. + */ +export interface MalformedRequestBodyCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedRequestBodyCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedRequestBodyCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedRequestBodyInput + * int: Number("int"), + * float: Number("float"), + * }; + * const command = new MalformedRequestBodyCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedRequestBodyCommandInput - {@link MalformedRequestBodyCommandInput} + * @returns {@link MalformedRequestBodyCommandOutput} + * @see {@link MalformedRequestBodyCommandInput} for command's `input` shape. + * @see {@link MalformedRequestBodyCommandOutput} 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 MalformedRequestBodyCommand extends $Command + .classBuilder< + MalformedRequestBodyCommandInput, + MalformedRequestBodyCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedRequestBody", {}) + .n("RestJsonProtocolClient", "MalformedRequestBodyCommand") + .f(void 0, void 0) + .sc(MalformedRequestBody) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedRequestBodyInput; + output: {}; + }; + sdk: { + input: MalformedRequestBodyCommandInput; + output: MalformedRequestBodyCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedShortCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedShortCommand.ts new file mode 100644 index 0000000000000..78a930c5c719f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedShortCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedShortInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedShort } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedShortCommand}. + */ +export interface MalformedShortCommandInput extends MalformedShortInput {} +/** + * @public + * + * The output of {@link MalformedShortCommand}. + */ +export interface MalformedShortCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedShortCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedShortCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedShortInput + * shortInBody: Number("short"), + * shortInPath: Number("short"), // required + * shortInQuery: Number("short"), + * shortInHeader: Number("short"), + * }; + * const command = new MalformedShortCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedShortCommandInput - {@link MalformedShortCommandInput} + * @returns {@link MalformedShortCommandOutput} + * @see {@link MalformedShortCommandInput} for command's `input` shape. + * @see {@link MalformedShortCommandOutput} 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 MalformedShortCommand extends $Command + .classBuilder< + MalformedShortCommandInput, + MalformedShortCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedShort", {}) + .n("RestJsonProtocolClient", "MalformedShortCommand") + .f(void 0, void 0) + .sc(MalformedShort) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedShortInput; + output: {}; + }; + sdk: { + input: MalformedShortCommandInput; + output: MalformedShortCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedStringCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedStringCommand.ts new file mode 100644 index 0000000000000..6d097cd10df74 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedStringCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedStringInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedStringCommand}. + */ +export interface MalformedStringCommandInput extends MalformedStringInput {} +/** + * @public + * + * The output of {@link MalformedStringCommand}. + */ +export interface MalformedStringCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedStringCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedStringCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedStringInput + * blob: "STRING_VALUE", + * }; + * const command = new MalformedStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedStringCommandInput - {@link MalformedStringCommandInput} + * @returns {@link MalformedStringCommandOutput} + * @see {@link MalformedStringCommandInput} for command's `input` shape. + * @see {@link MalformedStringCommandOutput} 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 MalformedStringCommand extends $Command + .classBuilder< + MalformedStringCommandInput, + MalformedStringCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedString", {}) + .n("RestJsonProtocolClient", "MalformedStringCommand") + .f(void 0, void 0) + .sc(MalformedString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedStringInput; + output: {}; + }; + sdk: { + input: MalformedStringCommandInput; + output: MalformedStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyDateTimeCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyDateTimeCommand.ts new file mode 100644 index 0000000000000..551c44fdbecc1 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyDateTimeCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampBodyDateTimeInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampBodyDateTime } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampBodyDateTimeCommand}. + */ +export interface MalformedTimestampBodyDateTimeCommandInput extends MalformedTimestampBodyDateTimeInput {} +/** + * @public + * + * The output of {@link MalformedTimestampBodyDateTimeCommand}. + */ +export interface MalformedTimestampBodyDateTimeCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampBodyDateTimeCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampBodyDateTimeCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampBodyDateTimeInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampBodyDateTimeCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampBodyDateTimeCommandInput - {@link MalformedTimestampBodyDateTimeCommandInput} + * @returns {@link MalformedTimestampBodyDateTimeCommandOutput} + * @see {@link MalformedTimestampBodyDateTimeCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampBodyDateTimeCommandOutput} 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 MalformedTimestampBodyDateTimeCommand extends $Command + .classBuilder< + MalformedTimestampBodyDateTimeCommandInput, + MalformedTimestampBodyDateTimeCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampBodyDateTime", {}) + .n("RestJsonProtocolClient", "MalformedTimestampBodyDateTimeCommand") + .f(void 0, void 0) + .sc(MalformedTimestampBodyDateTime) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampBodyDateTimeInput; + output: {}; + }; + sdk: { + input: MalformedTimestampBodyDateTimeCommandInput; + output: MalformedTimestampBodyDateTimeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyDefaultCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyDefaultCommand.ts new file mode 100644 index 0000000000000..522a040e09ca9 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyDefaultCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampBodyDefaultInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampBodyDefault } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampBodyDefaultCommand}. + */ +export interface MalformedTimestampBodyDefaultCommandInput extends MalformedTimestampBodyDefaultInput {} +/** + * @public + * + * The output of {@link MalformedTimestampBodyDefaultCommand}. + */ +export interface MalformedTimestampBodyDefaultCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampBodyDefaultCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampBodyDefaultCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampBodyDefaultInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampBodyDefaultCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampBodyDefaultCommandInput - {@link MalformedTimestampBodyDefaultCommandInput} + * @returns {@link MalformedTimestampBodyDefaultCommandOutput} + * @see {@link MalformedTimestampBodyDefaultCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampBodyDefaultCommandOutput} 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 MalformedTimestampBodyDefaultCommand extends $Command + .classBuilder< + MalformedTimestampBodyDefaultCommandInput, + MalformedTimestampBodyDefaultCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampBodyDefault", {}) + .n("RestJsonProtocolClient", "MalformedTimestampBodyDefaultCommand") + .f(void 0, void 0) + .sc(MalformedTimestampBodyDefault) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampBodyDefaultInput; + output: {}; + }; + sdk: { + input: MalformedTimestampBodyDefaultCommandInput; + output: MalformedTimestampBodyDefaultCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyHttpDateCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyHttpDateCommand.ts new file mode 100644 index 0000000000000..6707859e415f8 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampBodyHttpDateCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampBodyHttpDateInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampBodyHttpDate } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampBodyHttpDateCommand}. + */ +export interface MalformedTimestampBodyHttpDateCommandInput extends MalformedTimestampBodyHttpDateInput {} +/** + * @public + * + * The output of {@link MalformedTimestampBodyHttpDateCommand}. + */ +export interface MalformedTimestampBodyHttpDateCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampBodyHttpDateCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampBodyHttpDateCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampBodyHttpDateInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampBodyHttpDateCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampBodyHttpDateCommandInput - {@link MalformedTimestampBodyHttpDateCommandInput} + * @returns {@link MalformedTimestampBodyHttpDateCommandOutput} + * @see {@link MalformedTimestampBodyHttpDateCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampBodyHttpDateCommandOutput} 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 MalformedTimestampBodyHttpDateCommand extends $Command + .classBuilder< + MalformedTimestampBodyHttpDateCommandInput, + MalformedTimestampBodyHttpDateCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampBodyHttpDate", {}) + .n("RestJsonProtocolClient", "MalformedTimestampBodyHttpDateCommand") + .f(void 0, void 0) + .sc(MalformedTimestampBodyHttpDate) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampBodyHttpDateInput; + output: {}; + }; + sdk: { + input: MalformedTimestampBodyHttpDateCommandInput; + output: MalformedTimestampBodyHttpDateCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderDateTimeCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderDateTimeCommand.ts new file mode 100644 index 0000000000000..294357039ed4b --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderDateTimeCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampHeaderDateTimeInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampHeaderDateTime } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampHeaderDateTimeCommand}. + */ +export interface MalformedTimestampHeaderDateTimeCommandInput extends MalformedTimestampHeaderDateTimeInput {} +/** + * @public + * + * The output of {@link MalformedTimestampHeaderDateTimeCommand}. + */ +export interface MalformedTimestampHeaderDateTimeCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampHeaderDateTimeCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampHeaderDateTimeCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampHeaderDateTimeInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampHeaderDateTimeCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampHeaderDateTimeCommandInput - {@link MalformedTimestampHeaderDateTimeCommandInput} + * @returns {@link MalformedTimestampHeaderDateTimeCommandOutput} + * @see {@link MalformedTimestampHeaderDateTimeCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampHeaderDateTimeCommandOutput} 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 MalformedTimestampHeaderDateTimeCommand extends $Command + .classBuilder< + MalformedTimestampHeaderDateTimeCommandInput, + MalformedTimestampHeaderDateTimeCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampHeaderDateTime", {}) + .n("RestJsonProtocolClient", "MalformedTimestampHeaderDateTimeCommand") + .f(void 0, void 0) + .sc(MalformedTimestampHeaderDateTime) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampHeaderDateTimeInput; + output: {}; + }; + sdk: { + input: MalformedTimestampHeaderDateTimeCommandInput; + output: MalformedTimestampHeaderDateTimeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderDefaultCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderDefaultCommand.ts new file mode 100644 index 0000000000000..60815197216fe --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderDefaultCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampHeaderDefaultInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampHeaderDefault } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampHeaderDefaultCommand}. + */ +export interface MalformedTimestampHeaderDefaultCommandInput extends MalformedTimestampHeaderDefaultInput {} +/** + * @public + * + * The output of {@link MalformedTimestampHeaderDefaultCommand}. + */ +export interface MalformedTimestampHeaderDefaultCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampHeaderDefaultCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampHeaderDefaultCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampHeaderDefaultInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampHeaderDefaultCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampHeaderDefaultCommandInput - {@link MalformedTimestampHeaderDefaultCommandInput} + * @returns {@link MalformedTimestampHeaderDefaultCommandOutput} + * @see {@link MalformedTimestampHeaderDefaultCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampHeaderDefaultCommandOutput} 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 MalformedTimestampHeaderDefaultCommand extends $Command + .classBuilder< + MalformedTimestampHeaderDefaultCommandInput, + MalformedTimestampHeaderDefaultCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampHeaderDefault", {}) + .n("RestJsonProtocolClient", "MalformedTimestampHeaderDefaultCommand") + .f(void 0, void 0) + .sc(MalformedTimestampHeaderDefault) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampHeaderDefaultInput; + output: {}; + }; + sdk: { + input: MalformedTimestampHeaderDefaultCommandInput; + output: MalformedTimestampHeaderDefaultCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderEpochCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderEpochCommand.ts new file mode 100644 index 0000000000000..4e30fdd160975 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampHeaderEpochCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampHeaderEpochInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampHeaderEpoch } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampHeaderEpochCommand}. + */ +export interface MalformedTimestampHeaderEpochCommandInput extends MalformedTimestampHeaderEpochInput {} +/** + * @public + * + * The output of {@link MalformedTimestampHeaderEpochCommand}. + */ +export interface MalformedTimestampHeaderEpochCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampHeaderEpochCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampHeaderEpochCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampHeaderEpochInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampHeaderEpochCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampHeaderEpochCommandInput - {@link MalformedTimestampHeaderEpochCommandInput} + * @returns {@link MalformedTimestampHeaderEpochCommandOutput} + * @see {@link MalformedTimestampHeaderEpochCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampHeaderEpochCommandOutput} 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 MalformedTimestampHeaderEpochCommand extends $Command + .classBuilder< + MalformedTimestampHeaderEpochCommandInput, + MalformedTimestampHeaderEpochCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampHeaderEpoch", {}) + .n("RestJsonProtocolClient", "MalformedTimestampHeaderEpochCommand") + .f(void 0, void 0) + .sc(MalformedTimestampHeaderEpoch) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampHeaderEpochInput; + output: {}; + }; + sdk: { + input: MalformedTimestampHeaderEpochCommandInput; + output: MalformedTimestampHeaderEpochCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathDefaultCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathDefaultCommand.ts new file mode 100644 index 0000000000000..6ed5d82665e56 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathDefaultCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampPathDefaultInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampPathDefault } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampPathDefaultCommand}. + */ +export interface MalformedTimestampPathDefaultCommandInput extends MalformedTimestampPathDefaultInput {} +/** + * @public + * + * The output of {@link MalformedTimestampPathDefaultCommand}. + */ +export interface MalformedTimestampPathDefaultCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampPathDefaultCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampPathDefaultCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampPathDefaultInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampPathDefaultCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampPathDefaultCommandInput - {@link MalformedTimestampPathDefaultCommandInput} + * @returns {@link MalformedTimestampPathDefaultCommandOutput} + * @see {@link MalformedTimestampPathDefaultCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampPathDefaultCommandOutput} 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 MalformedTimestampPathDefaultCommand extends $Command + .classBuilder< + MalformedTimestampPathDefaultCommandInput, + MalformedTimestampPathDefaultCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampPathDefault", {}) + .n("RestJsonProtocolClient", "MalformedTimestampPathDefaultCommand") + .f(void 0, void 0) + .sc(MalformedTimestampPathDefault) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampPathDefaultInput; + output: {}; + }; + sdk: { + input: MalformedTimestampPathDefaultCommandInput; + output: MalformedTimestampPathDefaultCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathEpochCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathEpochCommand.ts new file mode 100644 index 0000000000000..99ac3b0de3035 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathEpochCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampPathEpochInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampPathEpoch } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampPathEpochCommand}. + */ +export interface MalformedTimestampPathEpochCommandInput extends MalformedTimestampPathEpochInput {} +/** + * @public + * + * The output of {@link MalformedTimestampPathEpochCommand}. + */ +export interface MalformedTimestampPathEpochCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampPathEpochCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampPathEpochCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampPathEpochInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampPathEpochCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampPathEpochCommandInput - {@link MalformedTimestampPathEpochCommandInput} + * @returns {@link MalformedTimestampPathEpochCommandOutput} + * @see {@link MalformedTimestampPathEpochCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampPathEpochCommandOutput} 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 MalformedTimestampPathEpochCommand extends $Command + .classBuilder< + MalformedTimestampPathEpochCommandInput, + MalformedTimestampPathEpochCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampPathEpoch", {}) + .n("RestJsonProtocolClient", "MalformedTimestampPathEpochCommand") + .f(void 0, void 0) + .sc(MalformedTimestampPathEpoch) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampPathEpochInput; + output: {}; + }; + sdk: { + input: MalformedTimestampPathEpochCommandInput; + output: MalformedTimestampPathEpochCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathHttpDateCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathHttpDateCommand.ts new file mode 100644 index 0000000000000..e3569668433f2 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampPathHttpDateCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampPathHttpDateInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampPathHttpDate } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampPathHttpDateCommand}. + */ +export interface MalformedTimestampPathHttpDateCommandInput extends MalformedTimestampPathHttpDateInput {} +/** + * @public + * + * The output of {@link MalformedTimestampPathHttpDateCommand}. + */ +export interface MalformedTimestampPathHttpDateCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampPathHttpDateCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampPathHttpDateCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampPathHttpDateInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampPathHttpDateCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampPathHttpDateCommandInput - {@link MalformedTimestampPathHttpDateCommandInput} + * @returns {@link MalformedTimestampPathHttpDateCommandOutput} + * @see {@link MalformedTimestampPathHttpDateCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampPathHttpDateCommandOutput} 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 MalformedTimestampPathHttpDateCommand extends $Command + .classBuilder< + MalformedTimestampPathHttpDateCommandInput, + MalformedTimestampPathHttpDateCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampPathHttpDate", {}) + .n("RestJsonProtocolClient", "MalformedTimestampPathHttpDateCommand") + .f(void 0, void 0) + .sc(MalformedTimestampPathHttpDate) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampPathHttpDateInput; + output: {}; + }; + sdk: { + input: MalformedTimestampPathHttpDateCommandInput; + output: MalformedTimestampPathHttpDateCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryDefaultCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryDefaultCommand.ts new file mode 100644 index 0000000000000..64b5c1d6b572f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryDefaultCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampQueryDefaultInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampQueryDefault } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampQueryDefaultCommand}. + */ +export interface MalformedTimestampQueryDefaultCommandInput extends MalformedTimestampQueryDefaultInput {} +/** + * @public + * + * The output of {@link MalformedTimestampQueryDefaultCommand}. + */ +export interface MalformedTimestampQueryDefaultCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampQueryDefaultCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampQueryDefaultCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampQueryDefaultInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampQueryDefaultCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampQueryDefaultCommandInput - {@link MalformedTimestampQueryDefaultCommandInput} + * @returns {@link MalformedTimestampQueryDefaultCommandOutput} + * @see {@link MalformedTimestampQueryDefaultCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampQueryDefaultCommandOutput} 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 MalformedTimestampQueryDefaultCommand extends $Command + .classBuilder< + MalformedTimestampQueryDefaultCommandInput, + MalformedTimestampQueryDefaultCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampQueryDefault", {}) + .n("RestJsonProtocolClient", "MalformedTimestampQueryDefaultCommand") + .f(void 0, void 0) + .sc(MalformedTimestampQueryDefault) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampQueryDefaultInput; + output: {}; + }; + sdk: { + input: MalformedTimestampQueryDefaultCommandInput; + output: MalformedTimestampQueryDefaultCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryEpochCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryEpochCommand.ts new file mode 100644 index 0000000000000..5e5dab7e790e8 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryEpochCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampQueryEpochInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampQueryEpoch } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampQueryEpochCommand}. + */ +export interface MalformedTimestampQueryEpochCommandInput extends MalformedTimestampQueryEpochInput {} +/** + * @public + * + * The output of {@link MalformedTimestampQueryEpochCommand}. + */ +export interface MalformedTimestampQueryEpochCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampQueryEpochCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampQueryEpochCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampQueryEpochInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampQueryEpochCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampQueryEpochCommandInput - {@link MalformedTimestampQueryEpochCommandInput} + * @returns {@link MalformedTimestampQueryEpochCommandOutput} + * @see {@link MalformedTimestampQueryEpochCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampQueryEpochCommandOutput} 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 MalformedTimestampQueryEpochCommand extends $Command + .classBuilder< + MalformedTimestampQueryEpochCommandInput, + MalformedTimestampQueryEpochCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampQueryEpoch", {}) + .n("RestJsonProtocolClient", "MalformedTimestampQueryEpochCommand") + .f(void 0, void 0) + .sc(MalformedTimestampQueryEpoch) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampQueryEpochInput; + output: {}; + }; + sdk: { + input: MalformedTimestampQueryEpochCommandInput; + output: MalformedTimestampQueryEpochCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryHttpDateCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryHttpDateCommand.ts new file mode 100644 index 0000000000000..6c4b22bef10aa --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedTimestampQueryHttpDateCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedTimestampQueryHttpDateInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedTimestampQueryHttpDate } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedTimestampQueryHttpDateCommand}. + */ +export interface MalformedTimestampQueryHttpDateCommandInput extends MalformedTimestampQueryHttpDateInput {} +/** + * @public + * + * The output of {@link MalformedTimestampQueryHttpDateCommand}. + */ +export interface MalformedTimestampQueryHttpDateCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedTimestampQueryHttpDateCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedTimestampQueryHttpDateCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedTimestampQueryHttpDateInput + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new MalformedTimestampQueryHttpDateCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedTimestampQueryHttpDateCommandInput - {@link MalformedTimestampQueryHttpDateCommandInput} + * @returns {@link MalformedTimestampQueryHttpDateCommandOutput} + * @see {@link MalformedTimestampQueryHttpDateCommandInput} for command's `input` shape. + * @see {@link MalformedTimestampQueryHttpDateCommandOutput} 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 MalformedTimestampQueryHttpDateCommand extends $Command + .classBuilder< + MalformedTimestampQueryHttpDateCommandInput, + MalformedTimestampQueryHttpDateCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedTimestampQueryHttpDate", {}) + .n("RestJsonProtocolClient", "MalformedTimestampQueryHttpDateCommand") + .f(void 0, void 0) + .sc(MalformedTimestampQueryHttpDate) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedTimestampQueryHttpDateInput; + output: {}; + }; + sdk: { + input: MalformedTimestampQueryHttpDateCommandInput; + output: MalformedTimestampQueryHttpDateCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MalformedUnionCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MalformedUnionCommand.ts new file mode 100644 index 0000000000000..9e7a725145b79 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MalformedUnionCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MalformedUnionInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MalformedUnion } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MalformedUnionCommand}. + */ +export interface MalformedUnionCommandInput extends MalformedUnionInput {} +/** + * @public + * + * The output of {@link MalformedUnionCommand}. + */ +export interface MalformedUnionCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MalformedUnionCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MalformedUnionCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MalformedUnionInput + * union: { // SimpleUnion Union: only one key present + * int: Number("int"), + * string: "STRING_VALUE", + * }, + * }; + * const command = new MalformedUnionCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param MalformedUnionCommandInput - {@link MalformedUnionCommandInput} + * @returns {@link MalformedUnionCommandOutput} + * @see {@link MalformedUnionCommandInput} for command's `input` shape. + * @see {@link MalformedUnionCommandOutput} 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 MalformedUnionCommand extends $Command + .classBuilder< + MalformedUnionCommandInput, + MalformedUnionCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MalformedUnion", {}) + .n("RestJsonProtocolClient", "MalformedUnionCommand") + .f(void 0, void 0) + .sc(MalformedUnion) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MalformedUnionInput; + output: {}; + }; + sdk: { + input: MalformedUnionCommandInput; + output: MalformedUnionCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/MediaTypeHeaderCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/MediaTypeHeaderCommand.ts new file mode 100644 index 0000000000000..4da5c45d25b8c --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/MediaTypeHeaderCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { MediaTypeHeaderInput, MediaTypeHeaderOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { MediaTypeHeader } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link MediaTypeHeaderCommand}. + */ +export interface MediaTypeHeaderCommandInput extends MediaTypeHeaderInput {} +/** + * @public + * + * The output of {@link MediaTypeHeaderCommand}. + */ +export interface MediaTypeHeaderCommandOutput extends MediaTypeHeaderOutput, __MetadataBearer {} + +/** + * This example ensures that mediaType strings are base64 encoded in headers. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, MediaTypeHeaderCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, MediaTypeHeaderCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // MediaTypeHeaderInput + * json: "STRING_VALUE", + * }; + * const command = new MediaTypeHeaderCommand(input); + * const response = await client.send(command); + * // { // MediaTypeHeaderOutput + * // json: "STRING_VALUE", + * // }; + * + * ``` + * + * @param MediaTypeHeaderCommandInput - {@link MediaTypeHeaderCommandInput} + * @returns {@link MediaTypeHeaderCommandOutput} + * @see {@link MediaTypeHeaderCommandInput} for command's `input` shape. + * @see {@link MediaTypeHeaderCommandOutput} 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 MediaTypeHeaderCommand extends $Command + .classBuilder< + MediaTypeHeaderCommandInput, + MediaTypeHeaderCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "MediaTypeHeader", {}) + .n("RestJsonProtocolClient", "MediaTypeHeaderCommand") + .f(void 0, void 0) + .sc(MediaTypeHeader) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: MediaTypeHeaderInput; + output: MediaTypeHeaderOutput; + }; + sdk: { + input: MediaTypeHeaderCommandInput; + output: MediaTypeHeaderCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/NoInputAndNoOutputCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/NoInputAndNoOutputCommand.ts new file mode 100644 index 0000000000000..882d801033c8b --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/NoInputAndNoOutputCommand.ts @@ -0,0 +1,85 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { NoInputAndNoOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has no input or output. + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, NoInputAndNoOutputCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, NoInputAndNoOutputCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new NoInputAndNoOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndNoOutputCommandInput - {@link NoInputAndNoOutputCommandInput} + * @returns {@link NoInputAndNoOutputCommandOutput} + * @see {@link NoInputAndNoOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndNoOutputCommandOutput} 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 NoInputAndNoOutputCommand extends $Command + .classBuilder< + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "NoInputAndNoOutput", {}) + .n("RestJsonProtocolClient", "NoInputAndNoOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndNoOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndNoOutputCommandInput; + output: NoInputAndNoOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/NoInputAndOutputCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/NoInputAndOutputCommand.ts new file mode 100644 index 0000000000000..2bdea3c1a2b96 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/NoInputAndOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NoInputAndOutputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { NoInputAndOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandOutput extends NoInputAndOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has no input and the + * output is empty. While this should be rare, code generators must support + * this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, NoInputAndOutputCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, NoInputAndOutputCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new NoInputAndOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndOutputCommandInput - {@link NoInputAndOutputCommandInput} + * @returns {@link NoInputAndOutputCommandOutput} + * @see {@link NoInputAndOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndOutputCommandOutput} 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 NoInputAndOutputCommand extends $Command + .classBuilder< + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "NoInputAndOutput", {}) + .n("RestJsonProtocolClient", "NoInputAndOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndOutputCommandInput; + output: NoInputAndOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/NullAndEmptyHeadersClientCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/NullAndEmptyHeadersClientCommand.ts new file mode 100644 index 0000000000000..2ad1946a7f304 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/NullAndEmptyHeadersClientCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NullAndEmptyHeadersIO } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { NullAndEmptyHeadersClient } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NullAndEmptyHeadersClientCommand}. + */ +export interface NullAndEmptyHeadersClientCommandInput extends NullAndEmptyHeadersIO {} +/** + * @public + * + * The output of {@link NullAndEmptyHeadersClientCommand}. + */ +export interface NullAndEmptyHeadersClientCommandOutput extends NullAndEmptyHeadersIO, __MetadataBearer {} + +/** + * Null headers are not sent over the wire, empty headers are serialized to "" + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, NullAndEmptyHeadersClientCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, NullAndEmptyHeadersClientCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // NullAndEmptyHeadersIO + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * c: [ // StringList + * "STRING_VALUE", + * ], + * }; + * const command = new NullAndEmptyHeadersClientCommand(input); + * const response = await client.send(command); + * // { // NullAndEmptyHeadersIO + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // c: [ // StringList + * // "STRING_VALUE", + * // ], + * // }; + * + * ``` + * + * @param NullAndEmptyHeadersClientCommandInput - {@link NullAndEmptyHeadersClientCommandInput} + * @returns {@link NullAndEmptyHeadersClientCommandOutput} + * @see {@link NullAndEmptyHeadersClientCommandInput} for command's `input` shape. + * @see {@link NullAndEmptyHeadersClientCommandOutput} 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 NullAndEmptyHeadersClientCommand extends $Command + .classBuilder< + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "NullAndEmptyHeadersClient", {}) + .n("RestJsonProtocolClient", "NullAndEmptyHeadersClientCommand") + .f(void 0, void 0) + .sc(NullAndEmptyHeadersClient) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NullAndEmptyHeadersIO; + output: NullAndEmptyHeadersIO; + }; + sdk: { + input: NullAndEmptyHeadersClientCommandInput; + output: NullAndEmptyHeadersClientCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/NullAndEmptyHeadersServerCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/NullAndEmptyHeadersServerCommand.ts new file mode 100644 index 0000000000000..ec549a4fe418f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/NullAndEmptyHeadersServerCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NullAndEmptyHeadersIO } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { NullAndEmptyHeadersServer } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NullAndEmptyHeadersServerCommand}. + */ +export interface NullAndEmptyHeadersServerCommandInput extends NullAndEmptyHeadersIO {} +/** + * @public + * + * The output of {@link NullAndEmptyHeadersServerCommand}. + */ +export interface NullAndEmptyHeadersServerCommandOutput extends NullAndEmptyHeadersIO, __MetadataBearer {} + +/** + * Null headers are not sent over the wire, empty headers are serialized to "" + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, NullAndEmptyHeadersServerCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, NullAndEmptyHeadersServerCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // NullAndEmptyHeadersIO + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * c: [ // StringList + * "STRING_VALUE", + * ], + * }; + * const command = new NullAndEmptyHeadersServerCommand(input); + * const response = await client.send(command); + * // { // NullAndEmptyHeadersIO + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // c: [ // StringList + * // "STRING_VALUE", + * // ], + * // }; + * + * ``` + * + * @param NullAndEmptyHeadersServerCommandInput - {@link NullAndEmptyHeadersServerCommandInput} + * @returns {@link NullAndEmptyHeadersServerCommandOutput} + * @see {@link NullAndEmptyHeadersServerCommandInput} for command's `input` shape. + * @see {@link NullAndEmptyHeadersServerCommandOutput} 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 NullAndEmptyHeadersServerCommand extends $Command + .classBuilder< + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "NullAndEmptyHeadersServer", {}) + .n("RestJsonProtocolClient", "NullAndEmptyHeadersServerCommand") + .f(void 0, void 0) + .sc(NullAndEmptyHeadersServer) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NullAndEmptyHeadersIO; + output: NullAndEmptyHeadersIO; + }; + sdk: { + input: NullAndEmptyHeadersServerCommandInput; + output: NullAndEmptyHeadersServerCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/OmitsNullSerializesEmptyStringCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/OmitsNullSerializesEmptyStringCommand.ts new file mode 100644 index 0000000000000..b29a3575d0c0b --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/OmitsNullSerializesEmptyStringCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { OmitsNullSerializesEmptyStringInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { OmitsNullSerializesEmptyString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OmitsNullSerializesEmptyStringCommand}. + */ +export interface OmitsNullSerializesEmptyStringCommandInput extends OmitsNullSerializesEmptyStringInput {} +/** + * @public + * + * The output of {@link OmitsNullSerializesEmptyStringCommand}. + */ +export interface OmitsNullSerializesEmptyStringCommandOutput extends __MetadataBearer {} + +/** + * Omits null, but serializes empty string value. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OmitsNullSerializesEmptyStringCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, OmitsNullSerializesEmptyStringCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // OmitsNullSerializesEmptyStringInput + * nullValue: "STRING_VALUE", + * emptyString: "STRING_VALUE", + * }; + * const command = new OmitsNullSerializesEmptyStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param OmitsNullSerializesEmptyStringCommandInput - {@link OmitsNullSerializesEmptyStringCommandInput} + * @returns {@link OmitsNullSerializesEmptyStringCommandOutput} + * @see {@link OmitsNullSerializesEmptyStringCommandInput} for command's `input` shape. + * @see {@link OmitsNullSerializesEmptyStringCommandOutput} 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 OmitsNullSerializesEmptyStringCommand extends $Command + .classBuilder< + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "OmitsNullSerializesEmptyString", {}) + .n("RestJsonProtocolClient", "OmitsNullSerializesEmptyStringCommand") + .f(void 0, void 0) + .sc(OmitsNullSerializesEmptyString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OmitsNullSerializesEmptyStringInput; + output: {}; + }; + sdk: { + input: OmitsNullSerializesEmptyStringCommandInput; + output: OmitsNullSerializesEmptyStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/OmitsSerializingEmptyListsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/OmitsSerializingEmptyListsCommand.ts new file mode 100644 index 0000000000000..2db0924a99e3f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/OmitsSerializingEmptyListsCommand.ts @@ -0,0 +1,108 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { OmitsSerializingEmptyListsInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { OmitsSerializingEmptyLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OmitsSerializingEmptyListsCommand}. + */ +export interface OmitsSerializingEmptyListsCommandInput extends OmitsSerializingEmptyListsInput {} +/** + * @public + * + * The output of {@link OmitsSerializingEmptyListsCommand}. + */ +export interface OmitsSerializingEmptyListsCommandOutput extends __MetadataBearer {} + +/** + * Omits serializing empty lists. Because empty strings are serilized as + * `Foo=`, empty lists cannot also be serialized as `Foo=` and instead + * must be omitted. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OmitsSerializingEmptyListsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, OmitsSerializingEmptyListsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // OmitsSerializingEmptyListsInput + * queryStringList: [ // StringList + * "STRING_VALUE", + * ], + * queryIntegerList: [ // IntegerList + * Number("int"), + * ], + * queryDoubleList: [ // DoubleList + * Number("double"), + * ], + * queryBooleanList: [ // BooleanList + * true || false, + * ], + * queryTimestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * queryEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * queryIntegerEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * }; + * const command = new OmitsSerializingEmptyListsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param OmitsSerializingEmptyListsCommandInput - {@link OmitsSerializingEmptyListsCommandInput} + * @returns {@link OmitsSerializingEmptyListsCommandOutput} + * @see {@link OmitsSerializingEmptyListsCommandInput} for command's `input` shape. + * @see {@link OmitsSerializingEmptyListsCommandOutput} 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 OmitsSerializingEmptyListsCommand extends $Command + .classBuilder< + OmitsSerializingEmptyListsCommandInput, + OmitsSerializingEmptyListsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "OmitsSerializingEmptyLists", {}) + .n("RestJsonProtocolClient", "OmitsSerializingEmptyListsCommand") + .f(void 0, void 0) + .sc(OmitsSerializingEmptyLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OmitsSerializingEmptyListsInput; + output: {}; + }; + sdk: { + input: OmitsSerializingEmptyListsCommandInput; + output: OmitsSerializingEmptyListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/OperationWithDefaultsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/OperationWithDefaultsCommand.ts new file mode 100644 index 0000000000000..d0fe3ac610fb3 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/OperationWithDefaultsCommand.ts @@ -0,0 +1,157 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { OperationWithDefaultsInput, OperationWithDefaultsOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { OperationWithDefaults } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithDefaultsCommand}. + */ +export interface OperationWithDefaultsCommandInput extends OperationWithDefaultsInput {} +/** + * @public + * + * The output of {@link OperationWithDefaultsCommand}. + */ +export interface OperationWithDefaultsCommandOutput extends OperationWithDefaultsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OperationWithDefaultsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, OperationWithDefaultsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // OperationWithDefaultsInput + * defaults: { // Defaults + * defaultString: "STRING_VALUE", + * defaultBoolean: true || false, + * defaultList: [ // TestStringList + * "STRING_VALUE", + * ], + * defaultDocumentMap: "DOCUMENT_VALUE", + * defaultDocumentString: "DOCUMENT_VALUE", + * defaultDocumentBoolean: "DOCUMENT_VALUE", + * defaultDocumentList: "DOCUMENT_VALUE", + * defaultNullDocument: "DOCUMENT_VALUE", + * defaultTimestamp: new Date("TIMESTAMP"), + * defaultBlob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * defaultByte: 0, // BYTE_VALUE + * defaultShort: Number("short"), + * defaultInteger: Number("int"), + * defaultLong: Number("long"), + * defaultFloat: Number("float"), + * defaultDouble: Number("double"), + * defaultMap: { // TestStringMap + * "": "STRING_VALUE", + * }, + * defaultEnum: "FOO" || "BAR" || "BAZ", + * defaultIntEnum: 1 || 2, + * emptyString: "STRING_VALUE", + * falseBoolean: true || false, + * emptyBlob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * zeroByte: 0, // BYTE_VALUE + * zeroShort: Number("short"), + * zeroInteger: Number("int"), + * zeroLong: Number("long"), + * zeroFloat: Number("float"), + * zeroDouble: Number("double"), + * }, + * clientOptionalDefaults: { // ClientOptionalDefaults + * member: Number("int"), + * }, + * topLevelDefault: "STRING_VALUE", + * otherTopLevelDefault: Number("int"), + * }; + * const command = new OperationWithDefaultsCommand(input); + * const response = await client.send(command); + * // { // OperationWithDefaultsOutput + * // defaultString: "STRING_VALUE", + * // defaultBoolean: true || false, + * // defaultList: [ // TestStringList + * // "STRING_VALUE", + * // ], + * // defaultDocumentMap: "DOCUMENT_VALUE", + * // defaultDocumentString: "DOCUMENT_VALUE", + * // defaultDocumentBoolean: "DOCUMENT_VALUE", + * // defaultDocumentList: "DOCUMENT_VALUE", + * // defaultNullDocument: "DOCUMENT_VALUE", + * // defaultTimestamp: new Date("TIMESTAMP"), + * // defaultBlob: new Uint8Array(), + * // defaultByte: 0, // BYTE_VALUE + * // defaultShort: Number("short"), + * // defaultInteger: Number("int"), + * // defaultLong: Number("long"), + * // defaultFloat: Number("float"), + * // defaultDouble: Number("double"), + * // defaultMap: { // TestStringMap + * // "": "STRING_VALUE", + * // }, + * // defaultEnum: "FOO" || "BAR" || "BAZ", + * // defaultIntEnum: 1 || 2, + * // emptyString: "STRING_VALUE", + * // falseBoolean: true || false, + * // emptyBlob: new Uint8Array(), + * // zeroByte: 0, // BYTE_VALUE + * // zeroShort: Number("short"), + * // zeroInteger: Number("int"), + * // zeroLong: Number("long"), + * // zeroFloat: Number("float"), + * // zeroDouble: Number("double"), + * // }; + * + * ``` + * + * @param OperationWithDefaultsCommandInput - {@link OperationWithDefaultsCommandInput} + * @returns {@link OperationWithDefaultsCommandOutput} + * @see {@link OperationWithDefaultsCommandInput} for command's `input` shape. + * @see {@link OperationWithDefaultsCommandOutput} 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 OperationWithDefaultsCommand extends $Command + .classBuilder< + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "OperationWithDefaults", {}) + .n("RestJsonProtocolClient", "OperationWithDefaultsCommand") + .f(void 0, void 0) + .sc(OperationWithDefaults) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OperationWithDefaultsInput; + output: OperationWithDefaultsOutput; + }; + sdk: { + input: OperationWithDefaultsCommandInput; + output: OperationWithDefaultsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/OperationWithNestedStructureCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/OperationWithNestedStructureCommand.ts new file mode 100644 index 0000000000000..a897b564982a0 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/OperationWithNestedStructureCommand.ts @@ -0,0 +1,140 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { OperationWithNestedStructureInput, OperationWithNestedStructureOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { OperationWithNestedStructure } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithNestedStructureCommand}. + */ +export interface OperationWithNestedStructureCommandInput extends OperationWithNestedStructureInput {} +/** + * @public + * + * The output of {@link OperationWithNestedStructureCommand}. + */ +export interface OperationWithNestedStructureCommandOutput + extends OperationWithNestedStructureOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OperationWithNestedStructureCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, OperationWithNestedStructureCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // OperationWithNestedStructureInput + * topLevel: { // TopLevel + * dialog: { // Dialog + * language: "STRING_VALUE", + * greeting: "STRING_VALUE", + * farewell: { // Farewell + * phrase: "STRING_VALUE", + * }, + * }, + * dialogList: [ // DialogList + * { + * language: "STRING_VALUE", + * greeting: "STRING_VALUE", + * farewell: { + * phrase: "STRING_VALUE", + * }, + * }, + * ], + * dialogMap: { // DialogMap + * "": { + * language: "STRING_VALUE", + * greeting: "STRING_VALUE", + * farewell: { + * phrase: "STRING_VALUE", + * }, + * }, + * }, + * }, + * }; + * const command = new OperationWithNestedStructureCommand(input); + * const response = await client.send(command); + * // { // OperationWithNestedStructureOutput + * // dialog: { // Dialog + * // language: "STRING_VALUE", + * // greeting: "STRING_VALUE", + * // farewell: { // Farewell + * // phrase: "STRING_VALUE", + * // }, + * // }, + * // dialogList: [ // DialogList + * // { + * // language: "STRING_VALUE", + * // greeting: "STRING_VALUE", + * // farewell: { + * // phrase: "STRING_VALUE", + * // }, + * // }, + * // ], + * // dialogMap: { // DialogMap + * // "": { + * // 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 + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "OperationWithNestedStructure", {}) + .n("RestJsonProtocolClient", "OperationWithNestedStructureCommand") + .f(void 0, void 0) + .sc(OperationWithNestedStructure) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OperationWithNestedStructureInput; + output: OperationWithNestedStructureOutput; + }; + sdk: { + input: OperationWithNestedStructureCommandInput; + output: OperationWithNestedStructureCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/PostPlayerActionCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/PostPlayerActionCommand.ts new file mode 100644 index 0000000000000..37f44baf60efa --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/PostPlayerActionCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { PostPlayerActionInput, PostPlayerActionOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { PostPlayerAction } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PostPlayerActionCommand}. + */ +export interface PostPlayerActionCommandInput extends PostPlayerActionInput {} +/** + * @public + * + * The output of {@link PostPlayerActionCommand}. + */ +export interface PostPlayerActionCommandOutput extends PostPlayerActionOutput, __MetadataBearer {} + +/** + * This operation defines a union with a Unit member. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, PostPlayerActionCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, PostPlayerActionCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // PostPlayerActionInput + * action: { // PlayerAction Union: only one key present + * quit: {}, + * }, + * }; + * const command = new PostPlayerActionCommand(input); + * const response = await client.send(command); + * // { // PostPlayerActionOutput + * // action: { // PlayerAction Union: only one key present + * // quit: {}, + * // }, + * // }; + * + * ``` + * + * @param PostPlayerActionCommandInput - {@link PostPlayerActionCommandInput} + * @returns {@link PostPlayerActionCommandOutput} + * @see {@link PostPlayerActionCommandInput} for command's `input` shape. + * @see {@link PostPlayerActionCommandOutput} 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 PostPlayerActionCommand extends $Command + .classBuilder< + PostPlayerActionCommandInput, + PostPlayerActionCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "PostPlayerAction", {}) + .n("RestJsonProtocolClient", "PostPlayerActionCommand") + .f(void 0, void 0) + .sc(PostPlayerAction) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PostPlayerActionInput; + output: PostPlayerActionOutput; + }; + sdk: { + input: PostPlayerActionCommandInput; + output: PostPlayerActionCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/PostUnionWithJsonNameCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/PostUnionWithJsonNameCommand.ts new file mode 100644 index 0000000000000..d711efec02752 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/PostUnionWithJsonNameCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { PostUnionWithJsonNameInput, PostUnionWithJsonNameOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { PostUnionWithJsonName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PostUnionWithJsonNameCommand}. + */ +export interface PostUnionWithJsonNameCommandInput extends PostUnionWithJsonNameInput {} +/** + * @public + * + * The output of {@link PostUnionWithJsonNameCommand}. + */ +export interface PostUnionWithJsonNameCommandOutput extends PostUnionWithJsonNameOutput, __MetadataBearer {} + +/** + * This operation defines a union that uses jsonName on some members. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, PostUnionWithJsonNameCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, PostUnionWithJsonNameCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // PostUnionWithJsonNameInput + * value: { // UnionWithJsonName Union: only one key present + * foo: "STRING_VALUE", + * bar: "STRING_VALUE", + * baz: "STRING_VALUE", + * }, + * }; + * const command = new PostUnionWithJsonNameCommand(input); + * const response = await client.send(command); + * // { // PostUnionWithJsonNameOutput + * // value: { // UnionWithJsonName Union: only one key present + * // foo: "STRING_VALUE", + * // bar: "STRING_VALUE", + * // baz: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param PostUnionWithJsonNameCommandInput - {@link PostUnionWithJsonNameCommandInput} + * @returns {@link PostUnionWithJsonNameCommandOutput} + * @see {@link PostUnionWithJsonNameCommandInput} for command's `input` shape. + * @see {@link PostUnionWithJsonNameCommandOutput} 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 PostUnionWithJsonNameCommand extends $Command + .classBuilder< + PostUnionWithJsonNameCommandInput, + PostUnionWithJsonNameCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "PostUnionWithJsonName", {}) + .n("RestJsonProtocolClient", "PostUnionWithJsonNameCommand") + .f(void 0, void 0) + .sc(PostUnionWithJsonName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PostUnionWithJsonNameInput; + output: PostUnionWithJsonNameOutput; + }; + sdk: { + input: PostUnionWithJsonNameCommandInput; + output: PostUnionWithJsonNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/PutWithContentEncodingCommand.ts new file mode 100644 index 0000000000000..6950d9790b4cc --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/PutWithContentEncodingCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { PutWithContentEncodingInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { PutWithContentEncoding } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandInput extends PutWithContentEncodingInput {} +/** + * @public + * + * The output of {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, PutWithContentEncodingCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, PutWithContentEncodingCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // PutWithContentEncodingInput + * encoding: "STRING_VALUE", + * data: "STRING_VALUE", + * }; + * const command = new PutWithContentEncodingCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param PutWithContentEncodingCommandInput - {@link PutWithContentEncodingCommandInput} + * @returns {@link PutWithContentEncodingCommandOutput} + * @see {@link PutWithContentEncodingCommandInput} for command's `input` shape. + * @see {@link PutWithContentEncodingCommandOutput} 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 PutWithContentEncodingCommand extends $Command + .classBuilder< + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getCompressionPlugin(config, { + encodings: ["gzip"], + }), + ]; + }) + .s("RestJson", "PutWithContentEncoding", {}) + .n("RestJsonProtocolClient", "PutWithContentEncodingCommand") + .f(void 0, void 0) + .sc(PutWithContentEncoding) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutWithContentEncodingInput; + output: {}; + }; + sdk: { + input: PutWithContentEncodingCommandInput; + output: PutWithContentEncodingCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts new file mode 100644 index 0000000000000..8c55abef84335 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryIdempotencyTokenAutoFillInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { QueryIdempotencyTokenAutoFill } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandInput extends QueryIdempotencyTokenAutoFillInput {} +/** + * @public + * + * The output of {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandOutput extends __MetadataBearer {} + +/** + * Automatically adds idempotency tokens. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, QueryIdempotencyTokenAutoFillCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, QueryIdempotencyTokenAutoFillCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // QueryIdempotencyTokenAutoFillInput + * token: "STRING_VALUE", + * }; + * const command = new QueryIdempotencyTokenAutoFillCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryIdempotencyTokenAutoFillCommandInput - {@link QueryIdempotencyTokenAutoFillCommandInput} + * @returns {@link QueryIdempotencyTokenAutoFillCommandOutput} + * @see {@link QueryIdempotencyTokenAutoFillCommandInput} for command's `input` shape. + * @see {@link QueryIdempotencyTokenAutoFillCommandOutput} 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 QueryIdempotencyTokenAutoFillCommand extends $Command + .classBuilder< + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "QueryIdempotencyTokenAutoFill", {}) + .n("RestJsonProtocolClient", "QueryIdempotencyTokenAutoFillCommand") + .f(void 0, void 0) + .sc(QueryIdempotencyTokenAutoFill) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryIdempotencyTokenAutoFillInput; + output: {}; + }; + sdk: { + input: QueryIdempotencyTokenAutoFillCommandInput; + output: QueryIdempotencyTokenAutoFillCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/QueryParamsAsStringListMapCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/QueryParamsAsStringListMapCommand.ts new file mode 100644 index 0000000000000..1d37242c72f03 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/QueryParamsAsStringListMapCommand.ts @@ -0,0 +1,91 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryParamsAsStringListMapInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { QueryParamsAsStringListMap } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryParamsAsStringListMapCommand}. + */ +export interface QueryParamsAsStringListMapCommandInput extends QueryParamsAsStringListMapInput {} +/** + * @public + * + * The output of {@link QueryParamsAsStringListMapCommand}. + */ +export interface QueryParamsAsStringListMapCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, QueryParamsAsStringListMapCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, QueryParamsAsStringListMapCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // QueryParamsAsStringListMapInput + * qux: "STRING_VALUE", + * foo: { // StringListMap + * "": [ // StringList + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new QueryParamsAsStringListMapCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryParamsAsStringListMapCommandInput - {@link QueryParamsAsStringListMapCommandInput} + * @returns {@link QueryParamsAsStringListMapCommandOutput} + * @see {@link QueryParamsAsStringListMapCommandInput} for command's `input` shape. + * @see {@link QueryParamsAsStringListMapCommandOutput} 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 QueryParamsAsStringListMapCommand extends $Command + .classBuilder< + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "QueryParamsAsStringListMap", {}) + .n("RestJsonProtocolClient", "QueryParamsAsStringListMapCommand") + .f(void 0, void 0) + .sc(QueryParamsAsStringListMap) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryParamsAsStringListMapInput; + output: {}; + }; + sdk: { + input: QueryParamsAsStringListMapCommandInput; + output: QueryParamsAsStringListMapCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/QueryPrecedenceCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/QueryPrecedenceCommand.ts new file mode 100644 index 0000000000000..2108dbf139873 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/QueryPrecedenceCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryPrecedenceInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { QueryPrecedence } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryPrecedenceCommand}. + */ +export interface QueryPrecedenceCommandInput extends QueryPrecedenceInput {} +/** + * @public + * + * The output of {@link QueryPrecedenceCommand}. + */ +export interface QueryPrecedenceCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, QueryPrecedenceCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, QueryPrecedenceCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // QueryPrecedenceInput + * foo: "STRING_VALUE", + * baz: { // StringMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new QueryPrecedenceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryPrecedenceCommandInput - {@link QueryPrecedenceCommandInput} + * @returns {@link QueryPrecedenceCommandOutput} + * @see {@link QueryPrecedenceCommandInput} for command's `input` shape. + * @see {@link QueryPrecedenceCommandOutput} 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 QueryPrecedenceCommand extends $Command + .classBuilder< + QueryPrecedenceCommandInput, + QueryPrecedenceCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "QueryPrecedence", {}) + .n("RestJsonProtocolClient", "QueryPrecedenceCommand") + .f(void 0, void 0) + .sc(QueryPrecedence) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryPrecedenceInput; + output: {}; + }; + sdk: { + input: QueryPrecedenceCommandInput; + output: QueryPrecedenceCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/RecursiveShapesCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/RecursiveShapesCommand.ts new file mode 100644 index 0000000000000..7cbf928d4cdfc --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/RecursiveShapesCommand.ts @@ -0,0 +1,112 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RecursiveShapesInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { RecursiveShapes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RecursiveShapesCommand}. + */ +export interface RecursiveShapesCommandInput extends RecursiveShapesInputOutput {} +/** + * @public + * + * The output of {@link RecursiveShapesCommand}. + */ +export interface RecursiveShapesCommandOutput extends RecursiveShapesInputOutput, __MetadataBearer {} + +/** + * Recursive shapes + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, RecursiveShapesCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, RecursiveShapesCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // RecursiveShapesInputOutput + * nested: { // RecursiveShapesInputOutputNested1 + * foo: "STRING_VALUE", + * nested: { // RecursiveShapesInputOutputNested2 + * bar: "STRING_VALUE", + * recursiveMember: { + * foo: "STRING_VALUE", + * nested: { + * bar: "STRING_VALUE", + * recursiveMember: "", + * }, + * }, + * }, + * }, + * }; + * const command = new RecursiveShapesCommand(input); + * const response = await client.send(command); + * // { // RecursiveShapesInputOutput + * // nested: { // RecursiveShapesInputOutputNested1 + * // foo: "STRING_VALUE", + * // nested: { // RecursiveShapesInputOutputNested2 + * // bar: "STRING_VALUE", + * // recursiveMember: { + * // foo: "STRING_VALUE", + * // nested: { + * // bar: "STRING_VALUE", + * // recursiveMember: "", + * // }, + * // }, + * // }, + * // }, + * // }; + * + * ``` + * + * @param RecursiveShapesCommandInput - {@link RecursiveShapesCommandInput} + * @returns {@link RecursiveShapesCommandOutput} + * @see {@link RecursiveShapesCommandInput} for command's `input` shape. + * @see {@link RecursiveShapesCommandOutput} 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 RecursiveShapesCommand extends $Command + .classBuilder< + RecursiveShapesCommandInput, + RecursiveShapesCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "RecursiveShapes", {}) + .n("RestJsonProtocolClient", "RecursiveShapesCommand") + .f(void 0, void 0) + .sc(RecursiveShapes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: RecursiveShapesInputOutput; + output: RecursiveShapesInputOutput; + }; + sdk: { + input: RecursiveShapesCommandInput; + output: RecursiveShapesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/ResponseCodeHttpFallbackCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/ResponseCodeHttpFallbackCommand.ts new file mode 100644 index 0000000000000..6763d39a9c06f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/ResponseCodeHttpFallbackCommand.ts @@ -0,0 +1,84 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ResponseCodeHttpFallbackInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { ResponseCodeHttpFallback } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ResponseCodeHttpFallbackCommand}. + */ +export interface ResponseCodeHttpFallbackCommandInput extends ResponseCodeHttpFallbackInputOutput {} +/** + * @public + * + * The output of {@link ResponseCodeHttpFallbackCommand}. + */ +export interface ResponseCodeHttpFallbackCommandOutput extends ResponseCodeHttpFallbackInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, ResponseCodeHttpFallbackCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, ResponseCodeHttpFallbackCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new ResponseCodeHttpFallbackCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ResponseCodeHttpFallbackCommandInput - {@link ResponseCodeHttpFallbackCommandInput} + * @returns {@link ResponseCodeHttpFallbackCommandOutput} + * @see {@link ResponseCodeHttpFallbackCommandInput} for command's `input` shape. + * @see {@link ResponseCodeHttpFallbackCommandOutput} 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 ResponseCodeHttpFallbackCommand extends $Command + .classBuilder< + ResponseCodeHttpFallbackCommandInput, + ResponseCodeHttpFallbackCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "ResponseCodeHttpFallback", {}) + .n("RestJsonProtocolClient", "ResponseCodeHttpFallbackCommand") + .f(void 0, void 0) + .sc(ResponseCodeHttpFallback) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: ResponseCodeHttpFallbackCommandInput; + output: ResponseCodeHttpFallbackCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/ResponseCodeRequiredCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/ResponseCodeRequiredCommand.ts new file mode 100644 index 0000000000000..8ac97b19eb903 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/ResponseCodeRequiredCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ResponseCodeRequiredOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { ResponseCodeRequired } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ResponseCodeRequiredCommand}. + */ +export interface ResponseCodeRequiredCommandInput {} +/** + * @public + * + * The output of {@link ResponseCodeRequiredCommand}. + */ +export interface ResponseCodeRequiredCommandOutput extends ResponseCodeRequiredOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, ResponseCodeRequiredCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, ResponseCodeRequiredCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new ResponseCodeRequiredCommand(input); + * const response = await client.send(command); + * // { // ResponseCodeRequiredOutput + * // responseCode: Number("int"), // required + * // }; + * + * ``` + * + * @param ResponseCodeRequiredCommandInput - {@link ResponseCodeRequiredCommandInput} + * @returns {@link ResponseCodeRequiredCommandOutput} + * @see {@link ResponseCodeRequiredCommandInput} for command's `input` shape. + * @see {@link ResponseCodeRequiredCommandOutput} 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 ResponseCodeRequiredCommand extends $Command + .classBuilder< + ResponseCodeRequiredCommandInput, + ResponseCodeRequiredCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "ResponseCodeRequired", {}) + .n("RestJsonProtocolClient", "ResponseCodeRequiredCommand") + .f(void 0, void 0) + .sc(ResponseCodeRequired) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: ResponseCodeRequiredOutput; + }; + sdk: { + input: ResponseCodeRequiredCommandInput; + output: ResponseCodeRequiredCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/SimpleScalarPropertiesCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/SimpleScalarPropertiesCommand.ts new file mode 100644 index 0000000000000..5b0fdb1fa32e4 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/SimpleScalarPropertiesCommand.ts @@ -0,0 +1,106 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleScalarPropertiesInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { SimpleScalarProperties } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandInput extends SimpleScalarPropertiesInputOutput {} +/** + * @public + * + * The output of {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandOutput extends SimpleScalarPropertiesInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, SimpleScalarPropertiesCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, SimpleScalarPropertiesCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // SimpleScalarPropertiesInputOutput + * foo: "STRING_VALUE", + * stringValue: "STRING_VALUE", + * trueBooleanValue: true || false, + * falseBooleanValue: true || false, + * byteValue: 0, // BYTE_VALUE + * shortValue: Number("short"), + * integerValue: Number("int"), + * longValue: Number("long"), + * floatValue: Number("float"), + * doubleValue: Number("double"), + * }; + * const command = new SimpleScalarPropertiesCommand(input); + * const response = await client.send(command); + * // { // SimpleScalarPropertiesInputOutput + * // foo: "STRING_VALUE", + * // stringValue: "STRING_VALUE", + * // trueBooleanValue: true || false, + * // falseBooleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }; + * + * ``` + * + * @param SimpleScalarPropertiesCommandInput - {@link SimpleScalarPropertiesCommandInput} + * @returns {@link SimpleScalarPropertiesCommandOutput} + * @see {@link SimpleScalarPropertiesCommandInput} for command's `input` shape. + * @see {@link SimpleScalarPropertiesCommandOutput} 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 SimpleScalarPropertiesCommand extends $Command + .classBuilder< + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "SimpleScalarProperties", {}) + .n("RestJsonProtocolClient", "SimpleScalarPropertiesCommand") + .f(void 0, void 0) + .sc(SimpleScalarProperties) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleScalarPropertiesInputOutput; + output: SimpleScalarPropertiesInputOutput; + }; + sdk: { + input: SimpleScalarPropertiesCommandInput; + output: SimpleScalarPropertiesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/SparseJsonListsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/SparseJsonListsCommand.ts new file mode 100644 index 0000000000000..984ab52b96eda --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/SparseJsonListsCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SparseJsonListsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { SparseJsonLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SparseJsonListsCommand}. + */ +export interface SparseJsonListsCommandInput extends SparseJsonListsInputOutput {} +/** + * @public + * + * The output of {@link SparseJsonListsCommand}. + */ +export interface SparseJsonListsCommandOutput extends SparseJsonListsInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, SparseJsonListsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, SparseJsonListsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // SparseJsonListsInputOutput + * sparseStringList: [ // SparseStringList + * "STRING_VALUE", + * ], + * sparseShortList: [ // SparseShortList + * Number("short"), + * ], + * }; + * const command = new SparseJsonListsCommand(input); + * const response = await client.send(command); + * // { // SparseJsonListsInputOutput + * // sparseStringList: [ // SparseStringList + * // "STRING_VALUE", + * // ], + * // sparseShortList: [ // SparseShortList + * // Number("short"), + * // ], + * // }; + * + * ``` + * + * @param SparseJsonListsCommandInput - {@link SparseJsonListsCommandInput} + * @returns {@link SparseJsonListsCommandOutput} + * @see {@link SparseJsonListsCommandInput} for command's `input` shape. + * @see {@link SparseJsonListsCommandOutput} 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 SparseJsonListsCommand extends $Command + .classBuilder< + SparseJsonListsCommandInput, + SparseJsonListsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "SparseJsonLists", {}) + .n("RestJsonProtocolClient", "SparseJsonListsCommand") + .f(void 0, void 0) + .sc(SparseJsonLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SparseJsonListsInputOutput; + output: SparseJsonListsInputOutput; + }; + sdk: { + input: SparseJsonListsCommandInput; + output: SparseJsonListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/SparseJsonMapsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/SparseJsonMapsCommand.ts new file mode 100644 index 0000000000000..736cb7de7850d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/SparseJsonMapsCommand.ts @@ -0,0 +1,124 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SparseJsonMapsInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { SparseJsonMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SparseJsonMapsCommand}. + */ +export interface SparseJsonMapsCommandInput extends SparseJsonMapsInputOutput {} +/** + * @public + * + * The output of {@link SparseJsonMapsCommand}. + */ +export interface SparseJsonMapsCommandOutput extends SparseJsonMapsInputOutput, __MetadataBearer {} + +/** + * This example tests sparse map serialization. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, SparseJsonMapsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, SparseJsonMapsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // SparseJsonMapsInputOutput + * sparseStructMap: { // SparseStructMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * sparseNumberMap: { // SparseNumberMap + * "": Number("int"), + * }, + * sparseBooleanMap: { // SparseBooleanMap + * "": true || false, + * }, + * sparseStringMap: { // SparseStringMap + * "": "STRING_VALUE", + * }, + * sparseSetMap: { // SparseSetMap + * "": [ // StringSet + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new SparseJsonMapsCommand(input); + * const response = await client.send(command); + * // { // SparseJsonMapsInputOutput + * // sparseStructMap: { // SparseStructMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // sparseNumberMap: { // SparseNumberMap + * // "": Number("int"), + * // }, + * // sparseBooleanMap: { // SparseBooleanMap + * // "": true || false, + * // }, + * // sparseStringMap: { // SparseStringMap + * // "": "STRING_VALUE", + * // }, + * // sparseSetMap: { // SparseSetMap + * // "": [ // StringSet + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param SparseJsonMapsCommandInput - {@link SparseJsonMapsCommandInput} + * @returns {@link SparseJsonMapsCommandOutput} + * @see {@link SparseJsonMapsCommandInput} for command's `input` shape. + * @see {@link SparseJsonMapsCommandOutput} 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 SparseJsonMapsCommand extends $Command + .classBuilder< + SparseJsonMapsCommandInput, + SparseJsonMapsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "SparseJsonMaps", {}) + .n("RestJsonProtocolClient", "SparseJsonMapsCommand") + .f(void 0, void 0) + .sc(SparseJsonMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SparseJsonMapsInputOutput; + output: SparseJsonMapsInputOutput; + }; + sdk: { + input: SparseJsonMapsCommandInput; + output: SparseJsonMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsCommand.ts new file mode 100644 index 0000000000000..89584b24f9dcb --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsCommand.ts @@ -0,0 +1,107 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + MetadataBearer as __MetadataBearer, + StreamingBlobPayloadInputTypes, + StreamingBlobPayloadOutputTypes, +} from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { StreamingTraitsInputOutput, StreamingTraitsInputOutputFilterSensitiveLog } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { StreamingTraits } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link StreamingTraitsCommand}. + */ +export interface StreamingTraitsCommandInput extends Omit { + blob?: StreamingBlobPayloadInputTypes; +} + +/** + * @public + * + * The output of {@link StreamingTraitsCommand}. + */ +export interface StreamingTraitsCommandOutput extends Omit, __MetadataBearer { + blob?: StreamingBlobPayloadOutputTypes; +} + +/** + * This examples serializes a streaming blob shape in the request body. + * + * In this example, no JSON document is synthesized because the payload is + * not a structure or a union type. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, StreamingTraitsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, StreamingTraitsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // StreamingTraitsInputOutput + * foo: "STRING_VALUE", + * blob: "MULTIPLE_TYPES_ACCEPTED", // see \@smithy/types -> StreamingBlobPayloadInputTypes + * }; + * const command = new StreamingTraitsCommand(input); + * const response = await client.send(command); + * // consume or destroy the stream to free the socket. + * const bytes = await response.blob.transformToByteArray(); + * // const str = await response.blob.transformToString(); + * // response.blob.destroy(); // only applicable to Node.js Readable streams. + * + * // { // StreamingTraitsInputOutput + * // foo: "STRING_VALUE", + * // blob: "", // see \@smithy/types -> StreamingBlobPayloadOutputTypes + * // }; + * + * ``` + * + * @param StreamingTraitsCommandInput - {@link StreamingTraitsCommandInput} + * @returns {@link StreamingTraitsCommandOutput} + * @see {@link StreamingTraitsCommandInput} for command's `input` shape. + * @see {@link StreamingTraitsCommandOutput} 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 StreamingTraitsCommand extends $Command + .classBuilder< + StreamingTraitsCommandInput, + StreamingTraitsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "StreamingTraits", {}) + .n("RestJsonProtocolClient", "StreamingTraitsCommand") + .f(StreamingTraitsInputOutputFilterSensitiveLog, StreamingTraitsInputOutputFilterSensitiveLog) + .sc(StreamingTraits) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: StreamingTraitsInputOutput; + output: StreamingTraitsInputOutput; + }; + sdk: { + input: StreamingTraitsCommandInput; + output: StreamingTraitsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsRequireLengthCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsRequireLengthCommand.ts new file mode 100644 index 0000000000000..e7f8440be75e2 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsRequireLengthCommand.ts @@ -0,0 +1,97 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer, StreamingBlobPayloadInputTypes } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + StreamingTraitsRequireLengthInput, + StreamingTraitsRequireLengthInputFilterSensitiveLog, +} from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { StreamingTraitsRequireLength } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link StreamingTraitsRequireLengthCommand}. + */ +export interface StreamingTraitsRequireLengthCommandInput extends Omit { + blob?: StreamingBlobPayloadInputTypes; +} + +/** + * @public + * + * The output of {@link StreamingTraitsRequireLengthCommand}. + */ +export interface StreamingTraitsRequireLengthCommandOutput extends __MetadataBearer {} + +/** + * This examples serializes a streaming blob shape with a required content + * length in the request body. + * + * In this example, no JSON document is synthesized because the payload is + * not a structure or a union type. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, StreamingTraitsRequireLengthCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, StreamingTraitsRequireLengthCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // StreamingTraitsRequireLengthInput + * foo: "STRING_VALUE", + * blob: "MULTIPLE_TYPES_ACCEPTED", // see \@smithy/types -> StreamingBlobPayloadInputTypes + * }; + * const command = new StreamingTraitsRequireLengthCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param StreamingTraitsRequireLengthCommandInput - {@link StreamingTraitsRequireLengthCommandInput} + * @returns {@link StreamingTraitsRequireLengthCommandOutput} + * @see {@link StreamingTraitsRequireLengthCommandInput} for command's `input` shape. + * @see {@link StreamingTraitsRequireLengthCommandOutput} 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 StreamingTraitsRequireLengthCommand extends $Command + .classBuilder< + StreamingTraitsRequireLengthCommandInput, + StreamingTraitsRequireLengthCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "StreamingTraitsRequireLength", {}) + .n("RestJsonProtocolClient", "StreamingTraitsRequireLengthCommand") + .f(StreamingTraitsRequireLengthInputFilterSensitiveLog, void 0) + .sc(StreamingTraitsRequireLength) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: StreamingTraitsRequireLengthInput; + output: {}; + }; + sdk: { + input: StreamingTraitsRequireLengthCommandInput; + output: StreamingTraitsRequireLengthCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsWithMediaTypeCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsWithMediaTypeCommand.ts new file mode 100644 index 0000000000000..b519af6ad6ebf --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/StreamingTraitsWithMediaTypeCommand.ts @@ -0,0 +1,116 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + MetadataBearer as __MetadataBearer, + StreamingBlobPayloadInputTypes, + StreamingBlobPayloadOutputTypes, +} from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + StreamingTraitsWithMediaTypeInputOutput, + StreamingTraitsWithMediaTypeInputOutputFilterSensitiveLog, +} from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { StreamingTraitsWithMediaType } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link StreamingTraitsWithMediaTypeCommand}. + */ +export interface StreamingTraitsWithMediaTypeCommandInput + extends Omit { + blob?: StreamingBlobPayloadInputTypes; +} + +/** + * @public + * + * The output of {@link StreamingTraitsWithMediaTypeCommand}. + */ +export interface StreamingTraitsWithMediaTypeCommandOutput + extends Omit, + __MetadataBearer { + blob?: StreamingBlobPayloadOutputTypes; +} + +/** + * This examples serializes a streaming media-typed blob shape in the request body. + * + * This examples uses a `@mediaType` trait on the payload to force a custom + * content-type to be serialized. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, StreamingTraitsWithMediaTypeCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, StreamingTraitsWithMediaTypeCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // StreamingTraitsWithMediaTypeInputOutput + * foo: "STRING_VALUE", + * blob: "MULTIPLE_TYPES_ACCEPTED", // see \@smithy/types -> StreamingBlobPayloadInputTypes + * }; + * const command = new StreamingTraitsWithMediaTypeCommand(input); + * const response = await client.send(command); + * // consume or destroy the stream to free the socket. + * const bytes = await response.blob.transformToByteArray(); + * // const str = await response.blob.transformToString(); + * // response.blob.destroy(); // only applicable to Node.js Readable streams. + * + * // { // StreamingTraitsWithMediaTypeInputOutput + * // foo: "STRING_VALUE", + * // blob: "", // see \@smithy/types -> StreamingBlobPayloadOutputTypes + * // }; + * + * ``` + * + * @param StreamingTraitsWithMediaTypeCommandInput - {@link StreamingTraitsWithMediaTypeCommandInput} + * @returns {@link StreamingTraitsWithMediaTypeCommandOutput} + * @see {@link StreamingTraitsWithMediaTypeCommandInput} for command's `input` shape. + * @see {@link StreamingTraitsWithMediaTypeCommandOutput} 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 StreamingTraitsWithMediaTypeCommand extends $Command + .classBuilder< + StreamingTraitsWithMediaTypeCommandInput, + StreamingTraitsWithMediaTypeCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "StreamingTraitsWithMediaType", {}) + .n("RestJsonProtocolClient", "StreamingTraitsWithMediaTypeCommand") + .f( + StreamingTraitsWithMediaTypeInputOutputFilterSensitiveLog, + StreamingTraitsWithMediaTypeInputOutputFilterSensitiveLog + ) + .sc(StreamingTraitsWithMediaType) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: StreamingTraitsWithMediaTypeInputOutput; + output: StreamingTraitsWithMediaTypeInputOutput; + }; + sdk: { + input: StreamingTraitsWithMediaTypeCommandInput; + output: StreamingTraitsWithMediaTypeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TestBodyStructureCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TestBodyStructureCommand.ts new file mode 100644 index 0000000000000..c5bbff97b285c --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TestBodyStructureCommand.ts @@ -0,0 +1,99 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TestBodyStructureInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TestBodyStructure } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TestBodyStructureCommand}. + */ +export interface TestBodyStructureCommandInput extends TestBodyStructureInputOutput {} +/** + * @public + * + * The output of {@link TestBodyStructureCommand}. + */ +export interface TestBodyStructureCommandOutput extends TestBodyStructureInputOutput, __MetadataBearer {} + +/** + * This example operation serializes a structure in the HTTP body. + * + * It should ensure Content-Type: application/json is + * used in all requests and that an "empty" body is + * an empty JSON document (\{\}). + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, TestBodyStructureCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TestBodyStructureCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // TestBodyStructureInputOutput + * testId: "STRING_VALUE", + * testConfig: { // TestConfig + * timeout: Number("int"), + * }, + * }; + * const command = new TestBodyStructureCommand(input); + * const response = await client.send(command); + * // { // TestBodyStructureInputOutput + * // testId: "STRING_VALUE", + * // testConfig: { // TestConfig + * // timeout: Number("int"), + * // }, + * // }; + * + * ``` + * + * @param TestBodyStructureCommandInput - {@link TestBodyStructureCommandInput} + * @returns {@link TestBodyStructureCommandOutput} + * @see {@link TestBodyStructureCommandInput} for command's `input` shape. + * @see {@link TestBodyStructureCommandOutput} 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 TestBodyStructureCommand extends $Command + .classBuilder< + TestBodyStructureCommandInput, + TestBodyStructureCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TestBodyStructure", {}) + .n("RestJsonProtocolClient", "TestBodyStructureCommand") + .f(void 0, void 0) + .sc(TestBodyStructure) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TestBodyStructureInputOutput; + output: TestBodyStructureInputOutput; + }; + sdk: { + input: TestBodyStructureCommandInput; + output: TestBodyStructureCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TestGetNoInputNoPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TestGetNoInputNoPayloadCommand.ts new file mode 100644 index 0000000000000..4b67ca01e6eed --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TestGetNoInputNoPayloadCommand.ts @@ -0,0 +1,91 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TestNoPayloadInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TestGetNoInputNoPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TestGetNoInputNoPayloadCommand}. + */ +export interface TestGetNoInputNoPayloadCommandInput {} +/** + * @public + * + * The output of {@link TestGetNoInputNoPayloadCommand}. + */ +export interface TestGetNoInputNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {} + +/** + * This example GET operation has no input and serializes a request without a 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, TestGetNoInputNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TestGetNoInputNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new TestGetNoInputNoPayloadCommand(input); + * const response = await client.send(command); + * // { // TestNoPayloadInputOutput + * // testId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param TestGetNoInputNoPayloadCommandInput - {@link TestGetNoInputNoPayloadCommandInput} + * @returns {@link TestGetNoInputNoPayloadCommandOutput} + * @see {@link TestGetNoInputNoPayloadCommandInput} for command's `input` shape. + * @see {@link TestGetNoInputNoPayloadCommandOutput} 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 TestGetNoInputNoPayloadCommand extends $Command + .classBuilder< + TestGetNoInputNoPayloadCommandInput, + TestGetNoInputNoPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TestGetNoInputNoPayload", {}) + .n("RestJsonProtocolClient", "TestGetNoInputNoPayloadCommand") + .f(void 0, void 0) + .sc(TestGetNoInputNoPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: TestNoPayloadInputOutput; + }; + sdk: { + input: TestGetNoInputNoPayloadCommandInput; + output: TestGetNoInputNoPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TestGetNoPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TestGetNoPayloadCommand.ts new file mode 100644 index 0000000000000..dcb8ad5d5a0b7 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TestGetNoPayloadCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TestNoPayloadInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TestGetNoPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TestGetNoPayloadCommand}. + */ +export interface TestGetNoPayloadCommandInput extends TestNoPayloadInputOutput {} +/** + * @public + * + * The output of {@link TestGetNoPayloadCommand}. + */ +export interface TestGetNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {} + +/** + * This example GET operation serializes a request without a modeled 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, TestGetNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TestGetNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // TestNoPayloadInputOutput + * testId: "STRING_VALUE", + * }; + * const command = new TestGetNoPayloadCommand(input); + * const response = await client.send(command); + * // { // TestNoPayloadInputOutput + * // testId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param TestGetNoPayloadCommandInput - {@link TestGetNoPayloadCommandInput} + * @returns {@link TestGetNoPayloadCommandOutput} + * @see {@link TestGetNoPayloadCommandInput} for command's `input` shape. + * @see {@link TestGetNoPayloadCommandOutput} 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 TestGetNoPayloadCommand extends $Command + .classBuilder< + TestGetNoPayloadCommandInput, + TestGetNoPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TestGetNoPayload", {}) + .n("RestJsonProtocolClient", "TestGetNoPayloadCommand") + .f(void 0, void 0) + .sc(TestGetNoPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TestNoPayloadInputOutput; + output: TestNoPayloadInputOutput; + }; + sdk: { + input: TestGetNoPayloadCommandInput; + output: TestGetNoPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TestPayloadBlobCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TestPayloadBlobCommand.ts new file mode 100644 index 0000000000000..3a1f5ad6eeeeb --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TestPayloadBlobCommand.ts @@ -0,0 +1,112 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { BlobPayloadInputTypes, MetadataBearer as __MetadataBearer } from "@smithy/types"; +import { Uint8ArrayBlobAdapter } from "@smithy/util-stream"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TestPayloadBlobInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TestPayloadBlob } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + */ +export type TestPayloadBlobCommandInputType = Omit & { + data?: BlobPayloadInputTypes; +}; + +/** + * @public + * + * The input for {@link TestPayloadBlobCommand}. + */ +export interface TestPayloadBlobCommandInput extends TestPayloadBlobCommandInputType {} +/** + * @public + */ +export type TestPayloadBlobCommandOutputType = Omit & { + data?: Uint8ArrayBlobAdapter; +}; + +/** + * @public + * + * The output of {@link TestPayloadBlobCommand}. + */ +export interface TestPayloadBlobCommandOutput extends TestPayloadBlobCommandOutputType, __MetadataBearer {} + +/** + * This example operation serializes a payload targeting a blob. + * + * The Blob shape is not structured content and we cannot + * make assumptions about what data will be sent. This test ensures + * only a generic "Content-Type: application/octet-stream" header + * is used, and that we are not treating an empty body as an + * empty JSON document. + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, TestPayloadBlobCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TestPayloadBlobCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // TestPayloadBlobInputOutput + * contentType: "STRING_VALUE", + * data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new TestPayloadBlobCommand(input); + * const response = await client.send(command); + * // { // TestPayloadBlobInputOutput + * // contentType: "STRING_VALUE", + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param TestPayloadBlobCommandInput - {@link TestPayloadBlobCommandInput} + * @returns {@link TestPayloadBlobCommandOutput} + * @see {@link TestPayloadBlobCommandInput} for command's `input` shape. + * @see {@link TestPayloadBlobCommandOutput} 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 TestPayloadBlobCommand extends $Command + .classBuilder< + TestPayloadBlobCommandInput, + TestPayloadBlobCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TestPayloadBlob", {}) + .n("RestJsonProtocolClient", "TestPayloadBlobCommand") + .f(void 0, void 0) + .sc(TestPayloadBlob) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TestPayloadBlobInputOutput; + output: TestPayloadBlobInputOutput; + }; + sdk: { + input: TestPayloadBlobCommandInput; + output: TestPayloadBlobCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TestPayloadStructureCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TestPayloadStructureCommand.ts new file mode 100644 index 0000000000000..685ce1c867e0f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TestPayloadStructureCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TestPayloadStructureInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TestPayloadStructure } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TestPayloadStructureCommand}. + */ +export interface TestPayloadStructureCommandInput extends TestPayloadStructureInputOutput {} +/** + * @public + * + * The output of {@link TestPayloadStructureCommand}. + */ +export interface TestPayloadStructureCommandOutput extends TestPayloadStructureInputOutput, __MetadataBearer {} + +/** + * This example operation serializes a payload targeting a structure. + * + * This enforces the same requirements as TestBodyStructure + * but with the body specified by the @httpPayload trait. + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, TestPayloadStructureCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TestPayloadStructureCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // TestPayloadStructureInputOutput + * testId: "STRING_VALUE", + * payloadConfig: { // PayloadConfig + * data: Number("int"), + * }, + * }; + * const command = new TestPayloadStructureCommand(input); + * const response = await client.send(command); + * // { // TestPayloadStructureInputOutput + * // testId: "STRING_VALUE", + * // payloadConfig: { // PayloadConfig + * // data: Number("int"), + * // }, + * // }; + * + * ``` + * + * @param TestPayloadStructureCommandInput - {@link TestPayloadStructureCommandInput} + * @returns {@link TestPayloadStructureCommandOutput} + * @see {@link TestPayloadStructureCommandInput} for command's `input` shape. + * @see {@link TestPayloadStructureCommandOutput} 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 TestPayloadStructureCommand extends $Command + .classBuilder< + TestPayloadStructureCommandInput, + TestPayloadStructureCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TestPayloadStructure", {}) + .n("RestJsonProtocolClient", "TestPayloadStructureCommand") + .f(void 0, void 0) + .sc(TestPayloadStructure) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TestPayloadStructureInputOutput; + output: TestPayloadStructureInputOutput; + }; + sdk: { + input: TestPayloadStructureCommandInput; + output: TestPayloadStructureCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TestPostNoInputNoPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TestPostNoInputNoPayloadCommand.ts new file mode 100644 index 0000000000000..2499778b62e64 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TestPostNoInputNoPayloadCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TestNoPayloadInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TestPostNoInputNoPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TestPostNoInputNoPayloadCommand}. + */ +export interface TestPostNoInputNoPayloadCommandInput {} +/** + * @public + * + * The output of {@link TestPostNoInputNoPayloadCommand}. + */ +export interface TestPostNoInputNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {} + +/** + * This example POST operation has no input and serializes a request without a HTTP body. + * + * These tests are to ensure we do not attach a body or related headers + * (Content-Type) to a POST operation with no modeled input. + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, TestPostNoInputNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TestPostNoInputNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new TestPostNoInputNoPayloadCommand(input); + * const response = await client.send(command); + * // { // TestNoPayloadInputOutput + * // testId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param TestPostNoInputNoPayloadCommandInput - {@link TestPostNoInputNoPayloadCommandInput} + * @returns {@link TestPostNoInputNoPayloadCommandOutput} + * @see {@link TestPostNoInputNoPayloadCommandInput} for command's `input` shape. + * @see {@link TestPostNoInputNoPayloadCommandOutput} 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 TestPostNoInputNoPayloadCommand extends $Command + .classBuilder< + TestPostNoInputNoPayloadCommandInput, + TestPostNoInputNoPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TestPostNoInputNoPayload", {}) + .n("RestJsonProtocolClient", "TestPostNoInputNoPayloadCommand") + .f(void 0, void 0) + .sc(TestPostNoInputNoPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: TestNoPayloadInputOutput; + }; + sdk: { + input: TestPostNoInputNoPayloadCommandInput; + output: TestPostNoInputNoPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TestPostNoPayloadCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TestPostNoPayloadCommand.ts new file mode 100644 index 0000000000000..fd092dfff2764 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TestPostNoPayloadCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TestNoPayloadInputOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TestPostNoPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TestPostNoPayloadCommand}. + */ +export interface TestPostNoPayloadCommandInput extends TestNoPayloadInputOutput {} +/** + * @public + * + * The output of {@link TestPostNoPayloadCommand}. + */ +export interface TestPostNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {} + +/** + * This example POST operation serializes a request without a modeled HTTP body. + * + * These tests are to ensure we do not attach a body or related headers + * (Content-Type) to a POST operation with no modeled payload. + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, TestPostNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TestPostNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // TestNoPayloadInputOutput + * testId: "STRING_VALUE", + * }; + * const command = new TestPostNoPayloadCommand(input); + * const response = await client.send(command); + * // { // TestNoPayloadInputOutput + * // testId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param TestPostNoPayloadCommandInput - {@link TestPostNoPayloadCommandInput} + * @returns {@link TestPostNoPayloadCommandOutput} + * @see {@link TestPostNoPayloadCommandInput} for command's `input` shape. + * @see {@link TestPostNoPayloadCommandOutput} 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 TestPostNoPayloadCommand extends $Command + .classBuilder< + TestPostNoPayloadCommandInput, + TestPostNoPayloadCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TestPostNoPayload", {}) + .n("RestJsonProtocolClient", "TestPostNoPayloadCommand") + .f(void 0, void 0) + .sc(TestPostNoPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TestNoPayloadInputOutput; + output: TestNoPayloadInputOutput; + }; + sdk: { + input: TestPostNoPayloadCommandInput; + output: TestPostNoPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/TimestampFormatHeadersCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/TimestampFormatHeadersCommand.ts new file mode 100644 index 0000000000000..c9503e917c489 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/TimestampFormatHeadersCommand.ts @@ -0,0 +1,100 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TimestampFormatHeadersIO } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { TimestampFormatHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TimestampFormatHeadersCommand}. + */ +export interface TimestampFormatHeadersCommandInput extends TimestampFormatHeadersIO {} +/** + * @public + * + * The output of {@link TimestampFormatHeadersCommand}. + */ +export interface TimestampFormatHeadersCommandOutput extends TimestampFormatHeadersIO, __MetadataBearer {} + +/** + * This example tests how timestamp request and response headers are serialized. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, TimestampFormatHeadersCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, TimestampFormatHeadersCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = { // TimestampFormatHeadersIO + * memberEpochSeconds: new Date("TIMESTAMP"), + * memberHttpDate: new Date("TIMESTAMP"), + * memberDateTime: new Date("TIMESTAMP"), + * defaultFormat: new Date("TIMESTAMP"), + * targetEpochSeconds: new Date("TIMESTAMP"), + * targetHttpDate: new Date("TIMESTAMP"), + * targetDateTime: new Date("TIMESTAMP"), + * }; + * const command = new TimestampFormatHeadersCommand(input); + * const response = await client.send(command); + * // { // TimestampFormatHeadersIO + * // memberEpochSeconds: new Date("TIMESTAMP"), + * // memberHttpDate: new Date("TIMESTAMP"), + * // memberDateTime: new Date("TIMESTAMP"), + * // defaultFormat: new Date("TIMESTAMP"), + * // targetEpochSeconds: new Date("TIMESTAMP"), + * // targetHttpDate: new Date("TIMESTAMP"), + * // targetDateTime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param TimestampFormatHeadersCommandInput - {@link TimestampFormatHeadersCommandInput} + * @returns {@link TimestampFormatHeadersCommandOutput} + * @see {@link TimestampFormatHeadersCommandInput} for command's `input` shape. + * @see {@link TimestampFormatHeadersCommandOutput} 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 TimestampFormatHeadersCommand extends $Command + .classBuilder< + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "TimestampFormatHeaders", {}) + .n("RestJsonProtocolClient", "TimestampFormatHeadersCommand") + .f(void 0, void 0) + .sc(TimestampFormatHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TimestampFormatHeadersIO; + output: TimestampFormatHeadersIO; + }; + sdk: { + input: TimestampFormatHeadersCommandInput; + output: TimestampFormatHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/UnitInputAndOutputCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/UnitInputAndOutputCommand.ts new file mode 100644 index 0000000000000..c4b4a10f66ea9 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/UnitInputAndOutputCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { UnitInputAndOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UnitInputAndOutputCommand}. + */ +export interface UnitInputAndOutputCommandInput {} +/** + * @public + * + * The output of {@link UnitInputAndOutputCommand}. + */ +export interface UnitInputAndOutputCommandOutput extends __MetadataBearer {} + +/** + * This test is similar to NoInputAndNoOutput, but uses explicit Unit types. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, UnitInputAndOutputCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, UnitInputAndOutputCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new UnitInputAndOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UnitInputAndOutputCommandInput - {@link UnitInputAndOutputCommandInput} + * @returns {@link UnitInputAndOutputCommandOutput} + * @see {@link UnitInputAndOutputCommandInput} for command's `input` shape. + * @see {@link UnitInputAndOutputCommandOutput} 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 UnitInputAndOutputCommand extends $Command + .classBuilder< + UnitInputAndOutputCommandInput, + UnitInputAndOutputCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "UnitInputAndOutput", {}) + .n("RestJsonProtocolClient", "UnitInputAndOutputCommand") + .f(void 0, void 0) + .sc(UnitInputAndOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: UnitInputAndOutputCommandInput; + output: UnitInputAndOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/index.ts b/private/aws-protocoltests-restjson-schema/src/commands/index.ts new file mode 100644 index 0000000000000..f7eda19004821 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/index.ts @@ -0,0 +1,106 @@ +// smithy-typescript generated code +export * from "./AllQueryStringTypesCommand"; +export * from "./ConstantAndVariableQueryStringCommand"; +export * from "./ConstantQueryStringCommand"; +export * from "./ContentTypeParametersCommand"; +export * from "./DatetimeOffsetsCommand"; +export * from "./DocumentTypeAsMapValueCommand"; +export * from "./DocumentTypeAsPayloadCommand"; +export * from "./DocumentTypeCommand"; +export * from "./EmptyInputAndEmptyOutputCommand"; +export * from "./EndpointOperationCommand"; +export * from "./EndpointWithHostLabelOperationCommand"; +export * from "./FractionalSecondsCommand"; +export * from "./GreetingWithErrorsCommand"; +export * from "./HostWithPathOperationCommand"; +export * from "./HttpChecksumRequiredCommand"; +export * from "./HttpEmptyPrefixHeadersCommand"; +export * from "./HttpEnumPayloadCommand"; +export * from "./HttpPayloadTraitsCommand"; +export * from "./HttpPayloadTraitsWithMediaTypeCommand"; +export * from "./HttpPayloadWithStructureCommand"; +export * from "./HttpPayloadWithUnionCommand"; +export * from "./HttpPrefixHeadersCommand"; +export * from "./HttpPrefixHeadersInResponseCommand"; +export * from "./HttpRequestWithFloatLabelsCommand"; +export * from "./HttpRequestWithGreedyLabelInPathCommand"; +export * from "./HttpRequestWithLabelsAndTimestampFormatCommand"; +export * from "./HttpRequestWithLabelsCommand"; +export * from "./HttpRequestWithRegexLiteralCommand"; +export * from "./HttpResponseCodeCommand"; +export * from "./HttpStringPayloadCommand"; +export * from "./IgnoreQueryParamsInResponseCommand"; +export * from "./InputAndOutputWithHeadersCommand"; +export * from "./JsonBlobsCommand"; +export * from "./JsonEnumsCommand"; +export * from "./JsonIntEnumsCommand"; +export * from "./JsonListsCommand"; +export * from "./JsonMapsCommand"; +export * from "./JsonTimestampsCommand"; +export * from "./JsonUnionsCommand"; +export * from "./MalformedAcceptWithBodyCommand"; +export * from "./MalformedAcceptWithGenericStringCommand"; +export * from "./MalformedAcceptWithPayloadCommand"; +export * from "./MalformedBlobCommand"; +export * from "./MalformedBooleanCommand"; +export * from "./MalformedByteCommand"; +export * from "./MalformedContentTypeWithBodyCommand"; +export * from "./MalformedContentTypeWithGenericStringCommand"; +export * from "./MalformedContentTypeWithPayloadCommand"; +export * from "./MalformedContentTypeWithoutBodyCommand"; +export * from "./MalformedContentTypeWithoutBodyEmptyInputCommand"; +export * from "./MalformedDoubleCommand"; +export * from "./MalformedFloatCommand"; +export * from "./MalformedIntegerCommand"; +export * from "./MalformedListCommand"; +export * from "./MalformedLongCommand"; +export * from "./MalformedMapCommand"; +export * from "./MalformedRequestBodyCommand"; +export * from "./MalformedShortCommand"; +export * from "./MalformedStringCommand"; +export * from "./MalformedTimestampBodyDateTimeCommand"; +export * from "./MalformedTimestampBodyDefaultCommand"; +export * from "./MalformedTimestampBodyHttpDateCommand"; +export * from "./MalformedTimestampHeaderDateTimeCommand"; +export * from "./MalformedTimestampHeaderDefaultCommand"; +export * from "./MalformedTimestampHeaderEpochCommand"; +export * from "./MalformedTimestampPathDefaultCommand"; +export * from "./MalformedTimestampPathEpochCommand"; +export * from "./MalformedTimestampPathHttpDateCommand"; +export * from "./MalformedTimestampQueryDefaultCommand"; +export * from "./MalformedTimestampQueryEpochCommand"; +export * from "./MalformedTimestampQueryHttpDateCommand"; +export * from "./MalformedUnionCommand"; +export * from "./MediaTypeHeaderCommand"; +export * from "./NoInputAndNoOutputCommand"; +export * from "./NoInputAndOutputCommand"; +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"; +export * from "./QueryIdempotencyTokenAutoFillCommand"; +export * from "./QueryParamsAsStringListMapCommand"; +export * from "./QueryPrecedenceCommand"; +export * from "./RecursiveShapesCommand"; +export * from "./ResponseCodeHttpFallbackCommand"; +export * from "./ResponseCodeRequiredCommand"; +export * from "./SimpleScalarPropertiesCommand"; +export * from "./SparseJsonListsCommand"; +export * from "./SparseJsonMapsCommand"; +export * from "./StreamingTraitsCommand"; +export * from "./StreamingTraitsRequireLengthCommand"; +export * from "./StreamingTraitsWithMediaTypeCommand"; +export * from "./TestBodyStructureCommand"; +export * from "./TestGetNoInputNoPayloadCommand"; +export * from "./TestGetNoPayloadCommand"; +export * from "./TestPayloadBlobCommand"; +export * from "./TestPayloadStructureCommand"; +export * from "./TestPostNoInputNoPayloadCommand"; +export * from "./TestPostNoPayloadCommand"; +export * from "./TimestampFormatHeadersCommand"; +export * from "./UnitInputAndOutputCommand"; diff --git a/private/aws-protocoltests-restjson-schema/src/endpoint/EndpointParameters.ts b/private/aws-protocoltests-restjson-schema/src/endpoint/EndpointParameters.ts new file mode 100644 index 0000000000000..c2008082bf339 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/endpoint/EndpointParameters.ts @@ -0,0 +1,29 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return Object.assign(options, { + defaultSigningName: "restjson", + }); +}; + +export const commonParams = { + endpoint: { type: "builtInParams", name: "endpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + endpoint?: string; +} diff --git a/private/aws-protocoltests-restjson-schema/src/endpoint/endpointResolver.ts b/private/aws-protocoltests-restjson-schema/src/endpoint/endpointResolver.ts new file mode 100644 index 0000000000000..8bb222967df85 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["endpoint"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/private/aws-protocoltests-restjson-schema/src/endpoint/ruleset.ts b/private/aws-protocoltests-restjson-schema/src/endpoint/ruleset.ts new file mode 100644 index 0000000000000..14416a50b2697 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/endpoint/ruleset.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { RuleSetObject } from "@smithy/types"; + +export const ruleSet: RuleSetObject = { + version: "1.0", + parameters: { + endpoint: { + type: "string", + builtIn: "SDK::Endpoint", + documentation: "Endpoint used for making requests. Should be formatted as a URI.", + }, + }, + rules: [ + { + conditions: [ + { + fn: "isSet", + argv: [ + { + ref: "endpoint", + }, + ], + }, + ], + endpoint: { + url: { + ref: "endpoint", + }, + }, + type: "endpoint", + }, + { + conditions: [], + error: "(default endpointRuleSet) endpoint is not set - you must configure an endpoint.", + type: "error", + }, + ], +}; diff --git a/private/aws-protocoltests-restjson-schema/src/extensionConfiguration.ts b/private/aws-protocoltests-restjson-schema/src/extensionConfiguration.ts new file mode 100644 index 0000000000000..c6f06b73c692a --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface RestJsonProtocolExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/private/aws-protocoltests-restjson-schema/src/index.ts b/private/aws-protocoltests-restjson-schema/src/index.ts new file mode 100644 index 0000000000000..c1eb6c803d967 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/index.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + * A REST JSON service that sends JSON requests and responses. + * + * @packageDocumentation + */ +export * from "./RestJsonProtocolClient"; +export * from "./RestJsonProtocol"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { RestJsonProtocolExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { RestJsonProtocolServiceException } from "./models/RestJsonProtocolServiceException"; diff --git a/private/aws-protocoltests-restjson-schema/src/models/RestJsonProtocolServiceException.ts b/private/aws-protocoltests-restjson-schema/src/models/RestJsonProtocolServiceException.ts new file mode 100644 index 0000000000000..b107bd85b4928 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/models/RestJsonProtocolServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from RestJsonProtocol service. + */ +export class RestJsonProtocolServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, RestJsonProtocolServiceException.prototype); + } +} diff --git a/private/aws-protocoltests-restjson-schema/src/models/index.ts b/private/aws-protocoltests-restjson-schema/src/models/index.ts new file mode 100644 index 0000000000000..9eaceb12865f8 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/private/aws-protocoltests-restjson-schema/src/models/models_0.ts b/private/aws-protocoltests-restjson-schema/src/models/models_0.ts new file mode 100644 index 0000000000000..fd6778ad51ae6 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/models/models_0.ts @@ -0,0 +1,1585 @@ +// smithy-typescript generated code +import { + AutomaticJsonStringConversion as __AutomaticJsonStringConversion, + ExceptionOptionType as __ExceptionOptionType, +} from "@smithy/smithy-client"; +import { DocumentType as __DocumentType, StreamingBlobTypes } from "@smithy/types"; + +import { RestJsonProtocolServiceException as __BaseException } from "./RestJsonProtocolServiceException"; + +/** + * @public + */ +export interface GreetingStruct { + hi?: string | undefined; +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} + +/** + * @public + */ +export interface AllQueryStringTypesInput { + queryString?: string | undefined; + queryStringList?: string[] | undefined; + queryStringSet?: string[] | undefined; + queryByte?: number | undefined; + queryShort?: number | undefined; + queryInteger?: number | undefined; + queryIntegerList?: number[] | undefined; + queryIntegerSet?: number[] | undefined; + queryLong?: number | undefined; + queryFloat?: number | undefined; + queryDouble?: number | undefined; + queryDoubleList?: number[] | undefined; + queryBoolean?: boolean | undefined; + queryBooleanList?: boolean[] | undefined; + queryTimestamp?: Date | undefined; + queryTimestampList?: Date[] | undefined; + queryEnum?: FooEnum | undefined; + queryEnumList?: FooEnum[] | undefined; + queryIntegerEnum?: IntegerEnum | undefined; + queryIntegerEnumList?: IntegerEnum[] | undefined; + queryParamsMapOfStringList?: Record | undefined; +} + +/** + * @public + */ +export interface ClientOptionalDefaults { + member?: number | undefined; +} + +/** + * @public + */ +export interface ComplexNestedErrorData { + Foo?: string | undefined; +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name: "ComplexError" = "ComplexError"; + readonly $fault: "client" = "client"; + Header?: string | undefined; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.Header = opts.Header; + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * @public + */ +export interface ConstantAndVariableQueryStringInput { + baz?: string | undefined; + maybeSet?: string | undefined; +} + +/** + * @public + */ +export interface ConstantQueryStringInput { + hello: string | undefined; +} + +/** + * @public + */ +export interface ContentTypeParametersInput { + value?: number | undefined; +} + +/** + * @public + */ +export interface ContentTypeParametersOutput {} + +/** + * @public + */ +export interface DatetimeOffsetsOutput { + datetime?: Date | undefined; +} + +/** + * @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 | undefined; + defaultBoolean?: boolean | undefined; + defaultList?: string[] | undefined; + defaultDocumentMap?: __DocumentType | undefined; + defaultDocumentString?: __DocumentType | undefined; + defaultDocumentBoolean?: __DocumentType | undefined; + defaultDocumentList?: __DocumentType | undefined; + defaultNullDocument?: __DocumentType | undefined; + defaultTimestamp?: Date | undefined; + defaultBlob?: Uint8Array | undefined; + defaultByte?: number | undefined; + defaultShort?: number | undefined; + defaultInteger?: number | undefined; + defaultLong?: number | undefined; + defaultFloat?: number | undefined; + defaultDouble?: number | undefined; + defaultMap?: Record | undefined; + defaultEnum?: TestEnum | undefined; + defaultIntEnum?: TestIntEnum | undefined; + emptyString?: string | undefined; + falseBoolean?: boolean | undefined; + emptyBlob?: Uint8Array | undefined; + zeroByte?: number | undefined; + zeroShort?: number | undefined; + zeroInteger?: number | undefined; + zeroLong?: number | undefined; + zeroFloat?: number | undefined; + zeroDouble?: number | undefined; +} + +/** + * @public + */ +export interface Farewell { + phrase?: string | undefined; +} + +/** + * @public + */ +export interface Dialog { + language?: string | undefined; + greeting?: string | undefined; + farewell?: Farewell | undefined; +} + +/** + * @public + */ +export interface DocumentTypeInputOutput { + stringValue?: string | undefined; + documentValue?: __DocumentType | undefined; +} + +/** + * @public + */ +export interface DocumentTypeAsMapValueInputOutput { + docValuedMap?: Record | undefined; +} + +/** + * @public + */ +export interface DocumentTypeAsPayloadInputOutput { + documentValue?: __DocumentType | undefined; +} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputInput {} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputOutput {} + +/** + * @public + */ +export interface HostLabelInput { + label: string | undefined; +} + +/** + * @public + * @enum + */ +export const StringEnum = { + V: "enumvalue", +} as const; +/** + * @public + */ +export type StringEnum = (typeof StringEnum)[keyof typeof StringEnum]; + +/** + * @public + */ +export interface EnumPayloadInput { + payload?: StringEnum | undefined; +} + +/** + * This error has test cases that test some of the dark corners of Amazon service + * framework history. It should only be implemented by clients. + * @public + */ +export class FooError extends __BaseException { + readonly name: "FooError" = "FooError"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "FooError", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, FooError.prototype); + } +} + +/** + * @public + */ +export interface FractionalSecondsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface GreetingWithErrorsOutput { + greeting?: string | undefined; +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name: "InvalidGreeting" = "InvalidGreeting"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface HttpChecksumRequiredInputOutput { + foo?: string | undefined; +} + +/** + * @public + */ +export interface HttpEmptyPrefixHeadersInput { + prefixHeaders?: Record | undefined; + specificHeader?: string | undefined; +} + +/** + * @public + */ +export interface HttpEmptyPrefixHeadersOutput { + prefixHeaders?: Record | undefined; + specificHeader?: string | undefined; +} + +/** + * @public + */ +export interface HttpPayloadTraitsInputOutput { + foo?: string | undefined; + blob?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface HttpPayloadTraitsWithMediaTypeInputOutput { + foo?: string | undefined; + blob?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface NestedPayload { + greeting?: string | undefined; + name?: string | undefined; +} + +/** + * @public + */ +export interface HttpPayloadWithStructureInputOutput { + nested?: NestedPayload | undefined; +} + +/** + * @public + */ +export type UnionPayload = UnionPayload.GreetingMember | UnionPayload.$UnknownMember; + +/** + * @public + */ +export namespace UnionPayload { + export interface GreetingMember { + greeting: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + greeting?: never; + $unknown: [string, any]; + } + + export interface Visitor { + greeting: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: UnionPayload, visitor: Visitor): T => { + if (value.greeting !== undefined) return visitor.greeting(value.greeting); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface HttpPayloadWithUnionInputOutput { + nested?: UnionPayload | undefined; +} + +/** + * @public + */ +export interface HttpPrefixHeadersInput { + foo?: string | undefined; + fooMap?: Record | undefined; +} + +/** + * @public + */ +export interface HttpPrefixHeadersOutput { + foo?: string | undefined; + fooMap?: Record | undefined; +} + +/** + * @public + */ +export interface HttpPrefixHeadersInResponseInput {} + +/** + * @public + */ +export interface HttpPrefixHeadersInResponseOutput { + prefixHeaders?: Record | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithFloatLabelsInput { + float: number | undefined; + double: number | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithGreedyLabelInPathInput { + foo: string | undefined; + baz: string | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithLabelsInput { + string: string | undefined; + short: number | undefined; + integer: number | undefined; + long: number | undefined; + float: number | undefined; + double: number | undefined; + /** + * Serialized in the path as true or false. + * @public + */ + boolean: boolean | undefined; + + /** + * Note that this member has no format, so it's serialized as an RFC 3399 date-time. + * @public + */ + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithLabelsAndTimestampFormatInput { + memberEpochSeconds: Date | undefined; + memberHttpDate: Date | undefined; + memberDateTime: Date | undefined; + defaultFormat: Date | undefined; + targetEpochSeconds: Date | undefined; + targetHttpDate: Date | undefined; + targetDateTime: Date | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithRegexLiteralInput { + str: string | undefined; +} + +/** + * @public + */ +export interface HttpResponseCodeOutput { + Status?: number | undefined; +} + +/** + * @public + */ +export interface StringPayloadInput { + payload?: string | undefined; +} + +/** + * @public + */ +export interface IgnoreQueryParamsInResponseOutput { + baz?: string | undefined; +} + +/** + * @public + */ +export interface InputAndOutputWithHeadersIO { + headerString?: string | undefined; + headerByte?: number | undefined; + headerShort?: number | undefined; + headerInteger?: number | undefined; + headerLong?: number | undefined; + headerFloat?: number | undefined; + headerDouble?: number | undefined; + headerTrueBool?: boolean | undefined; + headerFalseBool?: boolean | undefined; + headerStringList?: string[] | undefined; + headerStringSet?: string[] | undefined; + headerIntegerList?: number[] | undefined; + headerBooleanList?: boolean[] | undefined; + headerTimestampList?: Date[] | undefined; + headerEnum?: FooEnum | undefined; + headerEnumList?: FooEnum[] | undefined; + headerIntegerEnum?: IntegerEnum | undefined; + headerIntegerEnumList?: IntegerEnum[] | undefined; +} + +/** + * @public + */ +export interface JsonBlobsInputOutput { + data?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface JsonEnumsInputOutput { + fooEnum1?: FooEnum | undefined; + fooEnum2?: FooEnum | undefined; + fooEnum3?: FooEnum | undefined; + fooEnumList?: FooEnum[] | undefined; + fooEnumSet?: FooEnum[] | undefined; + fooEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface JsonIntEnumsInputOutput { + integerEnum1?: IntegerEnum | undefined; + integerEnum2?: IntegerEnum | undefined; + integerEnum3?: IntegerEnum | undefined; + integerEnumList?: IntegerEnum[] | undefined; + integerEnumSet?: IntegerEnum[] | undefined; + integerEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface StructureListMember { + a?: string | undefined; + b?: string | undefined; +} + +/** + * @public + */ +export interface JsonListsInputOutput { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + structureList?: StructureListMember[] | undefined; +} + +/** + * @public + */ +export interface JsonMapsInputOutput { + denseStructMap?: Record | undefined; + denseNumberMap?: Record | undefined; + denseBooleanMap?: Record | undefined; + denseStringMap?: Record | undefined; + denseSetMap?: Record | undefined; +} + +/** + * @public + */ +export interface JsonTimestampsInputOutput { + normal?: Date | undefined; + dateTime?: Date | undefined; + dateTimeOnTarget?: Date | undefined; + epochSeconds?: Date | undefined; + epochSecondsOnTarget?: Date | undefined; + httpDate?: Date | undefined; + httpDateOnTarget?: Date | undefined; +} + +/** + * @public + */ +export interface RenamedGreeting { + salutation?: string | undefined; +} + +/** + * A union with a representative set of types for members. + * @public + */ +export type MyUnion = + | MyUnion.BlobValueMember + | MyUnion.BooleanValueMember + | MyUnion.EnumValueMember + | MyUnion.ListValueMember + | MyUnion.MapValueMember + | MyUnion.NumberValueMember + | MyUnion.RenamedStructureValueMember + | MyUnion.StringValueMember + | MyUnion.StructureValueMember + | MyUnion.TimestampValueMember + | MyUnion.$UnknownMember; + +/** + * @public + */ +export namespace MyUnion { + export interface StringValueMember { + stringValue: string; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface BooleanValueMember { + stringValue?: never; + booleanValue: boolean; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface NumberValueMember { + stringValue?: never; + booleanValue?: never; + numberValue: number; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface BlobValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue: Uint8Array; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface TimestampValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue: Date; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface EnumValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue: FooEnum; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface ListValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue: string[]; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface MapValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue: Record; + structureValue?: never; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface StructureValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue: GreetingStruct; + renamedStructureValue?: never; + $unknown?: never; + } + + export interface RenamedStructureValueMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue: RenamedGreeting; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + stringValue?: never; + booleanValue?: never; + numberValue?: never; + blobValue?: never; + timestampValue?: never; + enumValue?: never; + listValue?: never; + mapValue?: never; + structureValue?: never; + renamedStructureValue?: never; + $unknown: [string, any]; + } + + export interface Visitor { + stringValue: (value: string) => T; + booleanValue: (value: boolean) => T; + numberValue: (value: number) => T; + blobValue: (value: Uint8Array) => T; + timestampValue: (value: Date) => T; + enumValue: (value: FooEnum) => T; + listValue: (value: string[]) => T; + mapValue: (value: Record) => T; + structureValue: (value: GreetingStruct) => T; + renamedStructureValue: (value: RenamedGreeting) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: MyUnion, visitor: Visitor): T => { + if (value.stringValue !== undefined) return visitor.stringValue(value.stringValue); + if (value.booleanValue !== undefined) return visitor.booleanValue(value.booleanValue); + if (value.numberValue !== undefined) return visitor.numberValue(value.numberValue); + if (value.blobValue !== undefined) return visitor.blobValue(value.blobValue); + if (value.timestampValue !== undefined) return visitor.timestampValue(value.timestampValue); + if (value.enumValue !== undefined) return visitor.enumValue(value.enumValue); + if (value.listValue !== undefined) return visitor.listValue(value.listValue); + if (value.mapValue !== undefined) return visitor.mapValue(value.mapValue); + if (value.structureValue !== undefined) return visitor.structureValue(value.structureValue); + if (value.renamedStructureValue !== undefined) return visitor.renamedStructureValue(value.renamedStructureValue); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * A shared structure that contains a single union member. + * @public + */ +export interface UnionInputOutput { + /** + * A union with a representative set of types for members. + * @public + */ + contents?: MyUnion | undefined; +} + +/** + * @public + */ +export interface MalformedAcceptWithGenericStringOutput { + payload?: string | undefined; +} + +/** + * @public + */ +export interface MalformedAcceptWithPayloadOutput { + payload?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface MalformedBlobInput { + blob?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface MalformedBooleanInput { + booleanInBody?: boolean | undefined; + booleanInPath: boolean | undefined; + booleanInQuery?: boolean | undefined; + booleanInHeader?: boolean | undefined; +} + +/** + * @public + */ +export interface MalformedByteInput { + byteInBody?: number | undefined; + byteInPath: number | undefined; + byteInQuery?: number | undefined; + byteInHeader?: number | undefined; +} + +/** + * @public + */ +export interface MalformedContentTypeWithGenericStringInput { + payload?: string | undefined; +} + +/** + * @public + */ +export interface MalformedContentTypeWithoutBodyEmptyInputInput { + header?: string | undefined; +} + +/** + * @public + */ +export interface MalformedContentTypeWithPayloadInput { + payload?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface MalformedDoubleInput { + doubleInBody?: number | undefined; + doubleInPath: number | undefined; + doubleInQuery?: number | undefined; + doubleInHeader?: number | undefined; +} + +/** + * @public + */ +export interface MalformedFloatInput { + floatInBody?: number | undefined; + floatInPath: number | undefined; + floatInQuery?: number | undefined; + floatInHeader?: number | undefined; +} + +/** + * @public + */ +export interface MalformedIntegerInput { + integerInBody?: number | undefined; + integerInPath: number | undefined; + integerInQuery?: number | undefined; + integerInHeader?: number | undefined; +} + +/** + * @public + */ +export interface MalformedListInput { + bodyList?: string[] | undefined; +} + +/** + * @public + */ +export interface MalformedLongInput { + longInBody?: number | undefined; + longInPath: number | undefined; + longInQuery?: number | undefined; + longInHeader?: number | undefined; +} + +/** + * @public + */ +export interface MalformedMapInput { + bodyMap?: Record | undefined; +} + +/** + * @public + */ +export interface MalformedRequestBodyInput { + int?: number | undefined; + float?: number | undefined; +} + +/** + * @public + */ +export interface MalformedShortInput { + shortInBody?: number | undefined; + shortInPath: number | undefined; + shortInQuery?: number | undefined; + shortInHeader?: number | undefined; +} + +/** + * @public + */ +export interface MalformedStringInput { + blob?: __AutomaticJsonStringConversion | string | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampBodyDateTimeInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampBodyDefaultInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampBodyHttpDateInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampHeaderDateTimeInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampHeaderDefaultInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampHeaderEpochInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampPathDefaultInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampPathEpochInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampPathHttpDateInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampQueryDefaultInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampQueryEpochInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface MalformedTimestampQueryHttpDateInput { + timestamp: Date | undefined; +} + +/** + * @public + */ +export type SimpleUnion = SimpleUnion.IntMember | SimpleUnion.StringMember | SimpleUnion.$UnknownMember; + +/** + * @public + */ +export namespace SimpleUnion { + export interface IntMember { + int: number; + string?: never; + $unknown?: never; + } + + export interface StringMember { + int?: never; + string: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + int?: never; + string?: never; + $unknown: [string, any]; + } + + export interface Visitor { + int: (value: number) => T; + string: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: SimpleUnion, visitor: Visitor): T => { + if (value.int !== undefined) return visitor.int(value.int); + if (value.string !== undefined) return visitor.string(value.string); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface MalformedUnionInput { + union?: SimpleUnion | undefined; +} + +/** + * @public + */ +export interface MediaTypeHeaderInput { + json?: __AutomaticJsonStringConversion | string | undefined; +} + +/** + * @public + */ +export interface MediaTypeHeaderOutput { + json?: __AutomaticJsonStringConversion | string | undefined; +} + +/** + * @public + */ +export interface NoInputAndOutputOutput {} + +/** + * @public + */ +export interface NullAndEmptyHeadersIO { + a?: string | undefined; + b?: string | undefined; + c?: string[] | undefined; +} + +/** + * @public + */ +export interface OmitsNullSerializesEmptyStringInput { + nullValue?: string | undefined; + emptyString?: string | undefined; +} + +/** + * @public + */ +export interface OmitsSerializingEmptyListsInput { + queryStringList?: string[] | undefined; + queryIntegerList?: number[] | undefined; + queryDoubleList?: number[] | undefined; + queryBooleanList?: boolean[] | undefined; + queryTimestampList?: Date[] | undefined; + queryEnumList?: FooEnum[] | undefined; + queryIntegerEnumList?: IntegerEnum[] | undefined; +} + +/** + * @public + */ +export interface OperationWithDefaultsInput { + defaults?: Defaults | undefined; + clientOptionalDefaults?: ClientOptionalDefaults | undefined; + topLevelDefault?: string | undefined; + otherTopLevelDefault?: number | undefined; +} + +/** + * @public + */ +export interface OperationWithDefaultsOutput { + defaultString?: string | undefined; + defaultBoolean?: boolean | undefined; + defaultList?: string[] | undefined; + defaultDocumentMap?: __DocumentType | undefined; + defaultDocumentString?: __DocumentType | undefined; + defaultDocumentBoolean?: __DocumentType | undefined; + defaultDocumentList?: __DocumentType | undefined; + defaultNullDocument?: __DocumentType | undefined; + defaultTimestamp?: Date | undefined; + defaultBlob?: Uint8Array | undefined; + defaultByte?: number | undefined; + defaultShort?: number | undefined; + defaultInteger?: number | undefined; + defaultLong?: number | undefined; + defaultFloat?: number | undefined; + defaultDouble?: number | undefined; + defaultMap?: Record | undefined; + defaultEnum?: TestEnum | undefined; + defaultIntEnum?: TestIntEnum | undefined; + emptyString?: string | undefined; + falseBoolean?: boolean | undefined; + emptyBlob?: Uint8Array | undefined; + zeroByte?: number | undefined; + zeroShort?: number | undefined; + zeroInteger?: number | undefined; + zeroLong?: number | undefined; + zeroFloat?: number | undefined; + zeroDouble?: number | undefined; +} + +/** + * @public + */ +export interface TopLevel { + dialog: Dialog | undefined; + dialogList?: Dialog[] | undefined; + dialogMap?: Record | undefined; +} + +/** + * @public + */ +export interface OperationWithNestedStructureInput { + topLevel: TopLevel | undefined; +} + +/** + * @public + */ +export interface OperationWithNestedStructureOutput { + dialog: Dialog | undefined; + dialogList?: Dialog[] | undefined; + dialogMap?: Record | undefined; +} + +/** + * @public + */ +export interface PayloadConfig { + data?: number | undefined; +} + +/** + * @public + */ +export interface Unit {} + +/** + * @public + */ +export type PlayerAction = PlayerAction.QuitMember | PlayerAction.$UnknownMember; + +/** + * @public + */ +export namespace PlayerAction { + /** + * Quit the game. + * @public + */ + export interface QuitMember { + quit: Unit; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + quit?: never; + $unknown: [string, any]; + } + + export interface Visitor { + quit: (value: Unit) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: PlayerAction, visitor: Visitor): T => { + if (value.quit !== undefined) return visitor.quit(value.quit); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface PostPlayerActionInput { + action?: PlayerAction | undefined; +} + +/** + * @public + */ +export interface PostPlayerActionOutput { + action: PlayerAction | undefined; +} + +/** + * @public + */ +export type UnionWithJsonName = + | UnionWithJsonName.BarMember + | UnionWithJsonName.BazMember + | UnionWithJsonName.FooMember + | UnionWithJsonName.$UnknownMember; + +/** + * @public + */ +export namespace UnionWithJsonName { + export interface FooMember { + foo: string; + bar?: never; + baz?: never; + $unknown?: never; + } + + export interface BarMember { + foo?: never; + bar: string; + baz?: never; + $unknown?: never; + } + + export interface BazMember { + foo?: never; + bar?: never; + baz: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + foo?: never; + bar?: never; + baz?: never; + $unknown: [string, any]; + } + + export interface Visitor { + foo: (value: string) => T; + bar: (value: string) => T; + baz: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: UnionWithJsonName, visitor: Visitor): T => { + if (value.foo !== undefined) return visitor.foo(value.foo); + if (value.bar !== undefined) return visitor.bar(value.bar); + if (value.baz !== undefined) return visitor.baz(value.baz); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface PostUnionWithJsonNameInput { + value?: UnionWithJsonName | undefined; +} + +/** + * @public + */ +export interface PostUnionWithJsonNameOutput { + value: UnionWithJsonName | undefined; +} + +/** + * @public + */ +export interface PutWithContentEncodingInput { + encoding?: string | undefined; + data?: string | undefined; +} + +/** + * @public + */ +export interface QueryIdempotencyTokenAutoFillInput { + token?: string | undefined; +} + +/** + * @public + */ +export interface QueryParamsAsStringListMapInput { + qux?: string | undefined; + foo?: Record | undefined; +} + +/** + * @public + */ +export interface QueryPrecedenceInput { + foo?: string | undefined; + baz?: Record | undefined; +} + +/** + * @public + */ +export interface ResponseCodeHttpFallbackInputOutput {} + +/** + * @public + */ +export interface ResponseCodeRequiredOutput { + responseCode: number | undefined; +} + +/** + * @public + */ +export interface SimpleScalarPropertiesInputOutput { + foo?: string | undefined; + stringValue?: string | undefined; + trueBooleanValue?: boolean | undefined; + falseBooleanValue?: boolean | undefined; + byteValue?: number | undefined; + shortValue?: number | undefined; + integerValue?: number | undefined; + longValue?: number | undefined; + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export interface SparseJsonListsInputOutput { + sparseStringList?: string[] | undefined; + sparseShortList?: number[] | undefined; +} + +/** + * @public + */ +export interface SparseJsonMapsInputOutput { + sparseStructMap?: Record | undefined; + sparseNumberMap?: Record | undefined; + sparseBooleanMap?: Record | undefined; + sparseStringMap?: Record | undefined; + sparseSetMap?: Record | undefined; +} + +/** + * @public + */ +export interface StreamingTraitsInputOutput { + foo?: string | undefined; + blob?: StreamingBlobTypes | undefined; +} + +/** + * @internal + */ +export const StreamingTraitsInputOutputFilterSensitiveLog = (obj: StreamingTraitsInputOutput): any => ({ + ...obj, +}); + +/** + * @public + */ +export interface StreamingTraitsRequireLengthInput { + foo?: string | undefined; + blob?: StreamingBlobTypes | undefined; +} + +/** + * @internal + */ +export const StreamingTraitsRequireLengthInputFilterSensitiveLog = (obj: StreamingTraitsRequireLengthInput): any => ({ + ...obj, +}); + +/** + * @public + */ +export interface StreamingTraitsWithMediaTypeInputOutput { + foo?: string | undefined; + blob?: StreamingBlobTypes | undefined; +} + +/** + * @internal + */ +export const StreamingTraitsWithMediaTypeInputOutputFilterSensitiveLog = ( + obj: StreamingTraitsWithMediaTypeInputOutput +): any => ({ + ...obj, +}); + +/** + * @public + */ +export interface TestConfig { + timeout?: number | undefined; +} + +/** + * @public + */ +export interface TestBodyStructureInputOutput { + testId?: string | undefined; + testConfig?: TestConfig | undefined; +} + +/** + * @public + */ +export interface TestNoPayloadInputOutput { + testId?: string | undefined; +} + +/** + * @public + */ +export interface TestPayloadBlobInputOutput { + contentType?: string | undefined; + data?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface TestPayloadStructureInputOutput { + testId?: string | undefined; + payloadConfig?: PayloadConfig | undefined; +} + +/** + * @public + */ +export interface TimestampFormatHeadersIO { + memberEpochSeconds?: Date | undefined; + memberHttpDate?: Date | undefined; + memberDateTime?: Date | undefined; + defaultFormat?: Date | undefined; + targetEpochSeconds?: Date | undefined; + targetHttpDate?: Date | undefined; + targetDateTime?: Date | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutputNested1 { + foo?: string | undefined; + nested?: RecursiveShapesInputOutputNested2 | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutputNested2 { + bar?: string | undefined; + recursiveMember?: RecursiveShapesInputOutputNested1 | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutput { + nested?: RecursiveShapesInputOutputNested1 | undefined; +} diff --git a/private/aws-protocoltests-restjson-schema/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson-schema/src/protocols/Aws_restJson1.ts new file mode 100644 index 0000000000000..8e2842a902f62 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/protocols/Aws_restJson1.ts @@ -0,0 +1,5616 @@ +// smithy-typescript generated code +import { + awsExpectUnion as __expectUnion, + loadRestJsonErrorCode, + parseJsonBody as parseBody, + parseJsonErrorBody as parseErrorBody, +} from "@aws-sdk/core"; +import { requestBuilder as rb } from "@smithy/core"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, + isValidHostname as __isValidHostname, +} from "@smithy/protocol-http"; +import { + _json, + collectBody, + convertMap, + dateToUtcString as __dateToUtcString, + decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, + expectByte as __expectByte, + expectInt32 as __expectInt32, + expectLong as __expectLong, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectObject as __expectObject, + expectShort as __expectShort, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + isSerializableHeaderValue, + LazyJsonString as __LazyJsonString, + limitedParseDouble as __limitedParseDouble, + limitedParseFloat32 as __limitedParseFloat32, + map, + parseBoolean as __parseBoolean, + parseEpochTimestamp as __parseEpochTimestamp, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime as __parseRfc7231DateTime, + quoteHeader as __quoteHeader, + resolvedPath as __resolvedPath, + serializeDateTime as __serializeDateTime, + serializeFloat as __serializeFloat, + splitEvery as __splitEvery, + splitHeader as __splitHeader, + strictParseByte as __strictParseByte, + strictParseDouble as __strictParseDouble, + strictParseFloat as __strictParseFloat, + strictParseInt32 as __strictParseInt32, + strictParseLong as __strictParseLong, + strictParseShort as __strictParseShort, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + DocumentType as __DocumentType, + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SdkStreamSerdeContext as __SdkStreamSerdeContext, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, +} from "../commands/AllQueryStringTypesCommand"; +import { + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, +} from "../commands/ConstantAndVariableQueryStringCommand"; +import { + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, +} from "../commands/ConstantQueryStringCommand"; +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "../commands/ContentTypeParametersCommand"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "../commands/DatetimeOffsetsCommand"; +import { + DocumentTypeAsMapValueCommandInput, + DocumentTypeAsMapValueCommandOutput, +} from "../commands/DocumentTypeAsMapValueCommand"; +import { + DocumentTypeAsPayloadCommandInput, + DocumentTypeAsPayloadCommandOutput, +} from "../commands/DocumentTypeAsPayloadCommand"; +import { DocumentTypeCommandInput, DocumentTypeCommandOutput } from "../commands/DocumentTypeCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "../commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "../commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "../commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "../commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "../commands/GreetingWithErrorsCommand"; +import { + HostWithPathOperationCommandInput, + HostWithPathOperationCommandOutput, +} from "../commands/HostWithPathOperationCommand"; +import { + HttpChecksumRequiredCommandInput, + HttpChecksumRequiredCommandOutput, +} from "../commands/HttpChecksumRequiredCommand"; +import { + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, +} from "../commands/HttpEmptyPrefixHeadersCommand"; +import { HttpEnumPayloadCommandInput, HttpEnumPayloadCommandOutput } from "../commands/HttpEnumPayloadCommand"; +import { HttpPayloadTraitsCommandInput, HttpPayloadTraitsCommandOutput } from "../commands/HttpPayloadTraitsCommand"; +import { + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, +} from "../commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, +} from "../commands/HttpPayloadWithStructureCommand"; +import { + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, +} from "../commands/HttpPayloadWithUnionCommand"; +import { HttpPrefixHeadersCommandInput, HttpPrefixHeadersCommandOutput } from "../commands/HttpPrefixHeadersCommand"; +import { + HttpPrefixHeadersInResponseCommandInput, + HttpPrefixHeadersInResponseCommandOutput, +} from "../commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, +} from "../commands/HttpRequestWithFloatLabelsCommand"; +import { + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, +} from "../commands/HttpRequestWithGreedyLabelInPathCommand"; +import { + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, +} from "../commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, +} from "../commands/HttpRequestWithLabelsCommand"; +import { + HttpRequestWithRegexLiteralCommandInput, + HttpRequestWithRegexLiteralCommandOutput, +} from "../commands/HttpRequestWithRegexLiteralCommand"; +import { HttpResponseCodeCommandInput, HttpResponseCodeCommandOutput } from "../commands/HttpResponseCodeCommand"; +import { HttpStringPayloadCommandInput, HttpStringPayloadCommandOutput } from "../commands/HttpStringPayloadCommand"; +import { + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, +} from "../commands/IgnoreQueryParamsInResponseCommand"; +import { + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, +} from "../commands/InputAndOutputWithHeadersCommand"; +import { JsonBlobsCommandInput, JsonBlobsCommandOutput } from "../commands/JsonBlobsCommand"; +import { JsonEnumsCommandInput, JsonEnumsCommandOutput } from "../commands/JsonEnumsCommand"; +import { JsonIntEnumsCommandInput, JsonIntEnumsCommandOutput } from "../commands/JsonIntEnumsCommand"; +import { JsonListsCommandInput, JsonListsCommandOutput } from "../commands/JsonListsCommand"; +import { JsonMapsCommandInput, JsonMapsCommandOutput } from "../commands/JsonMapsCommand"; +import { JsonTimestampsCommandInput, JsonTimestampsCommandOutput } from "../commands/JsonTimestampsCommand"; +import { JsonUnionsCommandInput, JsonUnionsCommandOutput } from "../commands/JsonUnionsCommand"; +import { + MalformedAcceptWithBodyCommandInput, + MalformedAcceptWithBodyCommandOutput, +} from "../commands/MalformedAcceptWithBodyCommand"; +import { + MalformedAcceptWithGenericStringCommandInput, + MalformedAcceptWithGenericStringCommandOutput, +} from "../commands/MalformedAcceptWithGenericStringCommand"; +import { + MalformedAcceptWithPayloadCommandInput, + MalformedAcceptWithPayloadCommandOutput, +} from "../commands/MalformedAcceptWithPayloadCommand"; +import { MalformedBlobCommandInput, MalformedBlobCommandOutput } from "../commands/MalformedBlobCommand"; +import { MalformedBooleanCommandInput, MalformedBooleanCommandOutput } from "../commands/MalformedBooleanCommand"; +import { MalformedByteCommandInput, MalformedByteCommandOutput } from "../commands/MalformedByteCommand"; +import { + MalformedContentTypeWithBodyCommandInput, + MalformedContentTypeWithBodyCommandOutput, +} from "../commands/MalformedContentTypeWithBodyCommand"; +import { + MalformedContentTypeWithGenericStringCommandInput, + MalformedContentTypeWithGenericStringCommandOutput, +} from "../commands/MalformedContentTypeWithGenericStringCommand"; +import { + MalformedContentTypeWithoutBodyCommandInput, + MalformedContentTypeWithoutBodyCommandOutput, +} from "../commands/MalformedContentTypeWithoutBodyCommand"; +import { + MalformedContentTypeWithoutBodyEmptyInputCommandInput, + MalformedContentTypeWithoutBodyEmptyInputCommandOutput, +} from "../commands/MalformedContentTypeWithoutBodyEmptyInputCommand"; +import { + MalformedContentTypeWithPayloadCommandInput, + MalformedContentTypeWithPayloadCommandOutput, +} from "../commands/MalformedContentTypeWithPayloadCommand"; +import { MalformedDoubleCommandInput, MalformedDoubleCommandOutput } from "../commands/MalformedDoubleCommand"; +import { MalformedFloatCommandInput, MalformedFloatCommandOutput } from "../commands/MalformedFloatCommand"; +import { MalformedIntegerCommandInput, MalformedIntegerCommandOutput } from "../commands/MalformedIntegerCommand"; +import { MalformedListCommandInput, MalformedListCommandOutput } from "../commands/MalformedListCommand"; +import { MalformedLongCommandInput, MalformedLongCommandOutput } from "../commands/MalformedLongCommand"; +import { MalformedMapCommandInput, MalformedMapCommandOutput } from "../commands/MalformedMapCommand"; +import { + MalformedRequestBodyCommandInput, + MalformedRequestBodyCommandOutput, +} from "../commands/MalformedRequestBodyCommand"; +import { MalformedShortCommandInput, MalformedShortCommandOutput } from "../commands/MalformedShortCommand"; +import { MalformedStringCommandInput, MalformedStringCommandOutput } from "../commands/MalformedStringCommand"; +import { + MalformedTimestampBodyDateTimeCommandInput, + MalformedTimestampBodyDateTimeCommandOutput, +} from "../commands/MalformedTimestampBodyDateTimeCommand"; +import { + MalformedTimestampBodyDefaultCommandInput, + MalformedTimestampBodyDefaultCommandOutput, +} from "../commands/MalformedTimestampBodyDefaultCommand"; +import { + MalformedTimestampBodyHttpDateCommandInput, + MalformedTimestampBodyHttpDateCommandOutput, +} from "../commands/MalformedTimestampBodyHttpDateCommand"; +import { + MalformedTimestampHeaderDateTimeCommandInput, + MalformedTimestampHeaderDateTimeCommandOutput, +} from "../commands/MalformedTimestampHeaderDateTimeCommand"; +import { + MalformedTimestampHeaderDefaultCommandInput, + MalformedTimestampHeaderDefaultCommandOutput, +} from "../commands/MalformedTimestampHeaderDefaultCommand"; +import { + MalformedTimestampHeaderEpochCommandInput, + MalformedTimestampHeaderEpochCommandOutput, +} from "../commands/MalformedTimestampHeaderEpochCommand"; +import { + MalformedTimestampPathDefaultCommandInput, + MalformedTimestampPathDefaultCommandOutput, +} from "../commands/MalformedTimestampPathDefaultCommand"; +import { + MalformedTimestampPathEpochCommandInput, + MalformedTimestampPathEpochCommandOutput, +} from "../commands/MalformedTimestampPathEpochCommand"; +import { + MalformedTimestampPathHttpDateCommandInput, + MalformedTimestampPathHttpDateCommandOutput, +} from "../commands/MalformedTimestampPathHttpDateCommand"; +import { + MalformedTimestampQueryDefaultCommandInput, + MalformedTimestampQueryDefaultCommandOutput, +} from "../commands/MalformedTimestampQueryDefaultCommand"; +import { + MalformedTimestampQueryEpochCommandInput, + MalformedTimestampQueryEpochCommandOutput, +} from "../commands/MalformedTimestampQueryEpochCommand"; +import { + MalformedTimestampQueryHttpDateCommandInput, + MalformedTimestampQueryHttpDateCommandOutput, +} from "../commands/MalformedTimestampQueryHttpDateCommand"; +import { MalformedUnionCommandInput, MalformedUnionCommandOutput } from "../commands/MalformedUnionCommand"; +import { MediaTypeHeaderCommandInput, MediaTypeHeaderCommandOutput } from "../commands/MediaTypeHeaderCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "../commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "../commands/NoInputAndOutputCommand"; +import { + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, +} from "../commands/NullAndEmptyHeadersClientCommand"; +import { + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, +} from "../commands/NullAndEmptyHeadersServerCommand"; +import { + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, +} from "../commands/OmitsNullSerializesEmptyStringCommand"; +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, + PostUnionWithJsonNameCommandOutput, +} from "../commands/PostUnionWithJsonNameCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "../commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "../commands/QueryIdempotencyTokenAutoFillCommand"; +import { + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, +} from "../commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommandInput, QueryPrecedenceCommandOutput } from "../commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from "../commands/RecursiveShapesCommand"; +import { + ResponseCodeHttpFallbackCommandInput, + ResponseCodeHttpFallbackCommandOutput, +} from "../commands/ResponseCodeHttpFallbackCommand"; +import { + ResponseCodeRequiredCommandInput, + ResponseCodeRequiredCommandOutput, +} from "../commands/ResponseCodeRequiredCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "../commands/SimpleScalarPropertiesCommand"; +import { SparseJsonListsCommandInput, SparseJsonListsCommandOutput } from "../commands/SparseJsonListsCommand"; +import { SparseJsonMapsCommandInput, SparseJsonMapsCommandOutput } from "../commands/SparseJsonMapsCommand"; +import { StreamingTraitsCommandInput, StreamingTraitsCommandOutput } from "../commands/StreamingTraitsCommand"; +import { + StreamingTraitsRequireLengthCommandInput, + StreamingTraitsRequireLengthCommandOutput, +} from "../commands/StreamingTraitsRequireLengthCommand"; +import { + StreamingTraitsWithMediaTypeCommandInput, + StreamingTraitsWithMediaTypeCommandOutput, +} from "../commands/StreamingTraitsWithMediaTypeCommand"; +import { TestBodyStructureCommandInput, TestBodyStructureCommandOutput } from "../commands/TestBodyStructureCommand"; +import { + TestGetNoInputNoPayloadCommandInput, + TestGetNoInputNoPayloadCommandOutput, +} from "../commands/TestGetNoInputNoPayloadCommand"; +import { TestGetNoPayloadCommandInput, TestGetNoPayloadCommandOutput } from "../commands/TestGetNoPayloadCommand"; +import { TestPayloadBlobCommandInput, TestPayloadBlobCommandOutput } from "../commands/TestPayloadBlobCommand"; +import { + TestPayloadStructureCommandInput, + TestPayloadStructureCommandOutput, +} from "../commands/TestPayloadStructureCommand"; +import { + TestPostNoInputNoPayloadCommandInput, + TestPostNoInputNoPayloadCommandOutput, +} from "../commands/TestPostNoInputNoPayloadCommand"; +import { TestPostNoPayloadCommandInput, TestPostNoPayloadCommandOutput } from "../commands/TestPostNoPayloadCommand"; +import { + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, +} from "../commands/TimestampFormatHeadersCommand"; +import { UnitInputAndOutputCommandInput, UnitInputAndOutputCommandOutput } from "../commands/UnitInputAndOutputCommand"; +import { + ClientOptionalDefaults, + ComplexError, + ComplexNestedErrorData, + Defaults, + Dialog, + Farewell, + FooEnum, + FooError, + GreetingStruct, + IntegerEnum, + InvalidGreeting, + MyUnion, + NestedPayload, + PayloadConfig, + PlayerAction, + RecursiveShapesInputOutputNested1, + RecursiveShapesInputOutputNested2, + RenamedGreeting, + SimpleUnion, + StructureListMember, + TestConfig, + TopLevel, + UnionPayload, + UnionWithJsonName, + Unit, +} from "../models/models_0"; +import { RestJsonProtocolServiceException as __BaseException } from "../models/RestJsonProtocolServiceException"; + +/** + * serializeAws_restJson1AllQueryStringTypesCommand + */ +export const se_AllQueryStringTypesCommand = async ( + input: AllQueryStringTypesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/AllQueryStringTypesInput"); + const query: any = map({ + ...convertMap(input.queryParamsMapOfStringList), + [_S]: [, input[_qS]!], + [_SL]: [() => input.queryStringList !== void 0, () => input[_qSL]! || []], + [_SS]: [() => input.queryStringSet !== void 0, () => input[_qSS]! || []], + [_B]: [() => input.queryByte !== void 0, () => input[_qB]!.toString()], + [_Sh]: [() => input.queryShort !== void 0, () => input[_qSu]!.toString()], + [_I]: [() => input.queryInteger !== void 0, () => input[_qI]!.toString()], + [_IL]: [ + () => input.queryIntegerList !== void 0, + () => (input[_qIL]! || []).map((_entry) => _entry.toString() as any), + ], + [_IS]: [ + () => input.queryIntegerSet !== void 0, + () => (input[_qIS]! || []).map((_entry) => _entry.toString() as any), + ], + [_L]: [() => input.queryLong !== void 0, () => input[_qL]!.toString()], + [_F]: [ + () => input.queryFloat !== void 0, + () => (input[_qF]! % 1 == 0 ? input[_qF]! + ".0" : input[_qF]!.toString()), + ], + [_D]: [ + () => input.queryDouble !== void 0, + () => (input[_qD]! % 1 == 0 ? input[_qD]! + ".0" : input[_qD]!.toString()), + ], + [_DL]: [ + () => input.queryDoubleList !== void 0, + () => (input[_qDL]! || []).map((_entry) => (_entry % 1 == 0 ? _entry + ".0" : _entry.toString()) as any), + ], + [_Bo]: [() => input.queryBoolean !== void 0, () => input[_qBu]!.toString()], + [_BL]: [ + () => input.queryBooleanList !== void 0, + () => (input[_qBL]! || []).map((_entry) => _entry.toString() as any), + ], + [_T]: [() => input.queryTimestamp !== void 0, () => __serializeDateTime(input[_qT]!).toString()], + [_TL]: [ + () => input.queryTimestampList !== void 0, + () => (input[_qTL]! || []).map((_entry) => __serializeDateTime(_entry).toString() as any), + ], + [_E]: [, input[_qE]!], + [_EL]: [() => input.queryEnumList !== void 0, () => input[_qEL]! || []], + [_IE]: [() => input.queryIntegerEnum !== void 0, () => input[_qIE]!.toString()], + [_IEL]: [ + () => input.queryIntegerEnumList !== void 0, + () => (input[_qIEL]! || []).map((_entry) => _entry.toString() as any), + ], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ConstantAndVariableQueryStringCommand + */ +export const se_ConstantAndVariableQueryStringCommand = async ( + input: ConstantAndVariableQueryStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/ConstantAndVariableQueryString"); + const query: any = map({ + [_f]: [, "bar"], + [_b]: [, input[_b]!], + [_mS]: [, input[_mS]!], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ConstantQueryStringCommand + */ +export const se_ConstantQueryStringCommand = async ( + input: ConstantQueryStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/ConstantQueryString/{hello}"); + b.p("hello", () => input.hello!, "{hello}", false); + const query: any = map({ + [_f]: [, "bar"], + [_h]: [, ""], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + 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 + */ +export const se_DatetimeOffsetsCommand = async ( + input: DatetimeOffsetsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/DatetimeOffsets"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DocumentTypeCommand + */ +export const se_DocumentTypeCommand = async ( + input: DocumentTypeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/DocumentType"); + let body: any; + body = JSON.stringify( + take(input, { + documentValue: (_) => se_Document(_, context), + stringValue: [], + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DocumentTypeAsMapValueCommand + */ +export const se_DocumentTypeAsMapValueCommand = async ( + input: DocumentTypeAsMapValueCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/DocumentTypeAsMapValue"); + let body: any; + body = JSON.stringify( + take(input, { + docValuedMap: (_) => se_DocumentValuedMap(_, context), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DocumentTypeAsPayloadCommand + */ +export const se_DocumentTypeAsPayloadCommand = async ( + input: DocumentTypeAsPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/DocumentTypeAsPayload"); + let body: any; + if (input.documentValue !== undefined) { + if (input.documentValue === null) { + body = "null"; + } else { + body = input.documentValue; + } + } + body = JSON.stringify(body); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1EmptyInputAndEmptyOutputCommand + */ +export const se_EmptyInputAndEmptyOutputCommand = async ( + input: EmptyInputAndEmptyOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/EmptyInputAndEmptyOutput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1EndpointOperationCommand + */ +export const se_EndpointOperationCommand = async ( + input: EndpointOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/EndpointOperation"); + let body: any; + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo." + resolvedHostname; + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + b.hn(resolvedHostname); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1EndpointWithHostLabelOperationCommand + */ +export const se_EndpointWithHostLabelOperationCommand = async ( + input: EndpointWithHostLabelOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/EndpointWithHostLabelOperation"); + let body: any; + body = JSON.stringify( + take(input, { + label: [], + }) + ); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo.{label}." + resolvedHostname; + if (input.label === undefined) { + throw new Error("Empty value provided for input host prefix: label."); + } + resolvedHostname = resolvedHostname.replace("{label}", input.label!); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + b.hn(resolvedHostname); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1FractionalSecondsCommand + */ +export const se_FractionalSecondsCommand = async ( + input: FractionalSecondsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/FractionalSeconds"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GreetingWithErrorsCommand + */ +export const se_GreetingWithErrorsCommand = async ( + input: GreetingWithErrorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/GreetingWithErrors"); + let body: any; + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HostWithPathOperationCommand + */ +export const se_HostWithPathOperationCommand = async ( + input: HostWithPathOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HostWithPathOperation"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpChecksumRequiredCommand + */ +export const se_HttpChecksumRequiredCommand = async ( + input: HttpChecksumRequiredCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/HttpChecksumRequired"); + let body: any; + body = JSON.stringify( + take(input, { + foo: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpEmptyPrefixHeadersCommand + */ +export const se_HttpEmptyPrefixHeadersCommand = async ( + input: HttpEmptyPrefixHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + ...(input.prefixHeaders !== undefined && + Object.keys(input.prefixHeaders).reduce((acc: any, suffix: string) => { + acc[`${suffix.toLowerCase()}`] = input.prefixHeaders![suffix]; + return acc; + }, {})), + [_h]: input[_sH]!, + }); + b.bp("/HttpEmptyPrefixHeaders"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpEnumPayloadCommand + */ +export const se_HttpEnumPayloadCommand = async ( + input: HttpEnumPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "text/plain", + }; + b.bp("/EnumPayload"); + let body: any; + if (input.payload !== undefined) { + body = input.payload; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpPayloadTraitsCommand + */ +export const se_HttpPayloadTraitsCommand = async ( + input: HttpPayloadTraitsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/octet-stream", + [_xf]: input[_f]!, + }); + b.bp("/HttpPayloadTraits"); + let body: any; + if (input.blob !== undefined) { + body = input.blob; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpPayloadTraitsWithMediaTypeCommand + */ +export const se_HttpPayloadTraitsWithMediaTypeCommand = async ( + input: HttpPayloadTraitsWithMediaTypeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "text/plain", + [_xf]: input[_f]!, + }); + b.bp("/HttpPayloadTraitsWithMediaType"); + let body: any; + if (input.blob !== undefined) { + body = input.blob; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpPayloadWithStructureCommand + */ +export const se_HttpPayloadWithStructureCommand = async ( + input: HttpPayloadWithStructureCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/HttpPayloadWithStructure"); + let body: any; + if (input.nested !== undefined) { + body = _json(input.nested); + } + if (body === undefined) { + body = {}; + } + body = JSON.stringify(body); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpPayloadWithUnionCommand + */ +export const se_HttpPayloadWithUnionCommand = async ( + input: HttpPayloadWithUnionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/HttpPayloadWithUnion"); + let body: any; + if (input.nested !== undefined) { + body = _json(input.nested); + } + if (body === undefined) { + body = {}; + } + body = JSON.stringify(body); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpPrefixHeadersCommand + */ +export const se_HttpPrefixHeadersCommand = async ( + input: HttpPrefixHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + ...(input.fooMap !== undefined && + Object.keys(input.fooMap).reduce((acc: any, suffix: string) => { + acc[`x-foo-${suffix.toLowerCase()}`] = input.fooMap![suffix]; + return acc; + }, {})), + [_xf]: input[_f]!, + }); + b.bp("/HttpPrefixHeaders"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpPrefixHeadersInResponseCommand + */ +export const se_HttpPrefixHeadersInResponseCommand = async ( + input: HttpPrefixHeadersInResponseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HttpPrefixHeadersResponse"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpRequestWithFloatLabelsCommand + */ +export const se_HttpRequestWithFloatLabelsCommand = async ( + input: HttpRequestWithFloatLabelsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/FloatHttpLabels/{float}/{double}"); + b.p("float", () => (input.float! % 1 == 0 ? input.float! + ".0" : input.float!.toString()), "{float}", false); + b.p("double", () => (input.double! % 1 == 0 ? input.double! + ".0" : input.double!.toString()), "{double}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpRequestWithGreedyLabelInPathCommand + */ +export const se_HttpRequestWithGreedyLabelInPathCommand = async ( + input: HttpRequestWithGreedyLabelInPathCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}"); + b.p("foo", () => input.foo!, "{foo}", false); + b.p("baz", () => input.baz!, "{baz+}", true); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpRequestWithLabelsCommand + */ +export const se_HttpRequestWithLabelsCommand = async ( + input: HttpRequestWithLabelsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}"); + b.p("string", () => input.string!, "{string}", false); + b.p("short", () => input.short!.toString(), "{short}", false); + b.p("integer", () => input.integer!.toString(), "{integer}", false); + b.p("long", () => input.long!.toString(), "{long}", false); + b.p("float", () => (input.float! % 1 == 0 ? input.float! + ".0" : input.float!.toString()), "{float}", false); + b.p("double", () => (input.double! % 1 == 0 ? input.double! + ".0" : input.double!.toString()), "{double}", false); + b.p("boolean", () => input.boolean!.toString(), "{boolean}", false); + b.p("timestamp", () => __serializeDateTime(input.timestamp!).toString(), "{timestamp}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpRequestWithLabelsAndTimestampFormatCommand + */ +export const se_HttpRequestWithLabelsAndTimestampFormatCommand = async ( + input: HttpRequestWithLabelsAndTimestampFormatCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp( + "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}" + ); + b.p( + "memberEpochSeconds", + () => (input.memberEpochSeconds!.getTime() / 1_000).toString(), + "{memberEpochSeconds}", + false + ); + b.p("memberHttpDate", () => __dateToUtcString(input.memberHttpDate!).toString(), "{memberHttpDate}", false); + b.p("memberDateTime", () => __serializeDateTime(input.memberDateTime!).toString(), "{memberDateTime}", false); + b.p("defaultFormat", () => __serializeDateTime(input.defaultFormat!).toString(), "{defaultFormat}", false); + b.p( + "targetEpochSeconds", + () => (input.targetEpochSeconds!.getTime() / 1_000).toString(), + "{targetEpochSeconds}", + false + ); + b.p("targetHttpDate", () => __dateToUtcString(input.targetHttpDate!).toString(), "{targetHttpDate}", false); + b.p("targetDateTime", () => __serializeDateTime(input.targetDateTime!).toString(), "{targetDateTime}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpRequestWithRegexLiteralCommand + */ +export const se_HttpRequestWithRegexLiteralCommand = async ( + input: HttpRequestWithRegexLiteralCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/ReDosLiteral/{str}/(a+)+"); + b.p("str", () => input.str!, "{str}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpResponseCodeCommand + */ +export const se_HttpResponseCodeCommand = async ( + input: HttpResponseCodeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HttpResponseCode"); + let body: any; + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1HttpStringPayloadCommand + */ +export const se_HttpStringPayloadCommand = async ( + input: HttpStringPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "text/plain", + }; + b.bp("/StringPayload"); + let body: any; + if (input.payload !== undefined) { + body = input.payload; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1IgnoreQueryParamsInResponseCommand + */ +export const se_IgnoreQueryParamsInResponseCommand = async ( + input: IgnoreQueryParamsInResponseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/IgnoreQueryParamsInResponse"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1InputAndOutputWithHeadersCommand + */ +export const se_InputAndOutputWithHeadersCommand = async ( + input: InputAndOutputWithHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xs]: input[_hS]!, + [_xb]: [() => isSerializableHeaderValue(input[_hB]), () => input[_hB]!.toString()], + [_xs_]: [() => isSerializableHeaderValue(input[_hSe]), () => input[_hSe]!.toString()], + [_xi]: [() => isSerializableHeaderValue(input[_hI]), () => input[_hI]!.toString()], + [_xl]: [() => isSerializableHeaderValue(input[_hL]), () => input[_hL]!.toString()], + [_xf_]: [ + () => isSerializableHeaderValue(input[_hF]), + () => (input[_hF]! % 1 == 0 ? input[_hF]! + ".0" : input[_hF]!.toString()), + ], + [_xd]: [ + () => isSerializableHeaderValue(input[_hD]), + () => (input[_hD]! % 1 == 0 ? input[_hD]! + ".0" : input[_hD]!.toString()), + ], + [_xb_]: [() => isSerializableHeaderValue(input[_hTB]), () => input[_hTB]!.toString()], + [_xb__]: [() => isSerializableHeaderValue(input[_hFB]), () => input[_hFB]!.toString()], + [_xs__]: [() => isSerializableHeaderValue(input[_hSL]), () => (input[_hSL]! || []).map(__quoteHeader).join(", ")], + [_xs___]: [() => isSerializableHeaderValue(input[_hSS]), () => (input[_hSS]! || []).map(__quoteHeader).join(", ")], + [_xi_]: [ + () => isSerializableHeaderValue(input[_hIL]), + () => (input[_hIL]! || []).map((_entry) => _entry.toString() as any).join(", "), + ], + [_xb___]: [ + () => isSerializableHeaderValue(input[_hBL]), + () => (input[_hBL]! || []).map((_entry) => _entry.toString() as any).join(", "), + ], + [_xt]: [ + () => isSerializableHeaderValue(input[_hTL]), + () => (input[_hTL]! || []).map((_entry) => __dateToUtcString(_entry).toString() as any).join(", "), + ], + [_xe]: input[_hE]!, + [_xe_]: [() => isSerializableHeaderValue(input[_hEL]), () => (input[_hEL]! || []).map(__quoteHeader).join(", ")], + [_xi__]: [() => isSerializableHeaderValue(input[_hIE]), () => input[_hIE]!.toString()], + [_xi___]: [ + () => isSerializableHeaderValue(input[_hIEL]), + () => (input[_hIEL]! || []).map((_entry) => _entry.toString() as any).join(", "), + ], + }); + b.bp("/InputAndOutputWithHeaders"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1JsonBlobsCommand + */ +export const se_JsonBlobsCommand = async ( + input: JsonBlobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/JsonBlobs"); + let body: any; + body = JSON.stringify( + take(input, { + data: (_) => context.base64Encoder(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1JsonEnumsCommand + */ +export const se_JsonEnumsCommand = async ( + input: JsonEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/JsonEnums"); + let body: any; + body = JSON.stringify( + take(input, { + fooEnum1: [], + fooEnum2: [], + fooEnum3: [], + fooEnumList: (_) => _json(_), + fooEnumMap: (_) => _json(_), + fooEnumSet: (_) => _json(_), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1JsonIntEnumsCommand + */ +export const se_JsonIntEnumsCommand = async ( + input: JsonIntEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/JsonIntEnums"); + let body: any; + body = JSON.stringify( + take(input, { + integerEnum1: [], + integerEnum2: [], + integerEnum3: [], + integerEnumList: (_) => _json(_), + integerEnumMap: (_) => _json(_), + integerEnumSet: (_) => _json(_), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1JsonListsCommand + */ +export const se_JsonListsCommand = async ( + input: JsonListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/JsonLists"); + let body: any; + body = JSON.stringify( + take(input, { + booleanList: (_) => _json(_), + enumList: (_) => _json(_), + intEnumList: (_) => _json(_), + integerList: (_) => _json(_), + nestedStringList: (_) => _json(_), + stringList: (_) => _json(_), + stringSet: (_) => _json(_), + myStructureList: [, (_) => se_StructureList(_, context), `structureList`], + timestampList: (_) => se_TimestampList(_, context), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1JsonMapsCommand + */ +export const se_JsonMapsCommand = async ( + input: JsonMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/JsonMaps"); + let body: any; + body = JSON.stringify( + take(input, { + denseBooleanMap: (_) => _json(_), + denseNumberMap: (_) => _json(_), + denseSetMap: (_) => _json(_), + denseStringMap: (_) => _json(_), + denseStructMap: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1JsonTimestampsCommand + */ +export const se_JsonTimestampsCommand = async ( + input: JsonTimestampsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/JsonTimestamps"); + let body: any; + body = JSON.stringify( + take(input, { + dateTime: (_) => __serializeDateTime(_), + dateTimeOnTarget: (_) => __serializeDateTime(_), + epochSeconds: (_) => _.getTime() / 1_000, + epochSecondsOnTarget: (_) => _.getTime() / 1_000, + httpDate: (_) => __dateToUtcString(_), + httpDateOnTarget: (_) => __dateToUtcString(_), + normal: (_) => _.getTime() / 1_000, + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1JsonUnionsCommand + */ +export const se_JsonUnionsCommand = async ( + input: JsonUnionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/JsonUnions"); + let body: any; + body = JSON.stringify( + take(input, { + contents: (_) => se_MyUnion(_, context), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedAcceptWithBodyCommand + */ +export const se_MalformedAcceptWithBodyCommand = async ( + input: MalformedAcceptWithBodyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedAcceptWithBody"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedAcceptWithGenericStringCommand + */ +export const se_MalformedAcceptWithGenericStringCommand = async ( + input: MalformedAcceptWithGenericStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedAcceptWithGenericString"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedAcceptWithPayloadCommand + */ +export const se_MalformedAcceptWithPayloadCommand = async ( + input: MalformedAcceptWithPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedAcceptWithPayload"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedBlobCommand + */ +export const se_MalformedBlobCommand = async ( + input: MalformedBlobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedBlob"); + let body: any; + body = JSON.stringify( + take(input, { + blob: (_) => context.base64Encoder(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedBooleanCommand + */ +export const se_MalformedBooleanCommand = async ( + input: MalformedBooleanCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_bo]: [() => isSerializableHeaderValue(input[_bIH]), () => input[_bIH]!.toString()], + }); + b.bp("/MalformedBoolean/{booleanInPath}"); + b.p("booleanInPath", () => input.booleanInPath!.toString(), "{booleanInPath}", false); + const query: any = map({ + [_bIQ]: [() => input.booleanInQuery !== void 0, () => input[_bIQ]!.toString()], + }); + let body: any; + body = JSON.stringify( + take(input, { + booleanInBody: [], + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedByteCommand + */ +export const se_MalformedByteCommand = async ( + input: MalformedByteCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_by]: [() => isSerializableHeaderValue(input[_bIHy]), () => input[_bIHy]!.toString()], + }); + b.bp("/MalformedByte/{byteInPath}"); + b.p("byteInPath", () => input.byteInPath!.toString(), "{byteInPath}", false); + const query: any = map({ + [_bIQy]: [() => input.byteInQuery !== void 0, () => input[_bIQy]!.toString()], + }); + let body: any; + body = JSON.stringify( + take(input, { + byteInBody: [], + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedContentTypeWithBodyCommand + */ +export const se_MalformedContentTypeWithBodyCommand = async ( + input: MalformedContentTypeWithBodyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedContentTypeWithBody"); + let body: any; + body = JSON.stringify( + take(input, { + hi: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedContentTypeWithGenericStringCommand + */ +export const se_MalformedContentTypeWithGenericStringCommand = async ( + input: MalformedContentTypeWithGenericStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "text/plain", + }; + b.bp("/MalformedContentTypeWithGenericString"); + let body: any; + if (input.payload !== undefined) { + body = input.payload; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedContentTypeWithoutBodyCommand + */ +export const se_MalformedContentTypeWithoutBodyCommand = async ( + input: MalformedContentTypeWithoutBodyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedContentTypeWithoutBody"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedContentTypeWithoutBodyEmptyInputCommand + */ +export const se_MalformedContentTypeWithoutBodyEmptyInputCommand = async ( + input: MalformedContentTypeWithoutBodyEmptyInputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_he]: input[_he]!, + }); + b.bp("/MalformedContentTypeWithoutBodyEmptyInput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedContentTypeWithPayloadCommand + */ +export const se_MalformedContentTypeWithPayloadCommand = async ( + input: MalformedContentTypeWithPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "image/jpeg", + }; + b.bp("/MalformedContentTypeWithPayload"); + let body: any; + if (input.payload !== undefined) { + body = input.payload; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedDoubleCommand + */ +export const se_MalformedDoubleCommand = async ( + input: MalformedDoubleCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_d]: [ + () => isSerializableHeaderValue(input[_dIH]), + () => (input[_dIH]! % 1 == 0 ? input[_dIH]! + ".0" : input[_dIH]!.toString()), + ], + }); + b.bp("/MalformedDouble/{doubleInPath}"); + b.p( + "doubleInPath", + () => (input.doubleInPath! % 1 == 0 ? input.doubleInPath! + ".0" : input.doubleInPath!.toString()), + "{doubleInPath}", + false + ); + const query: any = map({ + [_dIQ]: [ + () => input.doubleInQuery !== void 0, + () => (input[_dIQ]! % 1 == 0 ? input[_dIQ]! + ".0" : input[_dIQ]!.toString()), + ], + }); + let body: any; + body = JSON.stringify( + take(input, { + doubleInBody: (_) => __serializeFloat(_), + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedFloatCommand + */ +export const se_MalformedFloatCommand = async ( + input: MalformedFloatCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_fl]: [ + () => isSerializableHeaderValue(input[_fIH]), + () => (input[_fIH]! % 1 == 0 ? input[_fIH]! + ".0" : input[_fIH]!.toString()), + ], + }); + b.bp("/MalformedFloat/{floatInPath}"); + b.p( + "floatInPath", + () => (input.floatInPath! % 1 == 0 ? input.floatInPath! + ".0" : input.floatInPath!.toString()), + "{floatInPath}", + false + ); + const query: any = map({ + [_fIQ]: [ + () => input.floatInQuery !== void 0, + () => (input[_fIQ]! % 1 == 0 ? input[_fIQ]! + ".0" : input[_fIQ]!.toString()), + ], + }); + let body: any; + body = JSON.stringify( + take(input, { + floatInBody: (_) => __serializeFloat(_), + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedIntegerCommand + */ +export const se_MalformedIntegerCommand = async ( + input: MalformedIntegerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_i]: [() => isSerializableHeaderValue(input[_iIH]), () => input[_iIH]!.toString()], + }); + b.bp("/MalformedInteger/{integerInPath}"); + b.p("integerInPath", () => input.integerInPath!.toString(), "{integerInPath}", false); + const query: any = map({ + [_iIQ]: [() => input.integerInQuery !== void 0, () => input[_iIQ]!.toString()], + }); + let body: any; + body = JSON.stringify( + take(input, { + integerInBody: [], + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedListCommand + */ +export const se_MalformedListCommand = async ( + input: MalformedListCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedList"); + let body: any; + body = JSON.stringify( + take(input, { + bodyList: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedLongCommand + */ +export const se_MalformedLongCommand = async ( + input: MalformedLongCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_l]: [() => isSerializableHeaderValue(input[_lIH]), () => input[_lIH]!.toString()], + }); + b.bp("/MalformedLong/{longInPath}"); + b.p("longInPath", () => input.longInPath!.toString(), "{longInPath}", false); + const query: any = map({ + [_lIQ]: [() => input.longInQuery !== void 0, () => input[_lIQ]!.toString()], + }); + let body: any; + body = JSON.stringify( + take(input, { + longInBody: [], + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedMapCommand + */ +export const se_MalformedMapCommand = async ( + input: MalformedMapCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedMap"); + let body: any; + body = JSON.stringify( + take(input, { + bodyMap: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedRequestBodyCommand + */ +export const se_MalformedRequestBodyCommand = async ( + input: MalformedRequestBodyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedRequestBody"); + let body: any; + body = JSON.stringify( + take(input, { + float: (_) => __serializeFloat(_), + int: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedShortCommand + */ +export const se_MalformedShortCommand = async ( + input: MalformedShortCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_s]: [() => isSerializableHeaderValue(input[_sIH]), () => input[_sIH]!.toString()], + }); + b.bp("/MalformedShort/{shortInPath}"); + b.p("shortInPath", () => input.shortInPath!.toString(), "{shortInPath}", false); + const query: any = map({ + [_sIQ]: [() => input.shortInQuery !== void 0, () => input[_sIQ]!.toString()], + }); + let body: any; + body = JSON.stringify( + take(input, { + shortInBody: [], + }) + ); + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedStringCommand + */ +export const se_MalformedStringCommand = async ( + input: MalformedStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_amth]: [ + () => isSerializableHeaderValue(input[_bl]), + () => context.base64Encoder(Buffer.from(__LazyJsonString.from(input[_bl]!))), + ], + }); + b.bp("/MalformedString"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampBodyDateTimeCommand + */ +export const se_MalformedTimestampBodyDateTimeCommand = async ( + input: MalformedTimestampBodyDateTimeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedTimestampBodyDateTime"); + let body: any; + body = JSON.stringify( + take(input, { + timestamp: (_) => __serializeDateTime(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampBodyDefaultCommand + */ +export const se_MalformedTimestampBodyDefaultCommand = async ( + input: MalformedTimestampBodyDefaultCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedTimestampBodyDefault"); + let body: any; + body = JSON.stringify( + take(input, { + timestamp: (_) => _.getTime() / 1_000, + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampBodyHttpDateCommand + */ +export const se_MalformedTimestampBodyHttpDateCommand = async ( + input: MalformedTimestampBodyHttpDateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedTimestampBodyHttpDate"); + let body: any; + body = JSON.stringify( + take(input, { + timestamp: (_) => __dateToUtcString(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampHeaderDateTimeCommand + */ +export const se_MalformedTimestampHeaderDateTimeCommand = async ( + input: MalformedTimestampHeaderDateTimeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_t]: [() => isSerializableHeaderValue(input[_t]), () => __serializeDateTime(input[_t]!).toString()], + }); + b.bp("/MalformedTimestampHeaderDateTime"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampHeaderDefaultCommand + */ +export const se_MalformedTimestampHeaderDefaultCommand = async ( + input: MalformedTimestampHeaderDefaultCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_t]: [() => isSerializableHeaderValue(input[_t]), () => __dateToUtcString(input[_t]!).toString()], + }); + b.bp("/MalformedTimestampHeaderDefault"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampHeaderEpochCommand + */ +export const se_MalformedTimestampHeaderEpochCommand = async ( + input: MalformedTimestampHeaderEpochCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_t]: [() => isSerializableHeaderValue(input[_t]), () => (input[_t]!.getTime() / 1_000).toString()], + }); + b.bp("/MalformedTimestampHeaderEpoch"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampPathDefaultCommand + */ +export const se_MalformedTimestampPathDefaultCommand = async ( + input: MalformedTimestampPathDefaultCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedTimestampPathDefault/{timestamp}"); + b.p("timestamp", () => __serializeDateTime(input.timestamp!).toString(), "{timestamp}", false); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampPathEpochCommand + */ +export const se_MalformedTimestampPathEpochCommand = async ( + input: MalformedTimestampPathEpochCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedTimestampPathEpoch/{timestamp}"); + b.p("timestamp", () => (input.timestamp!.getTime() / 1_000).toString(), "{timestamp}", false); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampPathHttpDateCommand + */ +export const se_MalformedTimestampPathHttpDateCommand = async ( + input: MalformedTimestampPathHttpDateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedTimestampPathHttpDate/{timestamp}"); + b.p("timestamp", () => __dateToUtcString(input.timestamp!).toString(), "{timestamp}", false); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampQueryDefaultCommand + */ +export const se_MalformedTimestampQueryDefaultCommand = async ( + input: MalformedTimestampQueryDefaultCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedTimestampQueryDefault"); + const query: any = map({ + [_t]: [__expectNonNull(input.timestamp, `timestamp`) != null, () => __serializeDateTime(input[_t]!).toString()], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampQueryEpochCommand + */ +export const se_MalformedTimestampQueryEpochCommand = async ( + input: MalformedTimestampQueryEpochCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedTimestampQueryEpoch"); + const query: any = map({ + [_t]: [__expectNonNull(input.timestamp, `timestamp`) != null, () => (input[_t]!.getTime() / 1_000).toString()], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedTimestampQueryHttpDateCommand + */ +export const se_MalformedTimestampQueryHttpDateCommand = async ( + input: MalformedTimestampQueryHttpDateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/MalformedTimestampQueryHttpDate"); + const query: any = map({ + [_t]: [__expectNonNull(input.timestamp, `timestamp`) != null, () => __dateToUtcString(input[_t]!).toString()], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MalformedUnionCommand + */ +export const se_MalformedUnionCommand = async ( + input: MalformedUnionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/MalformedUnion"); + let body: any; + body = JSON.stringify( + take(input, { + union: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1MediaTypeHeaderCommand + */ +export const se_MediaTypeHeaderCommand = async ( + input: MediaTypeHeaderCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xj]: [ + () => isSerializableHeaderValue(input[_j]), + () => context.base64Encoder(Buffer.from(__LazyJsonString.from(input[_j]!))), + ], + }); + b.bp("/MediaTypeHeader"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1NoInputAndNoOutputCommand + */ +export const se_NoInputAndNoOutputCommand = async ( + input: NoInputAndNoOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/NoInputAndNoOutput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1NoInputAndOutputCommand + */ +export const se_NoInputAndOutputCommand = async ( + input: NoInputAndOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/NoInputAndOutputOutput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1NullAndEmptyHeadersClientCommand + */ +export const se_NullAndEmptyHeadersClientCommand = async ( + input: NullAndEmptyHeadersClientCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xa]: input[_a]!, + [_xb____]: input[_b_]!, + [_xc]: [() => isSerializableHeaderValue(input[_c]), () => (input[_c]! || []).map(__quoteHeader).join(", ")], + }); + b.bp("/NullAndEmptyHeadersClient"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1NullAndEmptyHeadersServerCommand + */ +export const se_NullAndEmptyHeadersServerCommand = async ( + input: NullAndEmptyHeadersServerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xa]: input[_a]!, + [_xb____]: input[_b_]!, + [_xc]: [() => isSerializableHeaderValue(input[_c]), () => (input[_c]! || []).map(__quoteHeader).join(", ")], + }); + b.bp("/NullAndEmptyHeadersServer"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1OmitsNullSerializesEmptyStringCommand + */ +export const se_OmitsNullSerializesEmptyStringCommand = async ( + input: OmitsNullSerializesEmptyStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/OmitsNullSerializesEmptyString"); + const query: any = map({ + [_N]: [, input[_nV]!], + [_Em]: [, input[_eS]!], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1OmitsSerializingEmptyListsCommand + */ +export const se_OmitsSerializingEmptyListsCommand = async ( + input: OmitsSerializingEmptyListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/OmitsSerializingEmptyLists"); + const query: any = map({ + [_SL]: [() => input.queryStringList !== void 0, () => input[_qSL]! || []], + [_IL]: [ + () => input.queryIntegerList !== void 0, + () => (input[_qIL]! || []).map((_entry) => _entry.toString() as any), + ], + [_DL]: [ + () => input.queryDoubleList !== void 0, + () => (input[_qDL]! || []).map((_entry) => (_entry % 1 == 0 ? _entry + ".0" : _entry.toString()) as any), + ], + [_BL]: [ + () => input.queryBooleanList !== void 0, + () => (input[_qBL]! || []).map((_entry) => _entry.toString() as any), + ], + [_TL]: [ + () => input.queryTimestampList !== void 0, + () => (input[_qTL]! || []).map((_entry) => __serializeDateTime(_entry).toString() as any), + ], + [_EL]: [() => input.queryEnumList !== void 0, () => input[_qEL]! || []], + [_IEL]: [ + () => input.queryIntegerEnumList !== void 0, + () => (input[_qIEL]! || []).map((_entry) => _entry.toString() as any), + ], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + 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 + */ +export const se_PostPlayerActionCommand = async ( + input: PostPlayerActionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/PostPlayerAction"); + let body: any; + body = JSON.stringify( + take(input, { + action: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1PostUnionWithJsonNameCommand + */ +export const se_PostUnionWithJsonNameCommand = async ( + input: PostUnionWithJsonNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/PostUnionWithJsonName"); + let body: any; + body = JSON.stringify( + take(input, { + value: (_) => se_UnionWithJsonName(_, context), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1PutWithContentEncodingCommand + */ +export const se_PutWithContentEncodingCommand = async ( + input: PutWithContentEncodingCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_ce]: input[_e]!, + }); + b.bp("/requestcompression/putcontentwithencoding"); + let body: any; + body = JSON.stringify( + take(input, { + data: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1QueryIdempotencyTokenAutoFillCommand + */ +export const se_QueryIdempotencyTokenAutoFillCommand = async ( + input: QueryIdempotencyTokenAutoFillCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/QueryIdempotencyTokenAutoFill"); + const query: any = map({ + [_to]: [, input[_to] ?? generateIdempotencyToken()], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1QueryParamsAsStringListMapCommand + */ +export const se_QueryParamsAsStringListMapCommand = async ( + input: QueryParamsAsStringListMapCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/StringListMap"); + const query: any = map({ + ...convertMap(input.foo), + [_co]: [, input[_q]!], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1QueryPrecedenceCommand + */ +export const se_QueryPrecedenceCommand = async ( + input: QueryPrecedenceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/Precedence"); + const query: any = map({ + ...convertMap(input.baz), + [_ba]: [, input[_f]!], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1RecursiveShapesCommand + */ +export const se_RecursiveShapesCommand = async ( + input: RecursiveShapesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/RecursiveShapes"); + let body: any; + body = JSON.stringify( + take(input, { + nested: (_) => se_RecursiveShapesInputOutputNested1(_, context), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ResponseCodeHttpFallbackCommand + */ +export const se_ResponseCodeHttpFallbackCommand = async ( + input: ResponseCodeHttpFallbackCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/responseCodeHttpFallback"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ResponseCodeRequiredCommand + */ +export const se_ResponseCodeRequiredCommand = async ( + input: ResponseCodeRequiredCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/responseCodeRequired"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1SimpleScalarPropertiesCommand + */ +export const se_SimpleScalarPropertiesCommand = async ( + input: SimpleScalarPropertiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_xf]: input[_f]!, + }); + b.bp("/SimpleScalarProperties"); + let body: any; + body = JSON.stringify( + take(input, { + byteValue: [], + DoubleDribble: [, (_) => __serializeFloat(_), `doubleValue`], + falseBooleanValue: [], + floatValue: (_) => __serializeFloat(_), + integerValue: [], + longValue: [], + shortValue: [], + stringValue: [], + trueBooleanValue: [], + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1SparseJsonListsCommand + */ +export const se_SparseJsonListsCommand = async ( + input: SparseJsonListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/SparseJsonLists"); + let body: any; + body = JSON.stringify( + take(input, { + sparseShortList: (_) => se_SparseShortList(_, context), + sparseStringList: (_) => se_SparseStringList(_, context), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1SparseJsonMapsCommand + */ +export const se_SparseJsonMapsCommand = async ( + input: SparseJsonMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/SparseJsonMaps"); + let body: any; + body = JSON.stringify( + take(input, { + sparseBooleanMap: (_) => se_SparseBooleanMap(_, context), + sparseNumberMap: (_) => se_SparseNumberMap(_, context), + sparseSetMap: (_) => se_SparseSetMap(_, context), + sparseStringMap: (_) => se_SparseStringMap(_, context), + sparseStructMap: (_) => se_SparseStructMap(_, context), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1StreamingTraitsCommand + */ +export const se_StreamingTraitsCommand = async ( + input: StreamingTraitsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/octet-stream", + [_xf]: input[_f]!, + }); + b.bp("/StreamingTraits"); + let body: any; + if (input.blob !== undefined) { + body = input.blob; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1StreamingTraitsRequireLengthCommand + */ +export const se_StreamingTraitsRequireLengthCommand = async ( + input: StreamingTraitsRequireLengthCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/octet-stream", + [_xf]: input[_f]!, + }); + b.bp("/StreamingTraitsRequireLength"); + let body: any; + if (input.blob !== undefined) { + body = input.blob; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1StreamingTraitsWithMediaTypeCommand + */ +export const se_StreamingTraitsWithMediaTypeCommand = async ( + input: StreamingTraitsWithMediaTypeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "text/plain", + [_xf]: input[_f]!, + }); + b.bp("/StreamingTraitsWithMediaType"); + let body: any; + if (input.blob !== undefined) { + body = input.blob; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TestBodyStructureCommand + */ +export const se_TestBodyStructureCommand = async ( + input: TestBodyStructureCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_xati]: input[_tI]!, + }); + b.bp("/body"); + let body: any; + body = JSON.stringify( + take(input, { + testConfig: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TestGetNoInputNoPayloadCommand + */ +export const se_TestGetNoInputNoPayloadCommand = async ( + input: TestGetNoInputNoPayloadCommandInput, + 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_restJson1TestGetNoPayloadCommand + */ +export const se_TestGetNoPayloadCommand = async ( + input: TestGetNoPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xati]: input[_tI]!, + }); + b.bp("/no_payload"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TestPayloadBlobCommand + */ +export const se_TestPayloadBlobCommand = async ( + input: TestPayloadBlobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_ct]: input[_cT] || "application/octet-stream", + }); + b.bp("/blob_payload"); + let body: any; + if (input.data !== undefined) { + body = input.data; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TestPayloadStructureCommand + */ +export const se_TestPayloadStructureCommand = async ( + input: TestPayloadStructureCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_xati]: input[_tI]!, + }); + b.bp("/payload"); + let body: any; + if (input.payloadConfig !== undefined) { + body = _json(input.payloadConfig); + } + if (body === undefined) { + body = {}; + } + body = JSON.stringify(body); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TestPostNoInputNoPayloadCommand + */ +export const se_TestPostNoInputNoPayloadCommand = async ( + input: TestPostNoInputNoPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/no_input_no_payload"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TestPostNoPayloadCommand + */ +export const se_TestPostNoPayloadCommand = async ( + input: TestPostNoPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xati]: input[_tI]!, + }); + b.bp("/no_payload"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TimestampFormatHeadersCommand + */ +export const se_TimestampFormatHeadersCommand = async ( + input: TimestampFormatHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xm]: [() => isSerializableHeaderValue(input[_mES]), () => (input[_mES]!.getTime() / 1_000).toString()], + [_xm_]: [() => isSerializableHeaderValue(input[_mHD]), () => __dateToUtcString(input[_mHD]!).toString()], + [_xm__]: [() => isSerializableHeaderValue(input[_mDT]), () => __serializeDateTime(input[_mDT]!).toString()], + [_xd_]: [() => isSerializableHeaderValue(input[_dF]), () => __dateToUtcString(input[_dF]!).toString()], + [_xt_]: [() => isSerializableHeaderValue(input[_tES]), () => (input[_tES]!.getTime() / 1_000).toString()], + [_xt__]: [() => isSerializableHeaderValue(input[_tHD]), () => __dateToUtcString(input[_tHD]!).toString()], + [_xt___]: [() => isSerializableHeaderValue(input[_tDT]), () => __serializeDateTime(input[_tDT]!).toString()], + }); + b.bp("/TimestampFormatHeaders"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UnitInputAndOutputCommand + */ +export const se_UnitInputAndOutputCommand = async ( + input: UnitInputAndOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/UnitInputAndOutput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * deserializeAws_restJson1AllQueryStringTypesCommand + */ +export const de_AllQueryStringTypesCommand = 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_restJson1ConstantAndVariableQueryStringCommand + */ +export const de_ConstantAndVariableQueryStringCommand = 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_restJson1ConstantQueryStringCommand + */ +export const de_ConstantQueryStringCommand = 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_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 + */ +export const de_DatetimeOffsetsCommand = 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, { + datetime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DocumentTypeCommand + */ +export const de_DocumentTypeCommand = 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, { + documentValue: (_) => de_Document(_, context), + stringValue: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DocumentTypeAsMapValueCommand + */ +export const de_DocumentTypeAsMapValueCommand = 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, { + docValuedMap: (_) => de_DocumentValuedMap(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DocumentTypeAsPayloadCommand + */ +export const de_DocumentTypeAsPayloadCommand = 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: any = await collectBodyString(output.body, context); + contents.documentValue = data; + contents.documentValue = JSON.parse(data); + return contents; +}; + +/** + * deserializeAws_restJson1EmptyInputAndEmptyOutputCommand + */ +export const de_EmptyInputAndEmptyOutputCommand = 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_restJson1EndpointOperationCommand + */ +export const de_EndpointOperationCommand = 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_restJson1EndpointWithHostLabelOperationCommand + */ +export const de_EndpointWithHostLabelOperationCommand = 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_restJson1FractionalSecondsCommand + */ +export const de_FractionalSecondsCommand = 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, { + datetime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GreetingWithErrorsCommand + */ +export const de_GreetingWithErrorsCommand = 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), + [_g]: [, output.headers[_xg]], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1HostWithPathOperationCommand + */ +export const de_HostWithPathOperationCommand = 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_restJson1HttpChecksumRequiredCommand + */ +export const de_HttpChecksumRequiredCommand = 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, { + foo: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1HttpEmptyPrefixHeadersCommand + */ +export const de_HttpEmptyPrefixHeadersCommand = 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), + [_sH]: [, output.headers[_h]], + prefixHeaders: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("")) + .reduce((acc, header) => { + acc[header.substring(0)] = output.headers[header]; + return acc; + }, {} as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1HttpEnumPayloadCommand + */ +export const de_HttpEnumPayloadCommand = 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: any = await collectBodyString(output.body, context); + contents.payload = __expectString(data); + return contents; +}; + +/** + * deserializeAws_restJson1HttpPayloadTraitsCommand + */ +export const de_HttpPayloadTraitsCommand = 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), + [_f]: [, output.headers[_xf]], + }); + const data: any = await collectBody(output.body, context); + contents.blob = data; + return contents; +}; + +/** + * deserializeAws_restJson1HttpPayloadTraitsWithMediaTypeCommand + */ +export const de_HttpPayloadTraitsWithMediaTypeCommand = 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), + [_f]: [, output.headers[_xf]], + }); + const data: any = await collectBody(output.body, context); + contents.blob = data; + return contents; +}; + +/** + * deserializeAws_restJson1HttpPayloadWithStructureCommand + */ +export const de_HttpPayloadWithStructureCommand = 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 | undefined = __expectObject(await parseBody(output.body, context)); + contents.nested = _json(data); + return contents; +}; + +/** + * deserializeAws_restJson1HttpPayloadWithUnionCommand + */ +export const de_HttpPayloadWithUnionCommand = 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 | undefined = await parseBody(output.body, context); + if (Object.keys(data ?? {}).length) { + contents.nested = __expectUnion(_json(data)); + } + return contents; +}; + +/** + * deserializeAws_restJson1HttpPrefixHeadersCommand + */ +export const de_HttpPrefixHeadersCommand = 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), + [_f]: [, output.headers[_xf]], + fooMap: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("x-foo-")) + .reduce((acc, header) => { + acc[header.substring(6)] = output.headers[header]; + return acc; + }, {} as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1HttpPrefixHeadersInResponseCommand + */ +export const de_HttpPrefixHeadersInResponseCommand = 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), + prefixHeaders: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("")) + .reduce((acc, header) => { + acc[header.substring(0)] = output.headers[header]; + return acc; + }, {} as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1HttpRequestWithFloatLabelsCommand + */ +export const de_HttpRequestWithFloatLabelsCommand = 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_restJson1HttpRequestWithGreedyLabelInPathCommand + */ +export const de_HttpRequestWithGreedyLabelInPathCommand = 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_restJson1HttpRequestWithLabelsCommand + */ +export const de_HttpRequestWithLabelsCommand = 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_restJson1HttpRequestWithLabelsAndTimestampFormatCommand + */ +export const de_HttpRequestWithLabelsAndTimestampFormatCommand = 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_restJson1HttpRequestWithRegexLiteralCommand + */ +export const de_HttpRequestWithRegexLiteralCommand = 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_restJson1HttpResponseCodeCommand + */ +export const de_HttpResponseCodeCommand = 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), + }); + map(contents, { + Status: [, output.statusCode], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1HttpStringPayloadCommand + */ +export const de_HttpStringPayloadCommand = 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: any = await collectBodyString(output.body, context); + contents.payload = __expectString(data); + return contents; +}; + +/** + * deserializeAws_restJson1IgnoreQueryParamsInResponseCommand + */ +export const de_IgnoreQueryParamsInResponseCommand = 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, { + baz: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1InputAndOutputWithHeadersCommand + */ +export const de_InputAndOutputWithHeadersCommand = 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), + [_hS]: [, output.headers[_xs]], + [_hB]: [() => void 0 !== output.headers[_xb], () => __strictParseByte(output.headers[_xb])], + [_hSe]: [() => void 0 !== output.headers[_xs_], () => __strictParseShort(output.headers[_xs_])], + [_hI]: [() => void 0 !== output.headers[_xi], () => __strictParseInt32(output.headers[_xi])], + [_hL]: [() => void 0 !== output.headers[_xl], () => __strictParseLong(output.headers[_xl])], + [_hF]: [() => void 0 !== output.headers[_xf_], () => __strictParseFloat(output.headers[_xf_])], + [_hD]: [() => void 0 !== output.headers[_xd], () => __strictParseDouble(output.headers[_xd])], + [_hTB]: [() => void 0 !== output.headers[_xb_], () => __parseBoolean(output.headers[_xb_])], + [_hFB]: [() => void 0 !== output.headers[_xb__], () => __parseBoolean(output.headers[_xb__])], + [_hSL]: [ + () => void 0 !== output.headers[_xs__], + () => __splitHeader(output.headers[_xs__] || "").map((_entry) => _entry.trim() as any), + ], + [_hSS]: [ + () => void 0 !== output.headers[_xs___], + () => __splitHeader(output.headers[_xs___] || "").map((_entry) => _entry.trim() as any), + ], + [_hIL]: [ + () => void 0 !== output.headers[_xi_], + () => __splitHeader(output.headers[_xi_] || "").map((_entry) => __strictParseInt32(_entry.trim()) as any), + ], + [_hBL]: [ + () => void 0 !== output.headers[_xb___], + () => __splitHeader(output.headers[_xb___] || "").map((_entry) => __parseBoolean(_entry.trim()) as any), + ], + [_hTL]: [ + () => void 0 !== output.headers[_xt], + () => + __splitEvery(output.headers[_xt] || "", ",", 2).map( + (_entry) => __expectNonNull(__parseRfc7231DateTime(_entry.trim())) as any + ), + ], + [_hE]: [, output.headers[_xe]], + [_hEL]: [ + () => void 0 !== output.headers[_xe_], + () => __splitHeader(output.headers[_xe_] || "").map((_entry) => _entry.trim() as any), + ], + [_hIE]: [() => void 0 !== output.headers[_xi__], () => __strictParseInt32(output.headers[_xi__])], + [_hIEL]: [ + () => void 0 !== output.headers[_xi___], + () => __splitHeader(output.headers[_xi___] || "").map((_entry) => __strictParseInt32(_entry.trim()) as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1JsonBlobsCommand + */ +export const de_JsonBlobsCommand = 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, { + data: context.base64Decoder, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1JsonEnumsCommand + */ +export const de_JsonEnumsCommand = 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, { + fooEnum1: __expectString, + fooEnum2: __expectString, + fooEnum3: __expectString, + fooEnumList: _json, + fooEnumMap: _json, + fooEnumSet: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1JsonIntEnumsCommand + */ +export const de_JsonIntEnumsCommand = 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, { + integerEnum1: __expectInt32, + integerEnum2: __expectInt32, + integerEnum3: __expectInt32, + integerEnumList: _json, + integerEnumMap: _json, + integerEnumSet: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1JsonListsCommand + */ +export const de_JsonListsCommand = 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, { + booleanList: _json, + enumList: _json, + intEnumList: _json, + integerList: _json, + nestedStringList: _json, + stringList: _json, + stringSet: _json, + structureList: [, (_) => de_StructureList(_, context), `myStructureList`], + timestampList: (_) => de_TimestampList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1JsonMapsCommand + */ +export const de_JsonMapsCommand = 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, { + denseBooleanMap: _json, + denseNumberMap: _json, + denseSetMap: _json, + denseStringMap: _json, + denseStructMap: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1JsonTimestampsCommand + */ +export const de_JsonTimestampsCommand = 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, { + dateTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + dateTimeOnTarget: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + epochSeconds: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + epochSecondsOnTarget: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + httpDate: (_) => __expectNonNull(__parseRfc7231DateTime(_)), + httpDateOnTarget: (_) => __expectNonNull(__parseRfc7231DateTime(_)), + normal: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1JsonUnionsCommand + */ +export const de_JsonUnionsCommand = 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, { + contents: (_) => de_MyUnion(__expectUnion(_), context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1MalformedAcceptWithBodyCommand + */ +export const de_MalformedAcceptWithBodyCommand = 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, { + hi: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1MalformedAcceptWithGenericStringCommand + */ +export const de_MalformedAcceptWithGenericStringCommand = 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: any = await collectBodyString(output.body, context); + contents.payload = __expectString(data); + return contents; +}; + +/** + * deserializeAws_restJson1MalformedAcceptWithPayloadCommand + */ +export const de_MalformedAcceptWithPayloadCommand = 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: any = await collectBody(output.body, context); + contents.payload = data; + return contents; +}; + +/** + * deserializeAws_restJson1MalformedBlobCommand + */ +export const de_MalformedBlobCommand = 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_restJson1MalformedBooleanCommand + */ +export const de_MalformedBooleanCommand = 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_restJson1MalformedByteCommand + */ +export const de_MalformedByteCommand = 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_restJson1MalformedContentTypeWithBodyCommand + */ +export const de_MalformedContentTypeWithBodyCommand = 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_restJson1MalformedContentTypeWithGenericStringCommand + */ +export const de_MalformedContentTypeWithGenericStringCommand = 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_restJson1MalformedContentTypeWithoutBodyCommand + */ +export const de_MalformedContentTypeWithoutBodyCommand = 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_restJson1MalformedContentTypeWithoutBodyEmptyInputCommand + */ +export const de_MalformedContentTypeWithoutBodyEmptyInputCommand = 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_restJson1MalformedContentTypeWithPayloadCommand + */ +export const de_MalformedContentTypeWithPayloadCommand = 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_restJson1MalformedDoubleCommand + */ +export const de_MalformedDoubleCommand = 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_restJson1MalformedFloatCommand + */ +export const de_MalformedFloatCommand = 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_restJson1MalformedIntegerCommand + */ +export const de_MalformedIntegerCommand = 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_restJson1MalformedListCommand + */ +export const de_MalformedListCommand = 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_restJson1MalformedLongCommand + */ +export const de_MalformedLongCommand = 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_restJson1MalformedMapCommand + */ +export const de_MalformedMapCommand = 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_restJson1MalformedRequestBodyCommand + */ +export const de_MalformedRequestBodyCommand = 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_restJson1MalformedShortCommand + */ +export const de_MalformedShortCommand = 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_restJson1MalformedStringCommand + */ +export const de_MalformedStringCommand = 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_restJson1MalformedTimestampBodyDateTimeCommand + */ +export const de_MalformedTimestampBodyDateTimeCommand = 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_restJson1MalformedTimestampBodyDefaultCommand + */ +export const de_MalformedTimestampBodyDefaultCommand = 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_restJson1MalformedTimestampBodyHttpDateCommand + */ +export const de_MalformedTimestampBodyHttpDateCommand = 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_restJson1MalformedTimestampHeaderDateTimeCommand + */ +export const de_MalformedTimestampHeaderDateTimeCommand = 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_restJson1MalformedTimestampHeaderDefaultCommand + */ +export const de_MalformedTimestampHeaderDefaultCommand = 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_restJson1MalformedTimestampHeaderEpochCommand + */ +export const de_MalformedTimestampHeaderEpochCommand = 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_restJson1MalformedTimestampPathDefaultCommand + */ +export const de_MalformedTimestampPathDefaultCommand = 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_restJson1MalformedTimestampPathEpochCommand + */ +export const de_MalformedTimestampPathEpochCommand = 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_restJson1MalformedTimestampPathHttpDateCommand + */ +export const de_MalformedTimestampPathHttpDateCommand = 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_restJson1MalformedTimestampQueryDefaultCommand + */ +export const de_MalformedTimestampQueryDefaultCommand = 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_restJson1MalformedTimestampQueryEpochCommand + */ +export const de_MalformedTimestampQueryEpochCommand = 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_restJson1MalformedTimestampQueryHttpDateCommand + */ +export const de_MalformedTimestampQueryHttpDateCommand = 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_restJson1MalformedUnionCommand + */ +export const de_MalformedUnionCommand = 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_restJson1MediaTypeHeaderCommand + */ +export const de_MediaTypeHeaderCommand = 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), + [_j]: [ + () => void 0 !== output.headers[_xj], + () => __LazyJsonString.from(Buffer.from(context.base64Decoder(output.headers[_xj])).toString("utf8")), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1NoInputAndNoOutputCommand + */ +export const de_NoInputAndNoOutputCommand = 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_restJson1NoInputAndOutputCommand + */ +export const de_NoInputAndOutputCommand = 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_restJson1NullAndEmptyHeadersClientCommand + */ +export const de_NullAndEmptyHeadersClientCommand = 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), + [_a]: [, output.headers[_xa]], + [_b_]: [, output.headers[_xb____]], + [_c]: [ + () => void 0 !== output.headers[_xc], + () => __splitHeader(output.headers[_xc] || "").map((_entry) => _entry.trim() as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1NullAndEmptyHeadersServerCommand + */ +export const de_NullAndEmptyHeadersServerCommand = 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), + [_a]: [, output.headers[_xa]], + [_b_]: [, output.headers[_xb____]], + [_c]: [ + () => void 0 !== output.headers[_xc], + () => __splitHeader(output.headers[_xc] || "").map((_entry) => _entry.trim() as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1OmitsNullSerializesEmptyStringCommand + */ +export const de_OmitsNullSerializesEmptyStringCommand = 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_restJson1OmitsSerializingEmptyListsCommand + */ +export const de_OmitsSerializingEmptyListsCommand = 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_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 + */ +export const de_PostPlayerActionCommand = 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, { + action: (_) => _json(__expectUnion(_)), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PostUnionWithJsonNameCommand + */ +export const de_PostUnionWithJsonNameCommand = 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, { + value: (_) => de_UnionWithJsonName(__expectUnion(_), context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PutWithContentEncodingCommand + */ +export const de_PutWithContentEncodingCommand = 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_restJson1QueryIdempotencyTokenAutoFillCommand + */ +export const de_QueryIdempotencyTokenAutoFillCommand = 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_restJson1QueryParamsAsStringListMapCommand + */ +export const de_QueryParamsAsStringListMapCommand = 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_restJson1QueryPrecedenceCommand + */ +export const de_QueryPrecedenceCommand = 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_restJson1RecursiveShapesCommand + */ +export const de_RecursiveShapesCommand = 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, { + nested: (_) => de_RecursiveShapesInputOutputNested1(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ResponseCodeHttpFallbackCommand + */ +export const de_ResponseCodeHttpFallbackCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1ResponseCodeRequiredCommand + */ +export const de_ResponseCodeRequiredCommand = 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), + }); + map(contents, { + responseCode: [, output.statusCode], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1SimpleScalarPropertiesCommand + */ +export const de_SimpleScalarPropertiesCommand = 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), + [_f]: [, output.headers[_xf]], + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + byteValue: __expectByte, + doubleValue: [, __limitedParseDouble, `DoubleDribble`], + falseBooleanValue: __expectBoolean, + floatValue: __limitedParseFloat32, + integerValue: __expectInt32, + longValue: __expectLong, + shortValue: __expectShort, + stringValue: __expectString, + trueBooleanValue: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1SparseJsonListsCommand + */ +export const de_SparseJsonListsCommand = 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, { + sparseShortList: (_) => de_SparseShortList(_, context), + sparseStringList: (_) => de_SparseStringList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1SparseJsonMapsCommand + */ +export const de_SparseJsonMapsCommand = 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, { + sparseBooleanMap: (_) => de_SparseBooleanMap(_, context), + sparseNumberMap: (_) => de_SparseNumberMap(_, context), + sparseSetMap: (_) => de_SparseSetMap(_, context), + sparseStringMap: (_) => de_SparseStringMap(_, context), + sparseStructMap: (_) => de_SparseStructMap(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1StreamingTraitsCommand + */ +export const de_StreamingTraitsCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __SdkStreamSerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_f]: [, output.headers[_xf]], + }); + const data: any = output.body; + context.sdkStreamMixin(data); + contents.blob = data; + return contents; +}; + +/** + * deserializeAws_restJson1StreamingTraitsRequireLengthCommand + */ +export const de_StreamingTraitsRequireLengthCommand = 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_restJson1StreamingTraitsWithMediaTypeCommand + */ +export const de_StreamingTraitsWithMediaTypeCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __SdkStreamSerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_f]: [, output.headers[_xf]], + }); + const data: any = output.body; + context.sdkStreamMixin(data); + contents.blob = data; + return contents; +}; + +/** + * deserializeAws_restJson1TestBodyStructureCommand + */ +export const de_TestBodyStructureCommand = 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]], + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + testConfig: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1TestGetNoInputNoPayloadCommand + */ +export const de_TestGetNoInputNoPayloadCommand = 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_restJson1TestGetNoPayloadCommand + */ +export const de_TestGetNoPayloadCommand = 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_restJson1TestPayloadBlobCommand + */ +export const de_TestPayloadBlobCommand = 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), + [_cT]: [, output.headers[_ct]], + }); + const data: any = await collectBody(output.body, context); + contents.data = data; + return contents; +}; + +/** + * deserializeAws_restJson1TestPayloadStructureCommand + */ +export const de_TestPayloadStructureCommand = 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]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.payloadConfig = _json(data); + return contents; +}; + +/** + * deserializeAws_restJson1TestPostNoInputNoPayloadCommand + */ +export const de_TestPostNoInputNoPayloadCommand = 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_restJson1TestPostNoPayloadCommand + */ +export const de_TestPostNoPayloadCommand = 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_restJson1TimestampFormatHeadersCommand + */ +export const de_TimestampFormatHeadersCommand = 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), + [_mES]: [() => void 0 !== output.headers[_xm], () => __expectNonNull(__parseEpochTimestamp(output.headers[_xm]))], + [_mHD]: [ + () => void 0 !== output.headers[_xm_], + () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xm_])), + ], + [_mDT]: [ + () => void 0 !== output.headers[_xm__], + () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xm__])), + ], + [_dF]: [() => void 0 !== output.headers[_xd_], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xd_]))], + [_tES]: [() => void 0 !== output.headers[_xt_], () => __expectNonNull(__parseEpochTimestamp(output.headers[_xt_]))], + [_tHD]: [ + () => void 0 !== output.headers[_xt__], + () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xt__])), + ], + [_tDT]: [ + () => void 0 !== output.headers[_xt___], + () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xt___])), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UnitInputAndOutputCommand + */ +export const de_UnitInputAndOutputCommand = 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; +}; + +/** + * deserialize_Aws_restJson1CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.restjson#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "FooError": + case "aws.protocoltests.restjson#FooError": + throw await de_FooErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.restjson#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } +}; + +const throwDefaultError = withBaseException(__BaseException); +/** + * deserializeAws_restJson1ComplexErrorRes + */ +const de_ComplexErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({ + [_H]: [, parsedOutput.headers[_xh]], + }); + const data: any = parsedOutput.body; + const doc = take(data, { + Nested: (_) => de_ComplexNestedErrorData(_, context), + TopLevel: __expectString, + }); + Object.assign(contents, doc); + const exception = new ComplexError({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1FooErrorRes + */ +const de_FooErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, {}); + Object.assign(contents, doc); + const exception = new FooError({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InvalidGreetingRes + */ +const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + Message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InvalidGreeting({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + 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. + +// se_DenseSetMap omitted. + +// se_DenseStringMap omitted. + +// se_DenseStructMap omitted. + +// se_Dialog omitted. + +// se_DialogList omitted. + +// se_DialogMap omitted. + +/** + * serializeAws_restJson1Document + */ +const se_Document = (input: __DocumentType, context: __SerdeContext): any => { + return input; +}; + +/** + * serializeAws_restJson1DocumentValuedMap + */ +const se_DocumentValuedMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + acc[key] = se_Document(value, context); + return acc; + }, {}); +}; + +// se_Farewell omitted. + +/** + * serializeAws_restJson1MyUnion + */ +const se_MyUnion = (input: MyUnion, context: __SerdeContext): any => { + return MyUnion.visit(input, { + blobValue: (value) => ({ blobValue: context.base64Encoder(value) }), + booleanValue: (value) => ({ booleanValue: value }), + enumValue: (value) => ({ enumValue: value }), + listValue: (value) => ({ listValue: _json(value) }), + mapValue: (value) => ({ mapValue: _json(value) }), + numberValue: (value) => ({ numberValue: value }), + renamedStructureValue: (value) => ({ renamedStructureValue: _json(value) }), + stringValue: (value) => ({ stringValue: value }), + structureValue: (value) => ({ structureValue: _json(value) }), + timestampValue: (value) => ({ timestampValue: value.getTime() / 1_000 }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + +// se_NestedPayload omitted. + +// se_PayloadConfig omitted. + +// se_PlayerAction omitted. + +/** + * serializeAws_restJson1RecursiveShapesInputOutputNested1 + */ +const se_RecursiveShapesInputOutputNested1 = ( + input: RecursiveShapesInputOutputNested1, + context: __SerdeContext +): any => { + return take(input, { + foo: [], + nested: (_) => se_RecursiveShapesInputOutputNested2(_, context), + }); +}; + +/** + * serializeAws_restJson1RecursiveShapesInputOutputNested2 + */ +const se_RecursiveShapesInputOutputNested2 = ( + input: RecursiveShapesInputOutputNested2, + context: __SerdeContext +): any => { + return take(input, { + bar: [], + recursiveMember: (_) => se_RecursiveShapesInputOutputNested1(_, context), + }); +}; + +// se_SimpleList omitted. + +// se_SimpleMap omitted. + +// se_SimpleUnion omitted. + +/** + * serializeAws_restJson1SparseBooleanMap + */ +const se_SparseBooleanMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key] = null as any; + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; + +/** + * serializeAws_restJson1SparseNumberMap + */ +const se_SparseNumberMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key] = null as any; + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; + +/** + * serializeAws_restJson1SparseSetMap + */ +const se_SparseSetMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key] = null as any; + return acc; + } + acc[key] = _json(value); + return acc; + }, {}); +}; + +/** + * serializeAws_restJson1SparseStructMap + */ +const se_SparseStructMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key] = null as any; + return acc; + } + acc[key] = _json(value); + return acc; + }, {}); +}; + +/** + * serializeAws_restJson1StructureList + */ +const se_StructureList = (input: StructureListMember[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_StructureListMember(entry, context); + }); +}; + +/** + * serializeAws_restJson1StructureListMember + */ +const se_StructureListMember = (input: StructureListMember, context: __SerdeContext): any => { + return take(input, { + value: [, , `a`], + other: [, , `b`], + }); +}; + +// se_TestConfig omitted. + +// se_TestStringList omitted. + +// se_TestStringMap omitted. + +// se_TopLevel omitted. + +// se_UnionPayload omitted. + +/** + * serializeAws_restJson1UnionWithJsonName + */ +const se_UnionWithJsonName = (input: UnionWithJsonName, context: __SerdeContext): any => { + return UnionWithJsonName.visit(input, { + bar: (value) => ({ bar: value }), + baz: (value) => ({ _baz: value }), + foo: (value) => ({ FOO: value }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + +// se_RenamedGreeting omitted. + +// se_BooleanList omitted. + +// se_FooEnumList omitted. + +// se_FooEnumMap omitted. + +// se_FooEnumSet omitted. + +// se_GreetingStruct omitted. + +// se_IntegerEnumList omitted. + +// se_IntegerEnumMap omitted. + +// se_IntegerEnumSet omitted. + +// se_IntegerList omitted. + +// se_NestedStringList omitted. + +/** + * serializeAws_restJson1SparseShortList + */ +const se_SparseShortList = (input: number[], context: __SerdeContext): any => { + return input; +}; + +/** + * serializeAws_restJson1SparseStringList + */ +const se_SparseStringList = (input: string[], context: __SerdeContext): any => { + return input; +}; + +/** + * serializeAws_restJson1SparseStringMap + */ +const se_SparseStringMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key] = null as any; + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; + +// se_StringList omitted. + +// se_StringMap omitted. + +// se_StringSet omitted. + +/** + * serializeAws_restJson1TimestampList + */ +const se_TimestampList = (input: Date[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry.getTime() / 1_000; + }); +}; + +// se_Unit omitted. + +/** + * deserializeAws_restJson1ComplexNestedErrorData + */ +const de_ComplexNestedErrorData = (output: any, context: __SerdeContext): ComplexNestedErrorData => { + return take(output, { + Foo: [, __expectString, `Fooooo`], + }) as any; +}; + +// de_DenseBooleanMap omitted. + +// de_DenseNumberMap omitted. + +// de_DenseSetMap omitted. + +// de_DenseStringMap omitted. + +// de_DenseStructMap omitted. + +// de_Dialog omitted. + +// de_DialogList omitted. + +// de_DialogMap omitted. + +/** + * deserializeAws_restJson1Document + */ +const de_Document = (output: any, context: __SerdeContext): __DocumentType => { + return output; +}; + +/** + * deserializeAws_restJson1DocumentValuedMap + */ +const de_DocumentValuedMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + acc[key as string] = de_Document(value, context); + return acc; + }, {} as Record); +}; + +// de_Farewell omitted. + +/** + * deserializeAws_restJson1MyUnion + */ +const de_MyUnion = (output: any, context: __SerdeContext): MyUnion => { + if (output.blobValue != null) { + return { + blobValue: context.base64Decoder(output.blobValue), + }; + } + if (__expectBoolean(output.booleanValue) !== undefined) { + return { booleanValue: __expectBoolean(output.booleanValue) as any }; + } + if (__expectString(output.enumValue) !== undefined) { + return { enumValue: __expectString(output.enumValue) as any }; + } + if (output.listValue != null) { + return { + listValue: _json(output.listValue), + }; + } + if (output.mapValue != null) { + return { + mapValue: _json(output.mapValue), + }; + } + if (__expectInt32(output.numberValue) !== undefined) { + return { numberValue: __expectInt32(output.numberValue) as any }; + } + if (output.renamedStructureValue != null) { + return { + renamedStructureValue: _json(output.renamedStructureValue), + }; + } + if (__expectString(output.stringValue) !== undefined) { + return { stringValue: __expectString(output.stringValue) as any }; + } + if (output.structureValue != null) { + return { + structureValue: _json(output.structureValue), + }; + } + if (output.timestampValue != null) { + return { + timestampValue: __expectNonNull(__parseEpochTimestamp(__expectNumber(output.timestampValue))), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +// de_NestedPayload omitted. + +// de_PayloadConfig omitted. + +// de_PlayerAction omitted. + +/** + * deserializeAws_restJson1RecursiveShapesInputOutputNested1 + */ +const de_RecursiveShapesInputOutputNested1 = ( + output: any, + context: __SerdeContext +): RecursiveShapesInputOutputNested1 => { + return take(output, { + foo: __expectString, + nested: (_: any) => de_RecursiveShapesInputOutputNested2(_, context), + }) as any; +}; + +/** + * deserializeAws_restJson1RecursiveShapesInputOutputNested2 + */ +const de_RecursiveShapesInputOutputNested2 = ( + output: any, + context: __SerdeContext +): RecursiveShapesInputOutputNested2 => { + return take(output, { + bar: __expectString, + recursiveMember: (_: any) => de_RecursiveShapesInputOutputNested1(_, context), + }) as any; +}; + +/** + * deserializeAws_restJson1SparseBooleanMap + */ +const de_SparseBooleanMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key as string] = null as any; + return acc; + } + acc[key as string] = __expectBoolean(value) as any; + return acc; + }, {} as Record); +}; + +/** + * deserializeAws_restJson1SparseNumberMap + */ +const de_SparseNumberMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key as string] = null as any; + return acc; + } + acc[key as string] = __expectInt32(value) as any; + return acc; + }, {} as Record); +}; + +/** + * deserializeAws_restJson1SparseSetMap + */ +const de_SparseSetMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key as string] = null as any; + return acc; + } + acc[key as string] = _json(value); + return acc; + }, {} as Record); +}; + +/** + * deserializeAws_restJson1SparseStructMap + */ +const de_SparseStructMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key as string] = null as any; + return acc; + } + acc[key as string] = _json(value); + return acc; + }, {} as Record); +}; + +/** + * deserializeAws_restJson1StructureList + */ +const de_StructureList = (output: any, context: __SerdeContext): StructureListMember[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StructureListMember(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1StructureListMember + */ +const de_StructureListMember = (output: any, context: __SerdeContext): StructureListMember => { + return take(output, { + a: [, __expectString, `value`], + b: [, __expectString, `other`], + }) as any; +}; + +// de_TestConfig omitted. + +// de_TestStringList omitted. + +// de_TestStringMap omitted. + +// de_UnionPayload omitted. + +/** + * deserializeAws_restJson1UnionWithJsonName + */ +const de_UnionWithJsonName = (output: any, context: __SerdeContext): UnionWithJsonName => { + if (__expectString(output.bar) !== undefined) { + return { bar: __expectString(output.bar) as any }; + } + if (__expectString(output._baz) !== undefined) { + return { baz: __expectString(output._baz) as any }; + } + if (__expectString(output.FOO) !== undefined) { + return { foo: __expectString(output.FOO) as any }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +// de_RenamedGreeting omitted. + +// de_BooleanList omitted. + +// de_FooEnumList omitted. + +// de_FooEnumMap omitted. + +// de_FooEnumSet omitted. + +// de_GreetingStruct omitted. + +// de_IntegerEnumList omitted. + +// de_IntegerEnumMap omitted. + +// de_IntegerEnumSet omitted. + +// de_IntegerList omitted. + +// de_NestedStringList omitted. + +/** + * deserializeAws_restJson1SparseShortList + */ +const de_SparseShortList = (output: any, context: __SerdeContext): number[] => { + const retVal = (output || []).map((entry: any) => { + if (entry === null) { + return null as any; + } + return __expectShort(entry) as any; + }); + return retVal; +}; + +/** + * deserializeAws_restJson1SparseStringList + */ +const de_SparseStringList = (output: any, context: __SerdeContext): string[] => { + const retVal = (output || []).map((entry: any) => { + if (entry === null) { + return null as any; + } + return __expectString(entry) as any; + }); + return retVal; +}; + +/** + * deserializeAws_restJson1SparseStringMap + */ +const de_SparseStringMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + acc[key as string] = null as any; + return acc; + } + acc[key as string] = __expectString(value) as any; + return acc; + }, {} as Record); +}; + +// de_StringList omitted. + +// de_StringMap omitted. + +// de_StringSet omitted. + +/** + * deserializeAws_restJson1TimestampList + */ +const de_TimestampList = (output: any, context: __SerdeContext): Date[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectNonNull(__parseEpochTimestamp(__expectNumber(entry))); + }); + return retVal; +}; + +// de_Unit omitted. + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const _B = "Byte"; +const _BL = "BooleanList"; +const _Bo = "Boolean"; +const _D = "Double"; +const _DL = "DoubleList"; +const _E = "Enum"; +const _EL = "EnumList"; +const _Em = "Empty"; +const _F = "Float"; +const _H = "Header"; +const _I = "Integer"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IL = "IntegerList"; +const _IS = "IntegerSet"; +const _L = "Long"; +const _N = "Null"; +const _S = "String"; +const _SL = "StringList"; +const _SS = "StringSet"; +const _Sh = "Short"; +const _T = "Timestamp"; +const _TL = "TimestampList"; +const _a = "a"; +const _amth = "amz-media-typed-header"; +const _b = "baz"; +const _bIH = "booleanInHeader"; +const _bIHy = "byteInHeader"; +const _bIQ = "booleanInQuery"; +const _bIQy = "byteInQuery"; +const _b_ = "b"; +const _ba = "bar"; +const _bl = "blob"; +const _bo = "booleaninheader"; +const _by = "byteinheader"; +const _c = "c"; +const _cT = "contentType"; +const _ce = "content-encoding"; +const _co = "corge"; +const _ct = "content-type"; +const _d = "doubleinheader"; +const _dF = "defaultFormat"; +const _dIH = "doubleInHeader"; +const _dIQ = "doubleInQuery"; +const _e = "encoding"; +const _eS = "emptyString"; +const _f = "foo"; +const _fIH = "floatInHeader"; +const _fIQ = "floatInQuery"; +const _fl = "floatinheader"; +const _g = "greeting"; +const _h = "hello"; +const _hB = "headerByte"; +const _hBL = "headerBooleanList"; +const _hD = "headerDouble"; +const _hE = "headerEnum"; +const _hEL = "headerEnumList"; +const _hF = "headerFloat"; +const _hFB = "headerFalseBool"; +const _hI = "headerInteger"; +const _hIE = "headerIntegerEnum"; +const _hIEL = "headerIntegerEnumList"; +const _hIL = "headerIntegerList"; +const _hL = "headerLong"; +const _hS = "headerString"; +const _hSL = "headerStringList"; +const _hSS = "headerStringSet"; +const _hSe = "headerShort"; +const _hTB = "headerTrueBool"; +const _hTL = "headerTimestampList"; +const _he = "header"; +const _i = "integerinheader"; +const _iIH = "integerInHeader"; +const _iIQ = "integerInQuery"; +const _j = "json"; +const _l = "longinheader"; +const _lIH = "longInHeader"; +const _lIQ = "longInQuery"; +const _mDT = "memberDateTime"; +const _mES = "memberEpochSeconds"; +const _mHD = "memberHttpDate"; +const _mS = "maybeSet"; +const _nV = "nullValue"; +const _q = "qux"; +const _qB = "queryByte"; +const _qBL = "queryBooleanList"; +const _qBu = "queryBoolean"; +const _qD = "queryDouble"; +const _qDL = "queryDoubleList"; +const _qE = "queryEnum"; +const _qEL = "queryEnumList"; +const _qF = "queryFloat"; +const _qI = "queryInteger"; +const _qIE = "queryIntegerEnum"; +const _qIEL = "queryIntegerEnumList"; +const _qIL = "queryIntegerList"; +const _qIS = "queryIntegerSet"; +const _qL = "queryLong"; +const _qS = "queryString"; +const _qSL = "queryStringList"; +const _qSS = "queryStringSet"; +const _qSu = "queryShort"; +const _qT = "queryTimestamp"; +const _qTL = "queryTimestampList"; +const _s = "shortinheader"; +const _sH = "specificHeader"; +const _sIH = "shortInHeader"; +const _sIQ = "shortInQuery"; +const _t = "timestamp"; +const _tDT = "targetDateTime"; +const _tES = "targetEpochSeconds"; +const _tHD = "targetHttpDate"; +const _tI = "testId"; +const _to = "token"; +const _xa = "x-a"; +const _xati = "x-amz-test-id"; +const _xb = "x-byte"; +const _xb_ = "x-boolean1"; +const _xb__ = "x-boolean2"; +const _xb___ = "x-booleanlist"; +const _xb____ = "x-b"; +const _xc = "x-c"; +const _xd = "x-double"; +const _xd_ = "x-defaultformat"; +const _xe = "x-enum"; +const _xe_ = "x-enumlist"; +const _xf = "x-foo"; +const _xf_ = "x-float"; +const _xg = "x-greeting"; +const _xh = "x-header"; +const _xi = "x-integer"; +const _xi_ = "x-integerlist"; +const _xi__ = "x-integerenum"; +const _xi___ = "x-integerenumlist"; +const _xj = "x-json"; +const _xl = "x-long"; +const _xm = "x-memberepochseconds"; +const _xm_ = "x-memberhttpdate"; +const _xm__ = "x-memberdatetime"; +const _xs = "x-string"; +const _xs_ = "x-short"; +const _xs__ = "x-stringlist"; +const _xs___ = "x-stringset"; +const _xt = "x-timestamplist"; +const _xt_ = "x-targetepochseconds"; +const _xt__ = "x-targethttpdate"; +const _xt___ = "x-targetdatetime"; diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.browser.ts new file mode 100644 index 0000000000000..397966de10cf6 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.browser.ts @@ -0,0 +1,55 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { blobHasher as streamHasher } from "@smithy/hash-blob-browser"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { Md5 } from "@smithy/md5-js"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + md5: config?.md5 ?? Md5, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.native.ts new file mode 100644 index 0000000000000..48bc89d417bd9 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.shared.ts b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.shared.ts new file mode 100644 index 0000000000000..515ae49bb8cb6 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.shared.ts @@ -0,0 +1,42 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { AwsRestJsonProtocol } from "@aws-sdk/core/protocols"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { sdkStreamMixin } from "@smithy/util-stream"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultRestJsonProtocolHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { + return { + apiVersion: "2019-12-16", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultRestJsonProtocolHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + protocol: config?.protocol ?? new AwsRestJsonProtocol({ defaultNamespace: "aws.protocoltests.restjson" }), + sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin, + serviceId: config?.serviceId ?? "Rest Json Protocol", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.ts b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.ts new file mode 100644 index 0000000000000..f5f4b2fb3ca27 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.ts @@ -0,0 +1,84 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { fileStreamHasher as streamHasher } from "@smithy/hash-stream-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: + config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + md5: config?.md5 ?? Hash.bind(null, "md5"), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), + retryMode: + config?.retryMode ?? + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeExtensions.ts b/private/aws-protocoltests-restjson-schema/src/runtimeExtensions.ts new file mode 100644 index 0000000000000..3f59e35d6fb62 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/runtimeExtensions.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { RestJsonProtocolExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: RestJsonProtocolExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: RestJsonProtocolExtensionConfiguration = Object.assign( + getAwsRegionExtensionConfiguration(runtimeConfig), + getDefaultExtensionConfiguration(runtimeConfig), + getHttpHandlerExtensionConfiguration(runtimeConfig), + getHttpAuthExtensionConfiguration(runtimeConfig) + ); + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return Object.assign( + runtimeConfig, + resolveAwsRegionExtensionConfiguration(extensionConfiguration), + resolveDefaultRuntimeConfig(extensionConfiguration), + resolveHttpHandlerRuntimeConfig(extensionConfiguration), + resolveHttpAuthRuntimeConfig(extensionConfiguration) + ); +}; diff --git a/private/aws-protocoltests-restjson-schema/src/schemas/schemas.ts b/private/aws-protocoltests-restjson-schema/src/schemas/schemas.ts new file mode 100644 index 0000000000000..b462c782854da --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/schemas/schemas.ts @@ -0,0 +1,3178 @@ +const _ = ""; +const _AQST = "AllQueryStringTypes"; +const _AQSTI = "AllQueryStringTypesInput"; +const _B = "Byte"; +const _BL = "BooleanList"; +const _Bl = "Blob"; +const _Bo = "Boolean"; +const _CAVQS = "ConstantAndVariableQueryString"; +const _CAVQSI = "ConstantAndVariableQueryStringInput"; +const _CE = "ComplexError"; +const _CE_ = "Content-Encoding"; +const _CNED = "ComplexNestedErrorData"; +const _COD = "ClientOptionalDefaults"; +const _CQS = "ConstantQueryString"; +const _CQSI = "ConstantQueryStringInput"; +const _CT = "Content-Type"; +const _CTP = "ContentTypeParameters"; +const _CTPI = "ContentTypeParametersInput"; +const _CTPO = "ContentTypeParametersOutput"; +const _D = "Double"; +const _DBM = "DenseBooleanMap"; +const _DD = "DoubleDribble"; +const _DL = "DoubleList"; +const _DLi = "DialogList"; +const _DM = "DialogMap"; +const _DNM = "DenseNumberMap"; +const _DO = "DatetimeOffsets"; +const _DOO = "DatetimeOffsetsOutput"; +const _DSM = "DenseStringMap"; +const _DSMe = "DenseSetMap"; +const _DSMen = "DenseStructMap"; +const _DT = "DateTime"; +const _DTAMV = "DocumentTypeAsMapValue"; +const _DTAMVIO = "DocumentTypeAsMapValueInputOutput"; +const _DTAP = "DocumentTypeAsPayload"; +const _DTAPIO = "DocumentTypeAsPayloadInputOutput"; +const _DTIO = "DocumentTypeInputOutput"; +const _DTo = "DocumentType"; +const _DVM = "DocumentValuedMap"; +const _De = "Defaults"; +const _Di = "Dialog"; +const _E = "Enum"; +const _EIAEO = "EmptyInputAndEmptyOutput"; +const _EIAEOI = "EmptyInputAndEmptyOutputInput"; +const _EIAEOO = "EmptyInputAndEmptyOutputOutput"; +const _EL = "EnumList"; +const _EO = "EndpointOperation"; +const _EPI = "EnumPayloadInput"; +const _ES = "EpochSeconds"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _Em = "Empty"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FEL = "FooEnumList"; +const _FEM = "FooEnumMap"; +const _FES = "FooEnumSet"; +const _FEo = "FooError"; +const _FOO = "FOO"; +const _FS = "FractionalSeconds"; +const _FSB = "FiniteStreamingBlob"; +const _FSO = "FractionalSecondsOutput"; +const _Fa = "Farewell"; +const _Fo = "Foo"; +const _Foo = "Fooooo"; +const _GS = "GreetingStruct"; +const _GWE = "GreetingWithErrors"; +const _GWEO = "GreetingWithErrorsOutput"; +const _H = "Header"; +const _HCR = "HttpChecksumRequired"; +const _HCRIO = "HttpChecksumRequiredInputOutput"; +const _HD = "HttpDate"; +const _HEP = "HttpEnumPayload"; +const _HEPH = "HttpEmptyPrefixHeaders"; +const _HEPHI = "HttpEmptyPrefixHeadersInput"; +const _HEPHO = "HttpEmptyPrefixHeadersOutput"; +const _HLI = "HostLabelInput"; +const _HPH = "HttpPrefixHeaders"; +const _HPHI = "HttpPrefixHeadersInput"; +const _HPHIR = "HttpPrefixHeadersInResponse"; +const _HPHIRI = "HttpPrefixHeadersInResponseInput"; +const _HPHIRO = "HttpPrefixHeadersInResponseOutput"; +const _HPHO = "HttpPrefixHeadersOutput"; +const _HPT = "HttpPayloadTraits"; +const _HPTIO = "HttpPayloadTraitsInputOutput"; +const _HPTWMT = "HttpPayloadTraitsWithMediaType"; +const _HPTWMTIO = "HttpPayloadTraitsWithMediaTypeInputOutput"; +const _HPWS = "HttpPayloadWithStructure"; +const _HPWSIO = "HttpPayloadWithStructureInputOutput"; +const _HPWU = "HttpPayloadWithUnion"; +const _HPWUIO = "HttpPayloadWithUnionInputOutput"; +const _HRC = "HttpResponseCode"; +const _HRCO = "HttpResponseCodeOutput"; +const _HRWFL = "HttpRequestWithFloatLabels"; +const _HRWFLI = "HttpRequestWithFloatLabelsInput"; +const _HRWGLIP = "HttpRequestWithGreedyLabelInPath"; +const _HRWGLIPI = "HttpRequestWithGreedyLabelInPathInput"; +const _HRWL = "HttpRequestWithLabels"; +const _HRWLATF = "HttpRequestWithLabelsAndTimestampFormat"; +const _HRWLATFI = "HttpRequestWithLabelsAndTimestampFormatInput"; +const _HRWLI = "HttpRequestWithLabelsInput"; +const _HRWRL = "HttpRequestWithRegexLiteral"; +const _HRWRLI = "HttpRequestWithRegexLiteralInput"; +const _HSP = "HttpStringPayload"; +const _HWPO = "HostWithPathOperation"; +const _I = "Integer"; +const _IAOWH = "InputAndOutputWithHeaders"; +const _IAOWHIO = "InputAndOutputWithHeadersIO"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IEM = "IntegerEnumMap"; +const _IES = "IntegerEnumSet"; +const _IG = "InvalidGreeting"; +const _IL = "IntegerList"; +const _IQPIR = "IgnoreQueryParamsInResponse"; +const _IQPIRO = "IgnoreQueryParamsInResponseOutput"; +const _IS = "IntegerSet"; +const _JB = "JpegBlob"; +const _JBIO = "JsonBlobsInputOutput"; +const _JBs = "JsonBlobs"; +const _JE = "JsonEnums"; +const _JEIO = "JsonEnumsInputOutput"; +const _JHS = "JsonHeaderString"; +const _JIE = "JsonIntEnums"; +const _JIEIO = "JsonIntEnumsInputOutput"; +const _JL = "JsonLists"; +const _JLIO = "JsonListsInputOutput"; +const _JM = "JsonMaps"; +const _JMIO = "JsonMapsInputOutput"; +const _JT = "JsonTimestamps"; +const _JTIO = "JsonTimestampsInputOutput"; +const _JU = "JsonUnions"; +const _JV = "JsonValue"; +const _L = "Long"; +const _M = "Message"; +const _MAWB = "MalformedAcceptWithBody"; +const _MAWGS = "MalformedAcceptWithGenericString"; +const _MAWGSO = "MalformedAcceptWithGenericStringOutput"; +const _MAWP = "MalformedAcceptWithPayload"; +const _MAWPO = "MalformedAcceptWithPayloadOutput"; +const _MB = "MalformedBlob"; +const _MBI = "MalformedBlobInput"; +const _MBIa = "MalformedBooleanInput"; +const _MBIal = "MalformedByteInput"; +const _MBa = "MalformedBoolean"; +const _MBal = "MalformedByte"; +const _MCTWB = "MalformedContentTypeWithBody"; +const _MCTWBEI = "MalformedContentTypeWithoutBodyEmptyInput"; +const _MCTWBEII = "MalformedContentTypeWithoutBodyEmptyInputInput"; +const _MCTWBa = "MalformedContentTypeWithoutBody"; +const _MCTWGS = "MalformedContentTypeWithGenericString"; +const _MCTWGSI = "MalformedContentTypeWithGenericStringInput"; +const _MCTWP = "MalformedContentTypeWithPayload"; +const _MCTWPI = "MalformedContentTypeWithPayloadInput"; +const _MD = "MalformedDouble"; +const _MDI = "MalformedDoubleInput"; +const _MF = "MalformedFloat"; +const _MFI = "MalformedFloatInput"; +const _MI = "MalformedInteger"; +const _MII = "MalformedIntegerInput"; +const _ML = "MalformedList"; +const _MLI = "MalformedListInput"; +const _MLIa = "MalformedLongInput"; +const _MLa = "MalformedLong"; +const _MM = "MalformedMap"; +const _MMI = "MalformedMapInput"; +const _MRB = "MalformedRequestBody"; +const _MRBI = "MalformedRequestBodyInput"; +const _MS = "MalformedShort"; +const _MSI = "MalformedShortInput"; +const _MSIa = "MalformedStringInput"; +const _MSa = "MalformedString"; +const _MTBD = "MalformedTimestampBodyDefault"; +const _MTBDI = "MalformedTimestampBodyDefaultInput"; +const _MTBDT = "MalformedTimestampBodyDateTime"; +const _MTBDTI = "MalformedTimestampBodyDateTimeInput"; +const _MTBHD = "MalformedTimestampBodyHttpDate"; +const _MTBHDI = "MalformedTimestampBodyHttpDateInput"; +const _MTH = "MediaTypeHeader"; +const _MTHD = "MalformedTimestampHeaderDefault"; +const _MTHDI = "MalformedTimestampHeaderDefaultInput"; +const _MTHDT = "MalformedTimestampHeaderDateTime"; +const _MTHDTI = "MalformedTimestampHeaderDateTimeInput"; +const _MTHE = "MalformedTimestampHeaderEpoch"; +const _MTHEI = "MalformedTimestampHeaderEpochInput"; +const _MTHI = "MediaTypeHeaderInput"; +const _MTHO = "MediaTypeHeaderOutput"; +const _MTPD = "MalformedTimestampPathDefault"; +const _MTPDI = "MalformedTimestampPathDefaultInput"; +const _MTPE = "MalformedTimestampPathEpoch"; +const _MTPEI = "MalformedTimestampPathEpochInput"; +const _MTPHD = "MalformedTimestampPathHttpDate"; +const _MTPHDI = "MalformedTimestampPathHttpDateInput"; +const _MTQD = "MalformedTimestampQueryDefault"; +const _MTQDI = "MalformedTimestampQueryDefaultInput"; +const _MTQE = "MalformedTimestampQueryEpoch"; +const _MTQEI = "MalformedTimestampQueryEpochInput"; +const _MTQHD = "MalformedTimestampQueryHttpDate"; +const _MTQHDI = "MalformedTimestampQueryHttpDateInput"; +const _MU = "MyUnion"; +const _MUI = "MalformedUnionInput"; +const _MUa = "MalformedUnion"; +const _N = "Nested"; +const _NAEHC = "NullAndEmptyHeadersClient"; +const _NAEHIO = "NullAndEmptyHeadersIO"; +const _NAEHS = "NullAndEmptyHeadersServer"; +const _NIANO = "NoInputAndNoOutput"; +const _NIAO = "NoInputAndOutput"; +const _NIAOO = "NoInputAndOutputOutput"; +const _NP = "NestedPayload"; +const _NSL = "NestedStringList"; +const _Nu = "Null"; +const _ONSES = "OmitsNullSerializesEmptyString"; +const _ONSESI = "OmitsNullSerializesEmptyStringInput"; +const _OSEL = "OmitsSerializingEmptyLists"; +const _OSELI = "OmitsSerializingEmptyListsInput"; +const _OWD = "OperationWithDefaults"; +const _OWDI = "OperationWithDefaultsInput"; +const _OWDO = "OperationWithDefaultsOutput"; +const _OWNS = "OperationWithNestedStructure"; +const _OWNSI = "OperationWithNestedStructureInput"; +const _OWNSO = "OperationWithNestedStructureOutput"; +const _PA = "PlayerAction"; +const _PC = "PayloadConfig"; +const _PPA = "PostPlayerAction"; +const _PPAI = "PostPlayerActionInput"; +const _PPAO = "PostPlayerActionOutput"; +const _PUWJN = "PostUnionWithJsonName"; +const _PUWJNI = "PostUnionWithJsonNameInput"; +const _PUWJNO = "PostUnionWithJsonNameOutput"; +const _PWCE = "PutWithContentEncoding"; +const _PWCEI = "PutWithContentEncodingInput"; +const _QITAF = "QueryIdempotencyTokenAutoFill"; +const _QITAFI = "QueryIdempotencyTokenAutoFillInput"; +const _QP = "QueryPrecedence"; +const _QPASLM = "QueryParamsAsStringListMap"; +const _QPASLMI = "QueryParamsAsStringListMapInput"; +const _QPI = "QueryPrecedenceInput"; +const _RCHF = "ResponseCodeHttpFallback"; +const _RCHFIO = "ResponseCodeHttpFallbackInputOutput"; +const _RCR = "ResponseCodeRequired"; +const _RCRO = "ResponseCodeRequiredOutput"; +const _RS = "RecursiveShapes"; +const _RSIO = "RecursiveShapesInputOutput"; +const _RSION = "RecursiveShapesInputOutputNested1"; +const _RSIONe = "RecursiveShapesInputOutputNested2"; +const _S = "String"; +const _SB = "StreamingBlob"; +const _SBM = "SparseBooleanMap"; +const _SE = "StringEnum"; +const _SJL = "SparseJsonLists"; +const _SJLIO = "SparseJsonListsInputOutput"; +const _SJM = "SparseJsonMaps"; +const _SJMIO = "SparseJsonMapsInputOutput"; +const _SL = "StringList"; +const _SLM = "StringListMap"; +const _SLMt = "StructureListMember"; +const _SLi = "SimpleList"; +const _SLt = "StructureList"; +const _SM = "StringMap"; +const _SMi = "SimpleMap"; +const _SNM = "SparseNumberMap"; +const _SPI = "StringPayloadInput"; +const _SS = "StringSet"; +const _SSL = "SparseStringList"; +const _SSLp = "SparseShortList"; +const _SSM = "SparseStringMap"; +const _SSMp = "SparseSetMap"; +const _SSMpa = "SparseStructMap"; +const _SSP = "SimpleScalarProperties"; +const _SSPIO = "SimpleScalarPropertiesInputOutput"; +const _ST = "StreamingTraits"; +const _STIO = "StreamingTraitsInputOutput"; +const _STPB = "StreamingTextPlainBlob"; +const _STRL = "StreamingTraitsRequireLength"; +const _STRLI = "StreamingTraitsRequireLengthInput"; +const _STWMT = "StreamingTraitsWithMediaType"; +const _STWMTIO = "StreamingTraitsWithMediaTypeInputOutput"; +const _SU = "SimpleUnion"; +const _Sh = "Short"; +const _St = "Status"; +const _T = "Timestamp"; +const _TBS = "TestBodyStructure"; +const _TBSIO = "TestBodyStructureInputOutput"; +const _TC = "TestConfig"; +const _TE = "TestEnum"; +const _TFH = "TimestampFormatHeaders"; +const _TFHIO = "TimestampFormatHeadersIO"; +const _TGNINP = "TestGetNoInputNoPayload"; +const _TGNP = "TestGetNoPayload"; +const _TIE = "TestIntEnum"; +const _TL = "TimestampList"; +const _TLo = "TopLevel"; +const _TNPIO = "TestNoPayloadInputOutput"; +const _TPB = "TextPlainBlob"; +const _TPBIO = "TestPayloadBlobInputOutput"; +const _TPBe = "TestPayloadBlob"; +const _TPNINP = "TestPostNoInputNoPayload"; +const _TPNP = "TestPostNoPayload"; +const _TPS = "TestPayloadStructure"; +const _TPSIO = "TestPayloadStructureInputOutput"; +const _TSL = "TestStringList"; +const _TSM = "TestStringMap"; +const _UIAO = "UnitInputAndOutput"; +const _UIO = "UnionInputOutput"; +const _UP = "UnionPayload"; +const _UWJN = "UnionWithJsonName"; +const _XA = "X-A"; +const _XATI = "X-Amz-Test-Id"; +const _XB = "X-Byte"; +const _XB_ = "X-Boolean1"; +const _XB__ = "X-Boolean2"; +const _XB___ = "X-BooleanList"; +const _XB____ = "X-B"; +const _XC = "X-C"; +const _XD = "X-Double"; +const _XE = "X-Enum"; +const _XE_ = "X-EnumList"; +const _XF = "X-Foo"; +const _XF_ = "X-Float"; +const _XG = "X-Greeting"; +const _XH = "X-Header"; +const _XI = "X-Integer"; +const _XI_ = "X-IntegerList"; +const _XI__ = "X-IntegerEnum"; +const _XI___ = "X-IntegerEnumList"; +const _XJ = "X-Json"; +const _XL = "X-Long"; +const _XS = "X-String"; +const _XS_ = "X-Short"; +const _XS__ = "X-StringList"; +const _XS___ = "X-StringSet"; +const _XT = "X-TimestampList"; +const _Xd = "X-defaultFormat"; +const _Xm = "X-memberEpochSeconds"; +const _Xm_ = "X-memberHttpDate"; +const _Xm__ = "X-memberDateTime"; +const _Xt = "X-targetEpochSeconds"; +const _Xt_ = "X-targetHttpDate"; +const _Xt__ = "X-targetDateTime"; +const _a = "application/json"; +const _a_ = "a"; +const _ac = "action"; +const _amth = "amz-media-typed-header"; +const _b = "baz"; +const _bIB = "booleanInBody"; +const _bIBy = "byteInBody"; +const _bIH = "booleanInHeader"; +const _bIHy = "byteInHeader"; +const _bIP = "booleanInPath"; +const _bIPy = "byteInPath"; +const _bIQ = "booleanInQuery"; +const _bIQy = "byteInQuery"; +const _bL = "booleanList"; +const _bLo = "bodyList"; +const _bM = "bodyMap"; +const _bV = "byteValue"; +const _bVl = "blobValue"; +const _bVo = "booleanValue"; +const _b_ = "b"; +const _ba = "bar"; +const _baz = "_baz"; +const _bl = "blob"; +const _bo = "boolean"; +const _c = "client"; +const _cOD = "clientOptionalDefaults"; +const _cT = "contentType"; +const _c_ = "c"; +const _co = "corge"; +const _con = "contents"; +const _d = "datetime"; +const _dB = "defaultBoolean"; +const _dBM = "denseBooleanMap"; +const _dBe = "defaultBlob"; +const _dBef = "defaultByte"; +const _dD = "defaultDouble"; +const _dDB = "defaultDocumentBoolean"; +const _dDL = "defaultDocumentList"; +const _dDM = "defaultDocumentMap"; +const _dDS = "defaultDocumentString"; +const _dE = "defaultEnum"; +const _dF = "defaultFloat"; +const _dFe = "defaultFormat"; +const _dI = "defaultInteger"; +const _dIB = "doubleInBody"; +const _dIE = "defaultIntEnum"; +const _dIH = "doubleInHeader"; +const _dIP = "doubleInPath"; +const _dIQ = "doubleInQuery"; +const _dL = "defaultList"; +const _dLe = "defaultLong"; +const _dLi = "dialogList"; +const _dM = "defaultMap"; +const _dMi = "dialogMap"; +const _dND = "defaultNullDocument"; +const _dNM = "denseNumberMap"; +const _dS = "defaultString"; +const _dSM = "denseStructMap"; +const _dSMe = "denseStringMap"; +const _dSMen = "denseSetMap"; +const _dSe = "defaultShort"; +const _dT = "defaultTimestamp"; +const _dTOT = "dateTimeOnTarget"; +const _dTa = "dateTime"; +const _dV = "documentValue"; +const _dVM = "docValuedMap"; +const _dVo = "doubleValue"; +const _da = "data"; +const _de = "defaults"; +const _di = "dialog"; +const _do = "double"; +const _e = "error"; +const _eB = "emptyBlob"; +const _eL = "enumList"; +const _eS = "emptyString"; +const _eSOT = "epochSecondsOnTarget"; +const _eSp = "epochSeconds"; +const _eV = "enumValue"; +const _en = "encoding"; +const _end = "endpoint"; +const _f = "farewell"; +const _fB = "falseBoolean"; +const _fBV = "falseBooleanValue"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fIB = "floatInBody"; +const _fIH = "floatInHeader"; +const _fIP = "floatInPath"; +const _fIQ = "floatInQuery"; +const _fM = "fooMap"; +const _fV = "floatValue"; +const _fl = "float"; +const _fo = "foo"; +const _g = "greeting"; +const _h = "hello"; +const _hB = "headerByte"; +const _hBL = "headerBooleanList"; +const _hD = "headerDouble"; +const _hDOT = "httpDateOnTarget"; +const _hDt = "httpDate"; +const _hE = "httpError"; +const _hEL = "headerEnumList"; +const _hEe = "headerEnum"; +const _hF = "headerFloat"; +const _hFB = "headerFalseBool"; +const _hH = "httpHeader"; +const _hI = "headerInteger"; +const _hIE = "headerIntegerEnum"; +const _hIEL = "headerIntegerEnumList"; +const _hIL = "headerIntegerList"; +const _hL = "hostLabel"; +const _hLe = "headerLong"; +const _hPH = "httpPrefixHeaders"; +const _hQ = "httpQuery"; +const _hS = "headerString"; +const _hSL = "headerStringList"; +const _hSS = "headerStringSet"; +const _hSe = "headerShort"; +const _hTB = "headerTrueBool"; +const _hTL = "headerTimestampList"; +const _he = "header"; +const _hi = "hi"; +const _ht = "http"; +const _i = "image/jpeg"; +const _iE = "integerEnum1"; +const _iEL = "integerEnumList"; +const _iELn = "intEnumList"; +const _iEM = "integerEnumMap"; +const _iES = "integerEnumSet"; +const _iEn = "integerEnum2"; +const _iEnt = "integerEnum3"; +const _iIB = "integerInBody"; +const _iIH = "integerInHeader"; +const _iIP = "integerInPath"; +const _iIQ = "integerInQuery"; +const _iL = "integerList"; +const _iT = "idempotencyToken"; +const _iV = "integerValue"; +const _in = "integer"; +const _int = "int"; +const _j = "json"; +const _jN = "jsonName"; +const _l = "language"; +const _lIB = "longInBody"; +const _lIH = "longInHeader"; +const _lIP = "longInPath"; +const _lIQ = "longInQuery"; +const _lV = "longValue"; +const _lVi = "listValue"; +const _la = "label"; +const _lo = "long"; +const _m = "member"; +const _mDT = "memberDateTime"; +const _mES = "memberEpochSeconds"; +const _mHD = "memberHttpDate"; +const _mS = "maybeSet"; +const _mSL = "myStructureList"; +const _mT = "mediaType"; +const _mV = "mapValue"; +const _n = "nested"; +const _nSL = "nestedStringList"; +const _nV = "nullValue"; +const _nVu = "numberValue"; +const _na = "name"; +const _no = "normal"; +const _o = "other"; +const _oTLD = "otherTopLevelDefault"; +const _p = "payload"; +const _pC = "payloadConfig"; +const _pH = "prefixHeaders"; +const _ph = "phrase"; +const _q = "qux"; +const _qB = "queryByte"; +const _qBL = "queryBooleanList"; +const _qBu = "queryBoolean"; +const _qD = "queryDouble"; +const _qDL = "queryDoubleList"; +const _qE = "queryEnum"; +const _qEL = "queryEnumList"; +const _qF = "queryFloat"; +const _qI = "queryInteger"; +const _qIE = "queryIntegerEnum"; +const _qIEL = "queryIntegerEnumList"; +const _qIL = "queryIntegerList"; +const _qIS = "queryIntegerSet"; +const _qL = "queryLong"; +const _qPMOSL = "queryParamsMapOfStringList"; +const _qS = "queryString"; +const _qSL = "queryStringList"; +const _qSS = "queryStringSet"; +const _qSu = "queryShort"; +const _qT = "queryTimestamp"; +const _qTL = "queryTimestampList"; +const _qu = "quit"; +const _rC = "responseCode"; +const _rL = "requiresLength"; +const _rM = "recursiveMember"; +const _rSV = "renamedStructureValue"; +const _s = "streaming"; +const _sBM = "sparseBooleanMap"; +const _sH = "specificHeader"; +const _sIB = "shortInBody"; +const _sIH = "shortInHeader"; +const _sIP = "shortInPath"; +const _sIQ = "shortInQuery"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sNM = "sparseNumberMap"; +const _sS = "stringSet"; +const _sSL = "sparseStringList"; +const _sSLp = "sparseShortList"; +const _sSM = "sparseStructMap"; +const _sSMp = "sparseStringMap"; +const _sSMpa = "sparseSetMap"; +const _sV = "stringValue"; +const _sVh = "shortValue"; +const _sVt = "structureValue"; +const _sa = "salutation"; +const _se = "server"; +const _sh = "short"; +const _sp = "sparse"; +const _st = "string"; +const _str = "str"; +const _t = "text/plain"; +const _tBV = "trueBooleanValue"; +const _tC = "testConfig"; +const _tDT = "targetDateTime"; +const _tES = "targetEpochSeconds"; +const _tHD = "targetHttpDate"; +const _tI = "testId"; +const _tL = "timestampList"; +const _tLD = "topLevelDefault"; +const _tLo = "topLevel"; +const _tV = "timestampValue"; +const _ti = "timestamp"; +const _tim = "timeout"; +const _to = "token"; +const _u = "union"; +const _v = "value"; +const _xati = "x-amz-test-id"; +const _xf = "x-foo"; +const _xf_ = "x-foo-"; +const _zB = "zeroByte"; +const _zD = "zeroDouble"; +const _zF = "zeroFloat"; +const _zI = "zeroInteger"; +const _zL = "zeroLong"; +const _zS = "zeroShort"; +const n0 = "aws.protocoltests.restjson"; +const n1 = "aws.protocoltests.shared"; +const n2 = "aws.protocoltests.restjson.nested"; + +// smithy-typescript generated code +import { error, list, map, op, sim, struct, struct as uni } from "@smithy/core/schema"; + +import { + ComplexError as __ComplexError, + FooError as __FooError, + InvalidGreeting as __InvalidGreeting, +} from "../models/index"; +import { RestJsonProtocolServiceException as __RestJsonProtocolServiceException } from "../models/RestJsonProtocolServiceException"; + +/* eslint no-var: 0 */ + +export var FiniteStreamingBlob = sim(n0, _FSB, 42, { + [_rL]: 1, + [_s]: 1, +}); +export var JsonHeaderString = sim(n0, _JHS, 0, { + [_mT]: _a, +}); +export var JsonValue = sim(n0, _JV, 0, { + [_mT]: _a, +}); +export var StreamingBlob = sim(n0, _SB, 42, { + [_s]: 1, +}); +export var StreamingTextPlainBlob = sim(n0, _STPB, 42, { + [_mT]: _t, + [_s]: 1, +}); +export var JpegBlob = sim(n1, _JB, 21, { + [_mT]: _i, +}); +export var TextPlainBlob = sim(n1, _TPB, 21, { + [_mT]: _t, +}); +export var AllQueryStringTypesInput = struct( + n0, + _AQSTI, + 0, + [ + _qS, + _qSL, + _qSS, + _qB, + _qSu, + _qI, + _qIL, + _qIS, + _qL, + _qF, + _qD, + _qDL, + _qBu, + _qBL, + _qT, + _qTL, + _qE, + _qEL, + _qIE, + _qIEL, + _qPMOSL, + ], + [ + [ + 0, + { + [_hQ]: _S, + }, + ], + [ + 64 | 0, + { + [_hQ]: _SL, + }, + ], + [ + 64 | 0, + { + [_hQ]: _SS, + }, + ], + [ + 1, + { + [_hQ]: _B, + }, + ], + [ + 1, + { + [_hQ]: _Sh, + }, + ], + [ + 1, + { + [_hQ]: _I, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IL, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IS, + }, + ], + [ + 1, + { + [_hQ]: _L, + }, + ], + [ + 1, + { + [_hQ]: _F, + }, + ], + [ + 1, + { + [_hQ]: _D, + }, + ], + [ + 64 | 1, + { + [_hQ]: _DL, + }, + ], + [ + 2, + { + [_hQ]: _Bo, + }, + ], + [ + 64 | 2, + { + [_hQ]: _BL, + }, + ], + [ + 4, + { + [_hQ]: _T, + }, + ], + [ + 64 | 4, + { + [_hQ]: _TL, + }, + ], + [ + 0, + { + [_hQ]: _E, + }, + ], + [ + 64 | 0, + { + [_hQ]: _EL, + }, + ], + [ + 1, + { + [_hQ]: _IE, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IEL, + }, + ], + [map(n1, _SLM, 0, 0, 64 | 0), 64], + ] +); +export var ClientOptionalDefaults = struct(n0, _COD, 0, [_m], [1]); +export var ComplexError = error( + n0, + _CE, + { + [_e]: _c, + [_hE]: 403, + }, + [_H, _TLo, _N], + [ + [ + 0, + { + [_hH]: _XH, + }, + ], + 0, + [() => ComplexNestedErrorData, 0], + ], + + __ComplexError +); +export var ComplexNestedErrorData = struct( + n0, + _CNED, + 0, + [_Fo], + [ + [ + 0, + { + [_jN]: _Foo, + }, + ], + ] +); +export var ConstantAndVariableQueryStringInput = struct( + n0, + _CAVQSI, + 0, + [_b, _mS], + [ + [ + 0, + { + [_hQ]: _b, + }, + ], + [ + 0, + { + [_hQ]: _mS, + }, + ], + ] +); +export var ConstantQueryStringInput = struct(n0, _CQSI, 0, [_h], [[0, 1]]); +export var ContentTypeParametersInput = struct(n0, _CTPI, 0, [_v], [1]); +export var ContentTypeParametersOutput = struct(n0, _CTPO, 0, [], []); +export var DatetimeOffsetsOutput = struct(n0, _DOO, 0, [_d], [5]); +export var Defaults = struct( + n0, + _De, + 0, + [ + _dS, + _dB, + _dL, + _dDM, + _dDS, + _dDB, + _dDL, + _dND, + _dT, + _dBe, + _dBef, + _dSe, + _dI, + _dLe, + _dF, + _dD, + _dM, + _dE, + _dIE, + _eS, + _fB, + _eB, + _zB, + _zS, + _zI, + _zL, + _zF, + _zD, + ], + [0, 2, 64 | 0, 15, 15, 15, 15, 15, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] +); +export var Dialog = struct(n0, _Di, 0, [_l, _g, _f], [0, 0, () => Farewell]); +export var DocumentTypeAsMapValueInputOutput = struct(n0, _DTAMVIO, 0, [_dVM], [128 | 15]); +export var DocumentTypeAsPayloadInputOutput = struct(n0, _DTAPIO, 0, [_dV], [[15, 16]]); +export var DocumentTypeInputOutput = struct(n0, _DTIO, 0, [_sV, _dV], [0, 15]); +export var EmptyInputAndEmptyOutputInput = struct(n0, _EIAEOI, 0, [], []); +export var EmptyInputAndEmptyOutputOutput = struct(n0, _EIAEOO, 0, [], []); +export var EnumPayloadInput = struct(n0, _EPI, 0, [_p], [[0, 16]]); +export var Farewell = struct(n0, _Fa, 0, [_ph], [0]); +export var FooError = error( + n0, + _FEo, + { + [_e]: _se, + [_hE]: 500, + }, + [], + [], + + __FooError +); +export var FractionalSecondsOutput = struct(n0, _FSO, 0, [_d], [5]); +export var GreetingWithErrorsOutput = struct( + n0, + _GWEO, + 0, + [_g], + [ + [ + 0, + { + [_hH]: _XG, + }, + ], + ] +); +export var HostLabelInput = struct( + n0, + _HLI, + 0, + [_la], + [ + [ + 0, + { + [_hL]: 1, + }, + ], + ] +); +export var HttpChecksumRequiredInputOutput = struct(n0, _HCRIO, 0, [_fo], [0]); +export var HttpEmptyPrefixHeadersInput = struct( + n0, + _HEPHI, + 0, + [_pH, _sH], + [ + [ + 128 | 0, + { + [_hPH]: _, + }, + ], + [ + 0, + { + [_hH]: _h, + }, + ], + ] +); +export var HttpEmptyPrefixHeadersOutput = struct( + n0, + _HEPHO, + 0, + [_pH, _sH], + [ + [ + 128 | 0, + { + [_hPH]: _, + }, + ], + [ + 0, + { + [_hH]: _h, + }, + ], + ] +); +export var HttpPayloadTraitsInputOutput = struct( + n0, + _HPTIO, + 0, + [_fo, _bl], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + [21, 16], + ] +); +export var HttpPayloadTraitsWithMediaTypeInputOutput = struct( + n0, + _HPTWMTIO, + 0, + [_fo, _bl], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + [() => TextPlainBlob, 16], + ] +); +export var HttpPayloadWithStructureInputOutput = struct(n0, _HPWSIO, 0, [_n], [[() => NestedPayload, 16]]); +export var HttpPayloadWithUnionInputOutput = struct(n0, _HPWUIO, 0, [_n], [[() => UnionPayload, 16]]); +export var HttpPrefixHeadersInput = struct( + n0, + _HPHI, + 0, + [_fo, _fM], + [ + [ + 0, + { + [_hH]: _xf, + }, + ], + [ + 128 | 0, + { + [_hPH]: _xf_, + }, + ], + ] +); +export var HttpPrefixHeadersInResponseInput = struct(n0, _HPHIRI, 0, [], []); +export var HttpPrefixHeadersInResponseOutput = struct( + n0, + _HPHIRO, + 0, + [_pH], + [ + [ + 128 | 0, + { + [_hPH]: _, + }, + ], + ] +); +export var HttpPrefixHeadersOutput = struct( + n0, + _HPHO, + 0, + [_fo, _fM], + [ + [ + 0, + { + [_hH]: _xf, + }, + ], + [ + 128 | 0, + { + [_hPH]: _xf_, + }, + ], + ] +); +export var HttpRequestWithFloatLabelsInput = struct( + n0, + _HRWFLI, + 0, + [_fl, _do], + [ + [1, 1], + [1, 1], + ] +); +export var HttpRequestWithGreedyLabelInPathInput = struct( + n0, + _HRWGLIPI, + 0, + [_fo, _b], + [ + [0, 1], + [0, 1], + ] +); +export var HttpRequestWithLabelsAndTimestampFormatInput = struct( + n0, + _HRWLATFI, + 0, + [_mES, _mHD, _mDT, _dFe, _tES, _tHD, _tDT], + [ + [7, 1], + [6, 1], + [5, 1], + [4, 1], + [7, 1], + [6, 1], + [5, 1], + ] +); +export var HttpRequestWithLabelsInput = struct( + n0, + _HRWLI, + 0, + [_st, _sh, _in, _lo, _fl, _do, _bo, _ti], + [ + [0, 1], + [1, 1], + [1, 1], + [1, 1], + [1, 1], + [1, 1], + [2, 1], + [4, 1], + ] +); +export var HttpRequestWithRegexLiteralInput = struct(n0, _HRWRLI, 0, [_str], [[0, 1]]); +export var HttpResponseCodeOutput = struct(n0, _HRCO, 0, [_St], [[1, 32]]); +export var IgnoreQueryParamsInResponseOutput = struct( + n0, + _IQPIRO, + 0, + [_b], + [ + [ + 0, + { + [_hQ]: _b, + }, + ], + ] +); +export var InputAndOutputWithHeadersIO = struct( + n0, + _IAOWHIO, + 0, + [_hS, _hB, _hSe, _hI, _hLe, _hF, _hD, _hTB, _hFB, _hSL, _hSS, _hIL, _hBL, _hTL, _hEe, _hEL, _hIE, _hIEL], + [ + [ + 0, + { + [_hH]: _XS, + }, + ], + [ + 1, + { + [_hH]: _XB, + }, + ], + [ + 1, + { + [_hH]: _XS_, + }, + ], + [ + 1, + { + [_hH]: _XI, + }, + ], + [ + 1, + { + [_hH]: _XL, + }, + ], + [ + 1, + { + [_hH]: _XF_, + }, + ], + [ + 1, + { + [_hH]: _XD, + }, + ], + [ + 2, + { + [_hH]: _XB_, + }, + ], + [ + 2, + { + [_hH]: _XB__, + }, + ], + [ + 64 | 0, + { + [_hH]: _XS__, + }, + ], + [ + 64 | 0, + { + [_hH]: _XS___, + }, + ], + [ + 64 | 1, + { + [_hH]: _XI_, + }, + ], + [ + 64 | 2, + { + [_hH]: _XB___, + }, + ], + [ + 64 | 4, + { + [_hH]: _XT, + }, + ], + [ + 0, + { + [_hH]: _XE, + }, + ], + [ + 64 | 0, + { + [_hH]: _XE_, + }, + ], + [ + 1, + { + [_hH]: _XI__, + }, + ], + [ + 64 | 1, + { + [_hH]: _XI___, + }, + ], + ] +); +export var InvalidGreeting = error( + n0, + _IG, + { + [_e]: _c, + [_hE]: 400, + }, + [_M], + [0], + + __InvalidGreeting +); +export var JsonBlobsInputOutput = struct(n0, _JBIO, 0, [_da], [21]); +export var JsonEnumsInputOutput = struct( + n0, + _JEIO, + 0, + [_fE, _fEo, _fEoo, _fEL, _fES, _fEM], + [0, 0, 0, 64 | 0, 64 | 0, 128 | 0] +); +export var JsonIntEnumsInputOutput = struct( + n0, + _JIEIO, + 0, + [_iE, _iEn, _iEnt, _iEL, _iES, _iEM], + [1, 1, 1, 64 | 1, 64 | 1, 128 | 1] +); +export var JsonListsInputOutput = struct( + n0, + _JLIO, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iELn, _nSL, _sLt], + [ + 64 | 0, + 64 | 0, + 64 | 1, + 64 | 2, + 64 | 4, + 64 | 0, + 64 | 1, + list(n1, _NSL, 0, 64 | 0), + [ + () => StructureList, + { + [_jN]: _mSL, + }, + ], + ] +); +export var JsonMapsInputOutput = struct( + n0, + _JMIO, + 0, + [_dSM, _dNM, _dBM, _dSMe, _dSMen], + [() => DenseStructMap, 128 | 1, 128 | 2, 128 | 0, map(n0, _DSMe, 0, 0, 64 | 0)] +); +export var JsonTimestampsInputOutput = struct( + n0, + _JTIO, + 0, + [_no, _dTa, _dTOT, _eSp, _eSOT, _hDt, _hDOT], + [4, 5, 5, 7, 7, 6, 6] +); +export var MalformedAcceptWithGenericStringOutput = struct(n0, _MAWGSO, 0, [_p], [[0, 16]]); +export var MalformedAcceptWithPayloadOutput = struct(n0, _MAWPO, 0, [_p], [[() => JpegBlob, 16]]); +export var MalformedBlobInput = struct(n0, _MBI, 0, [_bl], [21]); +export var MalformedBooleanInput = struct( + n0, + _MBIa, + 0, + [_bIB, _bIP, _bIQ, _bIH], + [ + 2, + [2, 1], + [ + 2, + { + [_hQ]: _bIQ, + }, + ], + [ + 2, + { + [_hH]: _bIH, + }, + ], + ] +); +export var MalformedByteInput = struct( + n0, + _MBIal, + 0, + [_bIBy, _bIPy, _bIQy, _bIHy], + [ + 1, + [1, 1], + [ + 1, + { + [_hQ]: _bIQy, + }, + ], + [ + 1, + { + [_hH]: _bIHy, + }, + ], + ] +); +export var MalformedContentTypeWithGenericStringInput = struct(n0, _MCTWGSI, 0, [_p], [[0, 16]]); +export var MalformedContentTypeWithoutBodyEmptyInputInput = struct( + n0, + _MCTWBEII, + 0, + [_he], + [ + [ + 0, + { + [_hH]: _he, + }, + ], + ] +); +export var MalformedContentTypeWithPayloadInput = struct(n0, _MCTWPI, 0, [_p], [[() => JpegBlob, 16]]); +export var MalformedDoubleInput = struct( + n0, + _MDI, + 0, + [_dIB, _dIP, _dIQ, _dIH], + [ + 1, + [1, 1], + [ + 1, + { + [_hQ]: _dIQ, + }, + ], + [ + 1, + { + [_hH]: _dIH, + }, + ], + ] +); +export var MalformedFloatInput = struct( + n0, + _MFI, + 0, + [_fIB, _fIP, _fIQ, _fIH], + [ + 1, + [1, 1], + [ + 1, + { + [_hQ]: _fIQ, + }, + ], + [ + 1, + { + [_hH]: _fIH, + }, + ], + ] +); +export var MalformedIntegerInput = struct( + n0, + _MII, + 0, + [_iIB, _iIP, _iIQ, _iIH], + [ + 1, + [1, 1], + [ + 1, + { + [_hQ]: _iIQ, + }, + ], + [ + 1, + { + [_hH]: _iIH, + }, + ], + ] +); +export var MalformedListInput = struct(n0, _MLI, 0, [_bLo], [64 | 0]); +export var MalformedLongInput = struct( + n0, + _MLIa, + 0, + [_lIB, _lIP, _lIQ, _lIH], + [ + 1, + [1, 1], + [ + 1, + { + [_hQ]: _lIQ, + }, + ], + [ + 1, + { + [_hH]: _lIH, + }, + ], + ] +); +export var MalformedMapInput = struct(n0, _MMI, 0, [_bM], [128 | 0]); +export var MalformedRequestBodyInput = struct(n0, _MRBI, 0, [_int, _fl], [1, 1]); +export var MalformedShortInput = struct( + n0, + _MSI, + 0, + [_sIB, _sIP, _sIQ, _sIH], + [ + 1, + [1, 1], + [ + 1, + { + [_hQ]: _sIQ, + }, + ], + [ + 1, + { + [_hH]: _sIH, + }, + ], + ] +); +export var MalformedStringInput = struct( + n0, + _MSIa, + 0, + [_bl], + [ + [ + () => JsonHeaderString, + { + [_hH]: _amth, + }, + ], + ] +); +export var MalformedTimestampBodyDateTimeInput = struct(n0, _MTBDTI, 0, [_ti], [5]); +export var MalformedTimestampBodyDefaultInput = struct(n0, _MTBDI, 0, [_ti], [4]); +export var MalformedTimestampBodyHttpDateInput = struct(n0, _MTBHDI, 0, [_ti], [6]); +export var MalformedTimestampHeaderDateTimeInput = struct( + n0, + _MTHDTI, + 0, + [_ti], + [ + [ + 5, + { + [_hH]: _ti, + }, + ], + ] +); +export var MalformedTimestampHeaderDefaultInput = struct( + n0, + _MTHDI, + 0, + [_ti], + [ + [ + 4, + { + [_hH]: _ti, + }, + ], + ] +); +export var MalformedTimestampHeaderEpochInput = struct( + n0, + _MTHEI, + 0, + [_ti], + [ + [ + 7, + { + [_hH]: _ti, + }, + ], + ] +); +export var MalformedTimestampPathDefaultInput = struct(n0, _MTPDI, 0, [_ti], [[4, 1]]); +export var MalformedTimestampPathEpochInput = struct(n0, _MTPEI, 0, [_ti], [[7, 1]]); +export var MalformedTimestampPathHttpDateInput = struct(n0, _MTPHDI, 0, [_ti], [[6, 1]]); +export var MalformedTimestampQueryDefaultInput = struct( + n0, + _MTQDI, + 0, + [_ti], + [ + [ + 4, + { + [_hQ]: _ti, + }, + ], + ] +); +export var MalformedTimestampQueryEpochInput = struct( + n0, + _MTQEI, + 0, + [_ti], + [ + [ + 7, + { + [_hQ]: _ti, + }, + ], + ] +); +export var MalformedTimestampQueryHttpDateInput = struct( + n0, + _MTQHDI, + 0, + [_ti], + [ + [ + 6, + { + [_hQ]: _ti, + }, + ], + ] +); +export var MalformedUnionInput = struct(n0, _MUI, 0, [_u], [() => SimpleUnion]); +export var MediaTypeHeaderInput = struct( + n0, + _MTHI, + 0, + [_j], + [ + [ + () => JsonValue, + { + [_hH]: _XJ, + }, + ], + ] +); +export var MediaTypeHeaderOutput = struct( + n0, + _MTHO, + 0, + [_j], + [ + [ + () => JsonValue, + { + [_hH]: _XJ, + }, + ], + ] +); +export var NestedPayload = struct(n0, _NP, 0, [_g, _na], [0, 0]); +export var NoInputAndOutputOutput = struct(n0, _NIAOO, 0, [], []); +export var NullAndEmptyHeadersIO = struct( + n0, + _NAEHIO, + 0, + [_a_, _b_, _c_], + [ + [ + 0, + { + [_hH]: _XA, + }, + ], + [ + 0, + { + [_hH]: _XB____, + }, + ], + [ + 64 | 0, + { + [_hH]: _XC, + }, + ], + ] +); +export var OmitsNullSerializesEmptyStringInput = struct( + n0, + _ONSESI, + 0, + [_nV, _eS], + [ + [ + 0, + { + [_hQ]: _Nu, + }, + ], + [ + 0, + { + [_hQ]: _Em, + }, + ], + ] +); +export var OmitsSerializingEmptyListsInput = struct( + n0, + _OSELI, + 0, + [_qSL, _qIL, _qDL, _qBL, _qTL, _qEL, _qIEL], + [ + [ + 64 | 0, + { + [_hQ]: _SL, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IL, + }, + ], + [ + 64 | 1, + { + [_hQ]: _DL, + }, + ], + [ + 64 | 2, + { + [_hQ]: _BL, + }, + ], + [ + 64 | 4, + { + [_hQ]: _TL, + }, + ], + [ + 64 | 0, + { + [_hQ]: _EL, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IEL, + }, + ], + ] +); +export var OperationWithDefaultsInput = struct( + n0, + _OWDI, + 0, + [_de, _cOD, _tLD, _oTLD], + [() => Defaults, () => ClientOptionalDefaults, 0, 1] +); +export var OperationWithDefaultsOutput = struct( + n0, + _OWDO, + 0, + [ + _dS, + _dB, + _dL, + _dDM, + _dDS, + _dDB, + _dDL, + _dND, + _dT, + _dBe, + _dBef, + _dSe, + _dI, + _dLe, + _dF, + _dD, + _dM, + _dE, + _dIE, + _eS, + _fB, + _eB, + _zB, + _zS, + _zI, + _zL, + _zF, + _zD, + ], + [0, 2, 64 | 0, 15, 15, 15, 15, 15, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] +); +export var OperationWithNestedStructureInput = struct(n0, _OWNSI, 0, [_tLo], [() => TopLevel]); +export var OperationWithNestedStructureOutput = struct( + n0, + _OWNSO, + 0, + [_di, _dLi, _dMi], + [() => Dialog, () => DialogList, () => DialogMap] +); +export var PayloadConfig = struct(n0, _PC, 0, [_da], [1]); +export var PostPlayerActionInput = struct(n0, _PPAI, 0, [_ac], [() => PlayerAction]); +export var PostPlayerActionOutput = struct(n0, _PPAO, 0, [_ac], [() => PlayerAction]); +export var PostUnionWithJsonNameInput = struct(n0, _PUWJNI, 0, [_v], [[() => UnionWithJsonName, 0]]); +export var PostUnionWithJsonNameOutput = struct(n0, _PUWJNO, 0, [_v], [[() => UnionWithJsonName, 0]]); +export var PutWithContentEncodingInput = struct( + n0, + _PWCEI, + 0, + [_en, _da], + [ + [ + 0, + { + [_hH]: _CE_, + }, + ], + 0, + ] +); +export var QueryIdempotencyTokenAutoFillInput = struct( + n0, + _QITAFI, + 0, + [_to], + [ + [ + 0, + { + [_iT]: 1, + [_hQ]: _to, + }, + ], + ] +); +export var QueryParamsAsStringListMapInput = struct( + n0, + _QPASLMI, + 0, + [_q, _fo], + [ + [ + 0, + { + [_hQ]: _co, + }, + ], + [map(n1, _SLM, 0, 0, 64 | 0), 64], + ] +); +export var QueryPrecedenceInput = struct( + n0, + _QPI, + 0, + [_fo, _b], + [ + [ + 0, + { + [_hQ]: _ba, + }, + ], + [128 | 0, 64], + ] +); +export var RecursiveShapesInputOutput = struct(n0, _RSIO, 0, [_n], [() => RecursiveShapesInputOutputNested1]); +export var RecursiveShapesInputOutputNested1 = struct( + n0, + _RSION, + 0, + [_fo, _n], + [0, () => RecursiveShapesInputOutputNested2] +); +export var RecursiveShapesInputOutputNested2 = struct( + n0, + _RSIONe, + 0, + [_ba, _rM], + [0, () => RecursiveShapesInputOutputNested1] +); +export var ResponseCodeHttpFallbackInputOutput = struct(n0, _RCHFIO, 0, [], []); +export var ResponseCodeRequiredOutput = struct(n0, _RCRO, 0, [_rC], [[1, 32]]); +export var SimpleScalarPropertiesInputOutput = struct( + n0, + _SSPIO, + 0, + [_fo, _sV, _tBV, _fBV, _bV, _sVh, _iV, _lV, _fV, _dVo], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + 0, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + [ + 1, + { + [_jN]: _DD, + }, + ], + ] +); +export var SparseJsonListsInputOutput = struct( + n0, + _SJLIO, + 0, + [_sSL, _sSLp], + [ + [() => SparseStringList, 0], + [() => SparseShortList, 0], + ] +); +export var SparseJsonMapsInputOutput = struct( + n0, + _SJMIO, + 0, + [_sSM, _sNM, _sBM, _sSMp, _sSMpa], + [ + [() => SparseStructMap, 0], + [() => SparseNumberMap, 0], + [() => SparseBooleanMap, 0], + [() => SparseStringMap, 0], + [() => SparseSetMap, 0], + ] +); +export var StreamingTraitsInputOutput = struct( + n0, + _STIO, + 0, + [_fo, _bl], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + [() => StreamingBlob, 16], + ] +); +export var StreamingTraitsRequireLengthInput = struct( + n0, + _STRLI, + 0, + [_fo, _bl], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + [() => FiniteStreamingBlob, 16], + ] +); +export var StreamingTraitsWithMediaTypeInputOutput = struct( + n0, + _STWMTIO, + 0, + [_fo, _bl], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + [() => StreamingTextPlainBlob, 16], + ] +); +export var StringPayloadInput = struct(n0, _SPI, 0, [_p], [[0, 16]]); +export var StructureListMember = struct( + n0, + _SLMt, + 0, + [_a_, _b_], + [ + [ + 0, + { + [_jN]: _v, + }, + ], + [ + 0, + { + [_jN]: _o, + }, + ], + ] +); +export var TestBodyStructureInputOutput = struct( + n0, + _TBSIO, + 0, + [_tI, _tC], + [ + [ + 0, + { + [_hH]: _xati, + }, + ], + () => TestConfig, + ] +); +export var TestConfig = struct(n0, _TC, 0, [_tim], [1]); +export var TestNoPayloadInputOutput = struct( + n0, + _TNPIO, + 0, + [_tI], + [ + [ + 0, + { + [_hH]: _XATI, + }, + ], + ] +); +export var TestPayloadBlobInputOutput = struct( + n0, + _TPBIO, + 0, + [_cT, _da], + [ + [ + 0, + { + [_hH]: _CT, + }, + ], + [21, 16], + ] +); +export var TestPayloadStructureInputOutput = struct( + n0, + _TPSIO, + 0, + [_tI, _pC], + [ + [ + 0, + { + [_hH]: _xati, + }, + ], + [() => PayloadConfig, 16], + ] +); +export var TimestampFormatHeadersIO = struct( + n0, + _TFHIO, + 0, + [_mES, _mHD, _mDT, _dFe, _tES, _tHD, _tDT], + [ + [ + 7, + { + [_hH]: _Xm, + }, + ], + [ + 6, + { + [_hH]: _Xm_, + }, + ], + [ + 5, + { + [_hH]: _Xm__, + }, + ], + [ + 4, + { + [_hH]: _Xd, + }, + ], + [ + 7, + { + [_hH]: _Xt, + }, + ], + [ + 6, + { + [_hH]: _Xt_, + }, + ], + [ + 5, + { + [_hH]: _Xt__, + }, + ], + ] +); +export var TopLevel = struct(n0, _TLo, 0, [_di, _dLi, _dMi], [() => Dialog, () => DialogList, () => DialogMap]); +export var UnionInputOutput = struct(n0, _UIO, 0, [_con], [() => MyUnion]); +export var GreetingStruct = struct(n2, _GS, 0, [_sa], [0]); +export var GreetingStruct_n1 = struct(n1, _GS, 0, [_hi], [0]); +export var Unit = "unit" as const; + +export var RestJsonProtocolServiceException = error( + "smithy.ts.sdk.synthetic.aws.protocoltests.restjson", + "RestJsonProtocolServiceException", + 0, + [], + [], + __RestJsonProtocolServiceException +); +export var DialogList = list(n0, _DLi, 0, () => Dialog); +export var SimpleList = 64 | 0; + +export var StructureList = list(n0, _SLt, 0, [() => StructureListMember, 0]); +export var TestStringList = 64 | 0; + +export var BooleanList = 64 | 2; + +export var DoubleList = 64 | 1; + +export var FooEnumList = 64 | 0; + +export var FooEnumSet = 64 | 0; + +export var IntegerEnumList = 64 | 1; + +export var IntegerEnumSet = 64 | 1; + +export var IntegerList = 64 | 1; + +export var IntegerSet = 64 | 1; + +export var NestedStringList = list(n1, _NSL, 0, 64 | 0); +export var SparseShortList = list( + n1, + _SSLp, + { + [_sp]: 1, + }, + 1 +); +export var SparseStringList = list( + n1, + _SSL, + { + [_sp]: 1, + }, + 0 +); +export var StringList = 64 | 0; + +export var StringSet = 64 | 0; + +export var TimestampList = 64 | 4; + +export var DenseBooleanMap = 128 | 2; + +export var DenseNumberMap = 128 | 1; + +export var DenseSetMap = map(n0, _DSMe, 0, 0, 64 | 0); +export var DenseStringMap = 128 | 0; + +export var DenseStructMap = map(n0, _DSMen, 0, 0, () => GreetingStruct_n1); +export var DialogMap = map(n0, _DM, 0, 0, () => Dialog); +export var DocumentValuedMap = map(n0, _DVM, 0, 0, 15); +export var SimpleMap = 128 | 0; + +export var SparseBooleanMap = map( + n0, + _SBM, + { + [_sp]: 1, + }, + 0, + 2 +); +export var SparseNumberMap = map( + n0, + _SNM, + { + [_sp]: 1, + }, + 0, + 1 +); +export var SparseSetMap = map( + n0, + _SSMp, + { + [_sp]: 1, + }, + 0, + 64 | 0 +); +export var SparseStructMap = map( + n0, + _SSMpa, + { + [_sp]: 1, + }, + 0, + () => GreetingStruct_n1 +); +export var TestStringMap = 128 | 0; + +export var FooEnumMap = 128 | 0; + +export var IntegerEnumMap = 128 | 1; + +export var SparseStringMap = map( + n1, + _SSM, + { + [_sp]: 1, + }, + 0, + 0 +); +export var StringListMap = map(n1, _SLM, 0, 0, 64 | 0); +export var StringMap = 128 | 0; + +export var MyUnion = uni( + n0, + _MU, + 0, + [_sV, _bVo, _nVu, _bVl, _tV, _eV, _lVi, _mV, _sVt, _rSV], + [0, 2, 1, 21, 4, 0, 64 | 0, 128 | 0, () => GreetingStruct_n1, () => GreetingStruct] +); +export var PlayerAction = uni(n0, _PA, 0, [_qu], [() => Unit]); +export var SimpleUnion = uni(n0, _SU, 0, [_int, _st], [1, 0]); +export var UnionPayload = uni(n0, _UP, 0, [_g], [0]); +export var UnionWithJsonName = uni( + n0, + _UWJN, + 0, + [_fo, _ba, _b], + [ + [ + 0, + { + [_jN]: _FOO, + }, + ], + 0, + [ + 0, + { + [_jN]: _baz, + }, + ], + ] +); +export var AllQueryStringTypes = op( + n0, + _AQST, + { + [_ht]: ["GET", "/AllQueryStringTypesInput", 200], + }, + () => AllQueryStringTypesInput, + () => Unit +); +export var ConstantAndVariableQueryString = op( + n0, + _CAVQS, + { + [_ht]: ["GET", "/ConstantAndVariableQueryString?foo=bar", 200], + }, + () => ConstantAndVariableQueryStringInput, + () => Unit +); +export var ConstantQueryString = op( + n0, + _CQS, + { + [_ht]: ["GET", "/ConstantQueryString/{hello}?foo=bar&hello", 200], + }, + () => ConstantQueryStringInput, + () => Unit +); +export var ContentTypeParameters = op( + n0, + _CTP, + { + [_ht]: ["POST", "/ContentTypeParameters", 200], + }, + () => ContentTypeParametersInput, + () => ContentTypeParametersOutput +); +export var DatetimeOffsets = op( + n0, + _DO, + { + [_ht]: ["POST", "/DatetimeOffsets", 200], + }, + () => Unit, + () => DatetimeOffsetsOutput +); +export var DocumentType = op( + n0, + _DTo, + { + [_ht]: ["PUT", "/DocumentType", 200], + }, + () => DocumentTypeInputOutput, + () => DocumentTypeInputOutput +); +export var DocumentTypeAsMapValue = op( + n0, + _DTAMV, + { + [_ht]: ["PUT", "/DocumentTypeAsMapValue", 200], + }, + () => DocumentTypeAsMapValueInputOutput, + () => DocumentTypeAsMapValueInputOutput +); +export var DocumentTypeAsPayload = op( + n0, + _DTAP, + { + [_ht]: ["PUT", "/DocumentTypeAsPayload", 200], + }, + () => DocumentTypeAsPayloadInputOutput, + () => DocumentTypeAsPayloadInputOutput +); +export var EmptyInputAndEmptyOutput = op( + n0, + _EIAEO, + { + [_ht]: ["POST", "/EmptyInputAndEmptyOutput", 200], + }, + () => EmptyInputAndEmptyOutputInput, + () => EmptyInputAndEmptyOutputOutput +); +export var EndpointOperation = op( + n0, + _EO, + { + [_ht]: ["POST", "/EndpointOperation", 200], + [_end]: ["foo."], + }, + () => Unit, + () => Unit +); +export var EndpointWithHostLabelOperation = op( + n0, + _EWHLO, + { + [_ht]: ["POST", "/EndpointWithHostLabelOperation", 200], + [_end]: ["foo.{label}."], + }, + () => HostLabelInput, + () => Unit +); +export var FractionalSeconds = op( + n0, + _FS, + { + [_ht]: ["POST", "/FractionalSeconds", 200], + }, + () => Unit, + () => FractionalSecondsOutput +); +export var GreetingWithErrors = op( + n0, + _GWE, + { + [_ht]: ["PUT", "/GreetingWithErrors", 200], + }, + () => Unit, + () => GreetingWithErrorsOutput +); +export var HostWithPathOperation = op( + n0, + _HWPO, + { + [_ht]: ["GET", "/HostWithPathOperation", 200], + }, + () => Unit, + () => Unit +); +export var HttpChecksumRequired = op( + n0, + _HCR, + { + [_ht]: ["POST", "/HttpChecksumRequired", 200], + }, + () => HttpChecksumRequiredInputOutput, + () => HttpChecksumRequiredInputOutput +); +export var HttpEmptyPrefixHeaders = op( + n0, + _HEPH, + { + [_ht]: ["GET", "/HttpEmptyPrefixHeaders", 200], + }, + () => HttpEmptyPrefixHeadersInput, + () => HttpEmptyPrefixHeadersOutput +); +export var HttpEnumPayload = op( + n0, + _HEP, + { + [_ht]: ["POST", "/EnumPayload", 200], + }, + () => EnumPayloadInput, + () => EnumPayloadInput +); +export var HttpPayloadTraits = op( + n0, + _HPT, + { + [_ht]: ["POST", "/HttpPayloadTraits", 200], + }, + () => HttpPayloadTraitsInputOutput, + () => HttpPayloadTraitsInputOutput +); +export var HttpPayloadTraitsWithMediaType = op( + n0, + _HPTWMT, + { + [_ht]: ["POST", "/HttpPayloadTraitsWithMediaType", 200], + }, + () => HttpPayloadTraitsWithMediaTypeInputOutput, + () => HttpPayloadTraitsWithMediaTypeInputOutput +); +export var HttpPayloadWithStructure = op( + n0, + _HPWS, + { + [_ht]: ["PUT", "/HttpPayloadWithStructure", 200], + }, + () => HttpPayloadWithStructureInputOutput, + () => HttpPayloadWithStructureInputOutput +); +export var HttpPayloadWithUnion = op( + n0, + _HPWU, + { + [_ht]: ["PUT", "/HttpPayloadWithUnion", 200], + }, + () => HttpPayloadWithUnionInputOutput, + () => HttpPayloadWithUnionInputOutput +); +export var HttpPrefixHeaders = op( + n0, + _HPH, + { + [_ht]: ["GET", "/HttpPrefixHeaders", 200], + }, + () => HttpPrefixHeadersInput, + () => HttpPrefixHeadersOutput +); +export var HttpPrefixHeadersInResponse = op( + n0, + _HPHIR, + { + [_ht]: ["GET", "/HttpPrefixHeadersResponse", 200], + }, + () => HttpPrefixHeadersInResponseInput, + () => HttpPrefixHeadersInResponseOutput +); +export var HttpRequestWithFloatLabels = op( + n0, + _HRWFL, + { + [_ht]: ["GET", "/FloatHttpLabels/{float}/{double}", 200], + }, + () => HttpRequestWithFloatLabelsInput, + () => Unit +); +export var HttpRequestWithGreedyLabelInPath = op( + n0, + _HRWGLIP, + { + [_ht]: ["GET", "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}", 200], + }, + () => HttpRequestWithGreedyLabelInPathInput, + () => Unit +); +export var HttpRequestWithLabels = op( + n0, + _HRWL, + { + [_ht]: [ + "GET", + "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}", + 200, + ], + }, + () => HttpRequestWithLabelsInput, + () => Unit +); +export var HttpRequestWithLabelsAndTimestampFormat = op( + n0, + _HRWLATF, + { + [_ht]: [ + "GET", + "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}", + 200, + ], + }, + () => HttpRequestWithLabelsAndTimestampFormatInput, + () => Unit +); +export var HttpRequestWithRegexLiteral = op( + n0, + _HRWRL, + { + [_ht]: ["GET", "/ReDosLiteral/{str}/(a+)+", 200], + }, + () => HttpRequestWithRegexLiteralInput, + () => Unit +); +export var HttpResponseCode = op( + n0, + _HRC, + { + [_ht]: ["PUT", "/HttpResponseCode", 200], + }, + () => Unit, + () => HttpResponseCodeOutput +); +export var HttpStringPayload = op( + n0, + _HSP, + { + [_ht]: ["POST", "/StringPayload", 200], + }, + () => StringPayloadInput, + () => StringPayloadInput +); +export var IgnoreQueryParamsInResponse = op( + n0, + _IQPIR, + { + [_ht]: ["GET", "/IgnoreQueryParamsInResponse", 200], + }, + () => Unit, + () => IgnoreQueryParamsInResponseOutput +); +export var InputAndOutputWithHeaders = op( + n0, + _IAOWH, + { + [_ht]: ["POST", "/InputAndOutputWithHeaders", 200], + }, + () => InputAndOutputWithHeadersIO, + () => InputAndOutputWithHeadersIO +); +export var JsonBlobs = op( + n0, + _JBs, + { + [_ht]: ["POST", "/JsonBlobs", 200], + }, + () => JsonBlobsInputOutput, + () => JsonBlobsInputOutput +); +export var JsonEnums = op( + n0, + _JE, + { + [_ht]: ["PUT", "/JsonEnums", 200], + }, + () => JsonEnumsInputOutput, + () => JsonEnumsInputOutput +); +export var JsonIntEnums = op( + n0, + _JIE, + { + [_ht]: ["PUT", "/JsonIntEnums", 200], + }, + () => JsonIntEnumsInputOutput, + () => JsonIntEnumsInputOutput +); +export var JsonLists = op( + n0, + _JL, + { + [_ht]: ["PUT", "/JsonLists", 200], + }, + () => JsonListsInputOutput, + () => JsonListsInputOutput +); +export var JsonMaps = op( + n0, + _JM, + { + [_ht]: ["POST", "/JsonMaps", 200], + }, + () => JsonMapsInputOutput, + () => JsonMapsInputOutput +); +export var JsonTimestamps = op( + n0, + _JT, + { + [_ht]: ["POST", "/JsonTimestamps", 200], + }, + () => JsonTimestampsInputOutput, + () => JsonTimestampsInputOutput +); +export var JsonUnions = op( + n0, + _JU, + { + [_ht]: ["PUT", "/JsonUnions", 200], + }, + () => UnionInputOutput, + () => UnionInputOutput +); +export var MalformedAcceptWithBody = op( + n0, + _MAWB, + { + [_ht]: ["POST", "/MalformedAcceptWithBody", 200], + }, + () => Unit, + () => GreetingStruct_n1 +); +export var MalformedAcceptWithGenericString = op( + n0, + _MAWGS, + { + [_ht]: ["POST", "/MalformedAcceptWithGenericString", 200], + }, + () => Unit, + () => MalformedAcceptWithGenericStringOutput +); +export var MalformedAcceptWithPayload = op( + n0, + _MAWP, + { + [_ht]: ["POST", "/MalformedAcceptWithPayload", 200], + }, + () => Unit, + () => MalformedAcceptWithPayloadOutput +); +export var MalformedBlob = op( + n0, + _MB, + { + [_ht]: ["POST", "/MalformedBlob", 200], + }, + () => MalformedBlobInput, + () => Unit +); +export var MalformedBoolean = op( + n0, + _MBa, + { + [_ht]: ["POST", "/MalformedBoolean/{booleanInPath}", 200], + }, + () => MalformedBooleanInput, + () => Unit +); +export var MalformedByte = op( + n0, + _MBal, + { + [_ht]: ["POST", "/MalformedByte/{byteInPath}", 200], + }, + () => MalformedByteInput, + () => Unit +); +export var MalformedContentTypeWithBody = op( + n0, + _MCTWB, + { + [_ht]: ["POST", "/MalformedContentTypeWithBody", 200], + }, + () => GreetingStruct_n1, + () => Unit +); +export var MalformedContentTypeWithGenericString = op( + n0, + _MCTWGS, + { + [_ht]: ["POST", "/MalformedContentTypeWithGenericString", 200], + }, + () => MalformedContentTypeWithGenericStringInput, + () => Unit +); +export var MalformedContentTypeWithoutBody = op( + n0, + _MCTWBa, + { + [_ht]: ["POST", "/MalformedContentTypeWithoutBody", 200], + }, + () => Unit, + () => Unit +); +export var MalformedContentTypeWithoutBodyEmptyInput = op( + n0, + _MCTWBEI, + { + [_ht]: ["POST", "/MalformedContentTypeWithoutBodyEmptyInput", 200], + }, + () => MalformedContentTypeWithoutBodyEmptyInputInput, + () => Unit +); +export var MalformedContentTypeWithPayload = op( + n0, + _MCTWP, + { + [_ht]: ["POST", "/MalformedContentTypeWithPayload", 200], + }, + () => MalformedContentTypeWithPayloadInput, + () => Unit +); +export var MalformedDouble = op( + n0, + _MD, + { + [_ht]: ["POST", "/MalformedDouble/{doubleInPath}", 200], + }, + () => MalformedDoubleInput, + () => Unit +); +export var MalformedFloat = op( + n0, + _MF, + { + [_ht]: ["POST", "/MalformedFloat/{floatInPath}", 200], + }, + () => MalformedFloatInput, + () => Unit +); +export var MalformedInteger = op( + n0, + _MI, + { + [_ht]: ["POST", "/MalformedInteger/{integerInPath}", 200], + }, + () => MalformedIntegerInput, + () => Unit +); +export var MalformedList = op( + n0, + _ML, + { + [_ht]: ["POST", "/MalformedList", 200], + }, + () => MalformedListInput, + () => Unit +); +export var MalformedLong = op( + n0, + _MLa, + { + [_ht]: ["POST", "/MalformedLong/{longInPath}", 200], + }, + () => MalformedLongInput, + () => Unit +); +export var MalformedMap = op( + n0, + _MM, + { + [_ht]: ["POST", "/MalformedMap", 200], + }, + () => MalformedMapInput, + () => Unit +); +export var MalformedRequestBody = op( + n0, + _MRB, + { + [_ht]: ["POST", "/MalformedRequestBody", 200], + }, + () => MalformedRequestBodyInput, + () => Unit +); +export var MalformedShort = op( + n0, + _MS, + { + [_ht]: ["POST", "/MalformedShort/{shortInPath}", 200], + }, + () => MalformedShortInput, + () => Unit +); +export var MalformedString = op( + n0, + _MSa, + { + [_ht]: ["POST", "/MalformedString", 200], + }, + () => MalformedStringInput, + () => Unit +); +export var MalformedTimestampBodyDateTime = op( + n0, + _MTBDT, + { + [_ht]: ["POST", "/MalformedTimestampBodyDateTime", 200], + }, + () => MalformedTimestampBodyDateTimeInput, + () => Unit +); +export var MalformedTimestampBodyDefault = op( + n0, + _MTBD, + { + [_ht]: ["POST", "/MalformedTimestampBodyDefault", 200], + }, + () => MalformedTimestampBodyDefaultInput, + () => Unit +); +export var MalformedTimestampBodyHttpDate = op( + n0, + _MTBHD, + { + [_ht]: ["POST", "/MalformedTimestampBodyHttpDate", 200], + }, + () => MalformedTimestampBodyHttpDateInput, + () => Unit +); +export var MalformedTimestampHeaderDateTime = op( + n0, + _MTHDT, + { + [_ht]: ["POST", "/MalformedTimestampHeaderDateTime", 200], + }, + () => MalformedTimestampHeaderDateTimeInput, + () => Unit +); +export var MalformedTimestampHeaderDefault = op( + n0, + _MTHD, + { + [_ht]: ["POST", "/MalformedTimestampHeaderDefault", 200], + }, + () => MalformedTimestampHeaderDefaultInput, + () => Unit +); +export var MalformedTimestampHeaderEpoch = op( + n0, + _MTHE, + { + [_ht]: ["POST", "/MalformedTimestampHeaderEpoch", 200], + }, + () => MalformedTimestampHeaderEpochInput, + () => Unit +); +export var MalformedTimestampPathDefault = op( + n0, + _MTPD, + { + [_ht]: ["POST", "/MalformedTimestampPathDefault/{timestamp}", 200], + }, + () => MalformedTimestampPathDefaultInput, + () => Unit +); +export var MalformedTimestampPathEpoch = op( + n0, + _MTPE, + { + [_ht]: ["POST", "/MalformedTimestampPathEpoch/{timestamp}", 200], + }, + () => MalformedTimestampPathEpochInput, + () => Unit +); +export var MalformedTimestampPathHttpDate = op( + n0, + _MTPHD, + { + [_ht]: ["POST", "/MalformedTimestampPathHttpDate/{timestamp}", 200], + }, + () => MalformedTimestampPathHttpDateInput, + () => Unit +); +export var MalformedTimestampQueryDefault = op( + n0, + _MTQD, + { + [_ht]: ["POST", "/MalformedTimestampQueryDefault", 200], + }, + () => MalformedTimestampQueryDefaultInput, + () => Unit +); +export var MalformedTimestampQueryEpoch = op( + n0, + _MTQE, + { + [_ht]: ["POST", "/MalformedTimestampQueryEpoch", 200], + }, + () => MalformedTimestampQueryEpochInput, + () => Unit +); +export var MalformedTimestampQueryHttpDate = op( + n0, + _MTQHD, + { + [_ht]: ["POST", "/MalformedTimestampQueryHttpDate", 200], + }, + () => MalformedTimestampQueryHttpDateInput, + () => Unit +); +export var MalformedUnion = op( + n0, + _MUa, + { + [_ht]: ["POST", "/MalformedUnion", 200], + }, + () => MalformedUnionInput, + () => Unit +); +export var MediaTypeHeader = op( + n0, + _MTH, + { + [_ht]: ["GET", "/MediaTypeHeader", 200], + }, + () => MediaTypeHeaderInput, + () => MediaTypeHeaderOutput +); +export var NoInputAndNoOutput = op( + n0, + _NIANO, + { + [_ht]: ["POST", "/NoInputAndNoOutput", 200], + }, + () => Unit, + () => Unit +); +export var NoInputAndOutput = op( + n0, + _NIAO, + { + [_ht]: ["POST", "/NoInputAndOutputOutput", 200], + }, + () => Unit, + () => NoInputAndOutputOutput +); +export var NullAndEmptyHeadersClient = op( + n0, + _NAEHC, + { + [_ht]: ["GET", "/NullAndEmptyHeadersClient", 200], + }, + () => NullAndEmptyHeadersIO, + () => NullAndEmptyHeadersIO +); +export var NullAndEmptyHeadersServer = op( + n0, + _NAEHS, + { + [_ht]: ["GET", "/NullAndEmptyHeadersServer", 200], + }, + () => NullAndEmptyHeadersIO, + () => NullAndEmptyHeadersIO +); +export var OmitsNullSerializesEmptyString = op( + n0, + _ONSES, + { + [_ht]: ["GET", "/OmitsNullSerializesEmptyString", 200], + }, + () => OmitsNullSerializesEmptyStringInput, + () => Unit +); +export var OmitsSerializingEmptyLists = op( + n0, + _OSEL, + { + [_ht]: ["POST", "/OmitsSerializingEmptyLists", 200], + }, + () => OmitsSerializingEmptyListsInput, + () => Unit +); +export var OperationWithDefaults = op( + n0, + _OWD, + { + [_ht]: ["POST", "/OperationWithDefaults", 200], + }, + () => OperationWithDefaultsInput, + () => OperationWithDefaultsOutput +); +export var OperationWithNestedStructure = op( + n0, + _OWNS, + { + [_ht]: ["POST", "/OperationWithNestedStructure", 200], + }, + () => OperationWithNestedStructureInput, + () => OperationWithNestedStructureOutput +); +export var PostPlayerAction = op( + n0, + _PPA, + { + [_ht]: ["POST", "/PostPlayerAction", 200], + }, + () => PostPlayerActionInput, + () => PostPlayerActionOutput +); +export var PostUnionWithJsonName = op( + n0, + _PUWJN, + { + [_ht]: ["POST", "/PostUnionWithJsonName", 200], + }, + () => PostUnionWithJsonNameInput, + () => PostUnionWithJsonNameOutput +); +export var PutWithContentEncoding = op( + n0, + _PWCE, + { + [_ht]: ["POST", "/requestcompression/putcontentwithencoding", 200], + }, + () => PutWithContentEncodingInput, + () => Unit +); +export var QueryIdempotencyTokenAutoFill = op( + n0, + _QITAF, + { + [_ht]: ["POST", "/QueryIdempotencyTokenAutoFill", 200], + }, + () => QueryIdempotencyTokenAutoFillInput, + () => Unit +); +export var QueryParamsAsStringListMap = op( + n0, + _QPASLM, + { + [_ht]: ["POST", "/StringListMap", 200], + }, + () => QueryParamsAsStringListMapInput, + () => Unit +); +export var QueryPrecedence = op( + n0, + _QP, + { + [_ht]: ["POST", "/Precedence", 200], + }, + () => QueryPrecedenceInput, + () => Unit +); +export var RecursiveShapes = op( + n0, + _RS, + { + [_ht]: ["PUT", "/RecursiveShapes", 200], + }, + () => RecursiveShapesInputOutput, + () => RecursiveShapesInputOutput +); +export var ResponseCodeHttpFallback = op( + n0, + _RCHF, + { + [_ht]: ["GET", "/responseCodeHttpFallback", 201], + }, + () => ResponseCodeHttpFallbackInputOutput, + () => ResponseCodeHttpFallbackInputOutput +); +export var ResponseCodeRequired = op( + n0, + _RCR, + { + [_ht]: ["GET", "/responseCodeRequired", 200], + }, + () => Unit, + () => ResponseCodeRequiredOutput +); +export var SimpleScalarProperties = op( + n0, + _SSP, + { + [_ht]: ["PUT", "/SimpleScalarProperties", 200], + }, + () => SimpleScalarPropertiesInputOutput, + () => SimpleScalarPropertiesInputOutput +); +export var SparseJsonLists = op( + n0, + _SJL, + { + [_ht]: ["PUT", "/SparseJsonLists", 200], + }, + () => SparseJsonListsInputOutput, + () => SparseJsonListsInputOutput +); +export var SparseJsonMaps = op( + n0, + _SJM, + { + [_ht]: ["POST", "/SparseJsonMaps", 200], + }, + () => SparseJsonMapsInputOutput, + () => SparseJsonMapsInputOutput +); +export var StreamingTraits = op( + n0, + _ST, + { + [_ht]: ["POST", "/StreamingTraits", 200], + }, + () => StreamingTraitsInputOutput, + () => StreamingTraitsInputOutput +); +export var StreamingTraitsRequireLength = op( + n0, + _STRL, + { + [_ht]: ["POST", "/StreamingTraitsRequireLength", 200], + }, + () => StreamingTraitsRequireLengthInput, + () => Unit +); +export var StreamingTraitsWithMediaType = op( + n0, + _STWMT, + { + [_ht]: ["POST", "/StreamingTraitsWithMediaType", 200], + }, + () => StreamingTraitsWithMediaTypeInputOutput, + () => StreamingTraitsWithMediaTypeInputOutput +); +export var TestBodyStructure = op( + n0, + _TBS, + { + [_ht]: ["POST", "/body", 200], + }, + () => TestBodyStructureInputOutput, + () => TestBodyStructureInputOutput +); +export var TestGetNoInputNoPayload = op( + n0, + _TGNINP, + { + [_ht]: ["GET", "/no_input_no_payload", 200], + }, + () => Unit, + () => TestNoPayloadInputOutput +); +export var TestGetNoPayload = op( + n0, + _TGNP, + { + [_ht]: ["GET", "/no_payload", 200], + }, + () => TestNoPayloadInputOutput, + () => TestNoPayloadInputOutput +); +export var TestPayloadBlob = op( + n0, + _TPBe, + { + [_ht]: ["POST", "/blob_payload", 200], + }, + () => TestPayloadBlobInputOutput, + () => TestPayloadBlobInputOutput +); +export var TestPayloadStructure = op( + n0, + _TPS, + { + [_ht]: ["POST", "/payload", 200], + }, + () => TestPayloadStructureInputOutput, + () => TestPayloadStructureInputOutput +); +export var TestPostNoInputNoPayload = op( + n0, + _TPNINP, + { + [_ht]: ["POST", "/no_input_no_payload", 200], + }, + () => Unit, + () => TestNoPayloadInputOutput +); +export var TestPostNoPayload = op( + n0, + _TPNP, + { + [_ht]: ["POST", "/no_payload", 200], + }, + () => TestNoPayloadInputOutput, + () => TestNoPayloadInputOutput +); +export var TimestampFormatHeaders = op( + n0, + _TFH, + { + [_ht]: ["POST", "/TimestampFormatHeaders", 200], + }, + () => TimestampFormatHeadersIO, + () => TimestampFormatHeadersIO +); +export var UnitInputAndOutput = op( + n0, + _UIAO, + { + [_ht]: ["POST", "/UnitInputAndOutput", 200], + }, + () => Unit, + () => Unit +); diff --git a/private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts new file mode 100644 index 0000000000000..5f2fbe3b3f31d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts @@ -0,0 +1,10480 @@ +// smithy-typescript generated code +import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; +import { buildQueryString } from "@smithy/querystring-builder"; +import { Encoder as __Encoder } from "@smithy/types"; +import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; +import { Readable } from "stream"; +import { expect, test as it } from "vitest"; + +import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand"; +import { ConstantAndVariableQueryStringCommand } from "../../src/commands/ConstantAndVariableQueryStringCommand"; +import { ConstantQueryStringCommand } from "../../src/commands/ConstantQueryStringCommand"; +import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; +import { DocumentTypeAsMapValueCommand } from "../../src/commands/DocumentTypeAsMapValueCommand"; +import { DocumentTypeAsPayloadCommand } from "../../src/commands/DocumentTypeAsPayloadCommand"; +import { DocumentTypeCommand } from "../../src/commands/DocumentTypeCommand"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { FractionalSecondsCommand } from "../../src/commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HostWithPathOperationCommand } from "../../src/commands/HostWithPathOperationCommand"; +import { HttpChecksumRequiredCommand } from "../../src/commands/HttpChecksumRequiredCommand"; +import { HttpEmptyPrefixHeadersCommand } from "../../src/commands/HttpEmptyPrefixHeadersCommand"; +import { HttpEnumPayloadCommand } from "../../src/commands/HttpEnumPayloadCommand"; +import { HttpPayloadTraitsCommand } from "../../src/commands/HttpPayloadTraitsCommand"; +import { HttpPayloadTraitsWithMediaTypeCommand } from "../../src/commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { HttpPayloadWithStructureCommand } from "../../src/commands/HttpPayloadWithStructureCommand"; +import { HttpPayloadWithUnionCommand } from "../../src/commands/HttpPayloadWithUnionCommand"; +import { HttpPrefixHeadersCommand } from "../../src/commands/HttpPrefixHeadersCommand"; +import { HttpPrefixHeadersInResponseCommand } from "../../src/commands/HttpPrefixHeadersInResponseCommand"; +import { HttpRequestWithFloatLabelsCommand } from "../../src/commands/HttpRequestWithFloatLabelsCommand"; +import { HttpRequestWithGreedyLabelInPathCommand } from "../../src/commands/HttpRequestWithGreedyLabelInPathCommand"; +import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../src/commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { HttpRequestWithLabelsCommand } from "../../src/commands/HttpRequestWithLabelsCommand"; +import { HttpRequestWithRegexLiteralCommand } from "../../src/commands/HttpRequestWithRegexLiteralCommand"; +import { HttpResponseCodeCommand } from "../../src/commands/HttpResponseCodeCommand"; +import { HttpStringPayloadCommand } from "../../src/commands/HttpStringPayloadCommand"; +import { IgnoreQueryParamsInResponseCommand } from "../../src/commands/IgnoreQueryParamsInResponseCommand"; +import { InputAndOutputWithHeadersCommand } from "../../src/commands/InputAndOutputWithHeadersCommand"; +import { JsonBlobsCommand } from "../../src/commands/JsonBlobsCommand"; +import { JsonEnumsCommand } from "../../src/commands/JsonEnumsCommand"; +import { JsonIntEnumsCommand } from "../../src/commands/JsonIntEnumsCommand"; +import { JsonListsCommand } from "../../src/commands/JsonListsCommand"; +import { JsonMapsCommand } from "../../src/commands/JsonMapsCommand"; +import { JsonTimestampsCommand } from "../../src/commands/JsonTimestampsCommand"; +import { JsonUnionsCommand } from "../../src/commands/JsonUnionsCommand"; +import { MediaTypeHeaderCommand } from "../../src/commands/MediaTypeHeaderCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +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"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryParamsAsStringListMapCommand } from "../../src/commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommand } from "../../src/commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommand } from "../../src/commands/RecursiveShapesCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { SparseJsonListsCommand } from "../../src/commands/SparseJsonListsCommand"; +import { SparseJsonMapsCommand } from "../../src/commands/SparseJsonMapsCommand"; +import { StreamingTraitsCommand } from "../../src/commands/StreamingTraitsCommand"; +import { StreamingTraitsRequireLengthCommand } from "../../src/commands/StreamingTraitsRequireLengthCommand"; +import { StreamingTraitsWithMediaTypeCommand } from "../../src/commands/StreamingTraitsWithMediaTypeCommand"; +import { TestBodyStructureCommand } from "../../src/commands/TestBodyStructureCommand"; +import { TestGetNoInputNoPayloadCommand } from "../../src/commands/TestGetNoInputNoPayloadCommand"; +import { TestGetNoPayloadCommand } from "../../src/commands/TestGetNoPayloadCommand"; +import { TestPayloadBlobCommand } from "../../src/commands/TestPayloadBlobCommand"; +import { TestPayloadStructureCommand } from "../../src/commands/TestPayloadStructureCommand"; +import { TestPostNoInputNoPayloadCommand } from "../../src/commands/TestPostNoInputNoPayloadCommand"; +import { TestPostNoPayloadCommand } from "../../src/commands/TestPostNoPayloadCommand"; +import { TimestampFormatHeadersCommand } from "../../src/commands/TimestampFormatHeadersCommand"; +import { UnitInputAndOutputCommand } from "../../src/commands/UnitInputAndOutputCommand"; +import { RestJsonProtocolClient } from "../../src/RestJsonProtocolClient"; + +/** + * Throws an expected exception that contains the serialized request. + */ +class EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error { + constructor(readonly request: HttpRequest) { + super(); + } +} + +/** + * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a + * request. The thrown exception contains the serialized request. + */ +class RequestSerializationTestHandler implements HttpHandler { + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request)); + } + updateHttpClientConfig(key: never, value: never): void {} + httpHandlerConfigs() { + return {}; + } +} + +/** + * Returns a resolved Promise of the specified response contents. + */ +class ResponseDeserializationTestHandler implements HttpHandler { + isSuccess: boolean; + code: number; + headers: HeaderBag; + body: string | Uint8Array; + isBase64Body: boolean; + + constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) { + this.isSuccess = isSuccess; + this.code = code; + if (headers === undefined) { + this.headers = {}; + } else { + this.headers = headers; + } + if (body === undefined) { + body = ""; + } + this.body = body; + this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), "base64").toString("base64") === body; + } + + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.resolve({ + response: new HttpResponse({ + statusCode: this.code, + headers: this.headers, + body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]), + }), + }); + } + + updateHttpClientConfig(key: never, value: never): void {} + + httpHandlerConfigs() { + return {}; + } +} + +interface comparableParts { + [key: string]: string; +} + +/** + * Generates a standard map of un-equal values given input parts. + */ +const compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => { + const unequalParts: any = {}; + Object.keys(expectedParts).forEach((key) => { + if (generatedParts[key] === undefined) { + unequalParts[key] = { exp: expectedParts[key], gen: undefined }; + } else if (!equivalentContents(expectedParts[key], generatedParts[key])) { + unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] }; + } + }); + + Object.keys(generatedParts).forEach((key) => { + if (expectedParts[key] === undefined) { + unequalParts[key] = { exp: undefined, gen: generatedParts[key] }; + } + }); + + if (Object.keys(unequalParts).length !== 0) { + return unequalParts; + } + return undefined; +}; + +/** + * Compares all types for equivalent contents, doing nested + * equality checks based on non-`$metadata` + * properties that have defined values. + */ +const equivalentContents = (expected: any, generated: any): boolean => { + if (typeof (global as any).expect === "function") { + expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected)); + return true; + } + + const localExpected = expected; + + // Short circuit on equality. + if (localExpected == generated) { + return true; + } + + if (typeof expected !== "object") { + return expected === generated; + } + + // If a test fails with an issue in the below 6 lines, it's likely + // due to an issue in the nestedness or existence of the property + // being compared. + delete localExpected["$metadata"]; + delete generated["$metadata"]; + Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]); + Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]); + + const expectedProperties = Object.getOwnPropertyNames(localExpected); + const generatedProperties = Object.getOwnPropertyNames(generated); + + // Short circuit on different property counts. + if (expectedProperties.length != generatedProperties.length) { + return false; + } + + // Compare properties directly. + for (let index = 0; index < expectedProperties.length; index++) { + const propertyName = expectedProperties[index]; + if (!equivalentContents(localExpected[propertyName], generated[propertyName])) { + return false; + } + } + + return true; +}; + +const clientParams = { + region: "us-west-2", + credentials: { accessKeyId: "key", secretAccessKey: "secret" }, + endpoint: () => { + const url = new URL("https://localhost/"); + return Promise.resolve({ + hostname: url.hostname, + protocol: url.protocol, + path: url.pathname, + }) as Promise; + }, +}; + +/** + * A wrapper function that shadows `fail` from jest-jasmine2 + * (jasmine2 was replaced with circus in > v27 as the default test runner) + */ +const fail = (error?: any): never => { + throw new Error(error); +}; + +/** + * Hexadecimal to byteArray. + */ +const toBytes = (hex: string) => { + return Buffer.from(hex, "base64"); +}; + +function normalizeByteArrayType(data: any) { + // normalize float32 errors + if (typeof data === "number") { + const u = new Uint8Array(4); + const dv = new DataView(u.buffer, u.byteOffset, u.byteLength); + dv.setFloat32(0, data); + return dv.getFloat32(0); + } + if (!data || typeof data !== "object") { + return data; + } + if (data instanceof Uint8Array) { + return Uint8Array.from(data); + } + if (data instanceof String || data instanceof Boolean || data instanceof Number) { + return data.valueOf(); + } + const output = {} as any; + for (const key of Object.getOwnPropertyNames(data)) { + output[key] = normalizeByteArrayType(data[key]); + } + return output; +} + +/** + * Serializes query string parameters with all supported types + */ +it("RestJsonAllQueryStringTypes:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryString: "Hello there", + queryStringList: ["a", "b", "c"], + queryStringSet: ["a", "b", "c"], + queryByte: 1, + queryShort: 2, + queryInteger: 3, + queryIntegerList: [1, 2, 3], + queryIntegerSet: [1, 2, 3], + queryLong: 4, + queryFloat: 1.1, + queryDouble: 1.1, + queryDoubleList: [1.1, 2.1, 3.1], + queryBoolean: true, + queryBooleanList: [true, false, true], + queryTimestamp: new Date(1000), + queryTimestampList: [new Date(1000), new Date(2000), new Date(3000)], + queryEnum: "Foo", + queryEnumList: ["Foo", "Baz", "Bar"], + queryIntegerEnum: 1, + queryIntegerEnumList: [1, 2, 3], + queryParamsMapOfStringList: { + String: ["Hello there"], + StringList: ["a", "b", "c"], + StringSet: ["a", "b", "c"], + Byte: ["1"], + Short: ["2"], + Integer: ["3"], + IntegerList: ["1", "2", "3"], + IntegerSet: ["1", "2", "3"], + Long: ["4"], + Float: ["1.1"], + Double: ["1.1"], + DoubleList: ["1.1", "2.1", "3.1"], + Boolean: ["true"], + BooleanList: ["true", "false", "true"], + Timestamp: ["1970-01-01T00:00:01Z"], + TimestampList: ["1970-01-01T00:00:01Z", "1970-01-01T00:00:02Z", "1970-01-01T00:00:03Z"], + Enum: ["Foo"], + EnumList: ["Foo", "Baz", "Bar"], + IntegerEnum: ["1"], + IntegerEnumList: ["1", "2", "3"], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("String=Hello%20there"); + expect(queryString).toContain("StringList=a"); + expect(queryString).toContain("StringList=b"); + expect(queryString).toContain("StringList=c"); + expect(queryString).toContain("StringSet=a"); + expect(queryString).toContain("StringSet=b"); + expect(queryString).toContain("StringSet=c"); + expect(queryString).toContain("Byte=1"); + expect(queryString).toContain("Short=2"); + expect(queryString).toContain("Integer=3"); + expect(queryString).toContain("IntegerList=1"); + expect(queryString).toContain("IntegerList=2"); + expect(queryString).toContain("IntegerList=3"); + expect(queryString).toContain("IntegerSet=1"); + expect(queryString).toContain("IntegerSet=2"); + expect(queryString).toContain("IntegerSet=3"); + expect(queryString).toContain("Long=4"); + expect(queryString).toContain("Float=1.1"); + expect(queryString).toContain("Double=1.1"); + expect(queryString).toContain("DoubleList=1.1"); + expect(queryString).toContain("DoubleList=2.1"); + expect(queryString).toContain("DoubleList=3.1"); + expect(queryString).toContain("Boolean=true"); + expect(queryString).toContain("BooleanList=true"); + expect(queryString).toContain("BooleanList=false"); + expect(queryString).toContain("BooleanList=true"); + expect(queryString).toContain("Timestamp=1970-01-01T00%3A00%3A01Z"); + expect(queryString).toContain("TimestampList=1970-01-01T00%3A00%3A01Z"); + expect(queryString).toContain("TimestampList=1970-01-01T00%3A00%3A02Z"); + expect(queryString).toContain("TimestampList=1970-01-01T00%3A00%3A03Z"); + expect(queryString).toContain("Enum=Foo"); + expect(queryString).toContain("EnumList=Foo"); + expect(queryString).toContain("EnumList=Baz"); + expect(queryString).toContain("EnumList=Bar"); + expect(queryString).toContain("IntegerEnum=1"); + expect(queryString).toContain("IntegerEnumList=1"); + expect(queryString).toContain("IntegerEnumList=2"); + expect(queryString).toContain("IntegerEnumList=3"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Handles query string maps + */ +it("RestJsonQueryStringMap:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryParamsMapOfStringList: { + QueryParamsStringKeyA: ["Foo"], + QueryParamsStringKeyB: ["Bar"], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("QueryParamsStringKeyA=Foo"); + expect(queryString).toContain("QueryParamsStringKeyB=Bar"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Handles escaping all required characters in the query string. + */ +it("RestJsonQueryStringEscaping:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryString: " %:/?#[]@!$&'()*+,;=😹", + queryParamsMapOfStringList: { + String: [" %:/?#[]@!$&'()*+,;=😹"], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("String=%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling NaN float query values. + */ +it("RestJsonSupportsNaNFloatQueryValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryFloat: NaN, + queryDouble: NaN, + queryParamsMapOfStringList: { + Float: ["NaN"], + Double: ["NaN"], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Float=NaN"); + expect(queryString).toContain("Double=NaN"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling Infinity float query values. + */ +it("RestJsonSupportsInfinityFloatQueryValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryFloat: Infinity, + queryDouble: Infinity, + queryParamsMapOfStringList: { + Float: ["Infinity"], + Double: ["Infinity"], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Float=Infinity"); + expect(queryString).toContain("Double=Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling -Infinity float query values. + */ +it("RestJsonSupportsNegativeInfinityFloatQueryValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryFloat: -Infinity, + queryDouble: -Infinity, + queryParamsMapOfStringList: { + Float: ["-Infinity"], + Double: ["-Infinity"], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Float=-Infinity"); + expect(queryString).toContain("Double=-Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Query values of 0 and false are serialized + */ +it("RestJsonZeroAndFalseQueryValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryInteger: 0, + queryBoolean: false, + queryParamsMapOfStringList: { + Integer: ["0"], + Boolean: ["false"], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Integer=0"); + expect(queryString).toContain("Boolean=false"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Mixes constant and variable query string parameters + */ +it("RestJsonConstantAndVariableQueryStringMissingOneValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new ConstantAndVariableQueryStringCommand({ + baz: "bam", + } 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("GET"); + expect(r.path).toBe("/ConstantAndVariableQueryString"); + + expect( + r.query["maybeSet"], + `Query key "maybeSet" should have been undefined in ${JSON.stringify(r.query)}` + ).toBeUndefined(); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("foo=bar"); + expect(queryString).toContain("baz=bam"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Mixes constant and variable query string parameters + */ +it("RestJsonConstantAndVariableQueryStringAllValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new ConstantAndVariableQueryStringCommand({ + baz: "bam", + maybeSet: "yes", + } 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("GET"); + expect(r.path).toBe("/ConstantAndVariableQueryString"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("foo=bar"); + expect(queryString).toContain("baz=bam"); + expect(queryString).toContain("maybeSet=yes"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Includes constant query string parameters + */ +it("RestJsonConstantQueryString:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new ConstantQueryStringCommand({ + hello: "hi", + } 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("GET"); + expect(r.path).toBe("/ConstantQueryString/hi"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("foo=bar"); + expect(queryString).toContain("hello"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("RestJsonDateTimeWithNegativeOffset:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + undefined, + ` { + "datetime": "2019-12-16T22:48:18-01:00" + } + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("RestJsonDateTimeWithPositiveOffset:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + undefined, + ` { + "datetime": "2019-12-17T00:48:18+01:00" + } + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes document types as part of the JSON request payload with no escaping. + */ +it("DocumentTypeInputWithObject:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeCommand({ + stringValue: "string", + documentValue: { + foo: "bar", + }, + } 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("PUT"); + expect(r.path).toBe("/DocumentType"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringValue\": \"string\", + \"documentValue\": { + \"foo\": \"bar\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes document types using a string. + */ +it("DocumentInputWithString:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeCommand({ + stringValue: "string", + documentValue: "hello", + } 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("PUT"); + expect(r.path).toBe("/DocumentType"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringValue\": \"string\", + \"documentValue\": \"hello\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes document types using a number. + */ +it("DocumentInputWithNumber:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeCommand({ + stringValue: "string", + documentValue: 10, + } 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("PUT"); + expect(r.path).toBe("/DocumentType"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringValue\": \"string\", + \"documentValue\": 10 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes document types using a boolean. + */ +it("DocumentInputWithBoolean:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeCommand({ + stringValue: "string", + documentValue: true, + } 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("PUT"); + expect(r.path).toBe("/DocumentType"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringValue\": \"string\", + \"documentValue\": true + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes document types using a list. + */ +it("DocumentInputWithList:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeCommand({ + stringValue: "string", + documentValue: [ + true, + "hi", + [1, 2], + { + foo: { + baz: [3, 4], + }, + }, + ], + } 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("PUT"); + expect(r.path).toBe("/DocumentType"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringValue\": \"string\", + \"documentValue\": [ + true, + \"hi\", + [ + 1, + 2 + ], + { + \"foo\": { + \"baz\": [ + 3, + 4 + ] + } + } + ] + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes documents as part of the JSON response payload with no escaping. + */ +it("DocumentOutput:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringValue": "string", + "documentValue": { + "foo": "bar" + } + }` + ), + }); + + const params: any = {}; + const command = new DocumentTypeCommand(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 = [ + { + stringValue: "string", + documentValue: { + foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Document types can be JSON scalars too. + */ +it("DocumentOutputString:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringValue": "string", + "documentValue": "hello" + }` + ), + }); + + const params: any = {}; + const command = new DocumentTypeCommand(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 = [ + { + stringValue: "string", + documentValue: "hello", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Document types can be JSON scalars too. + */ +it("DocumentOutputNumber:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringValue": "string", + "documentValue": 10 + }` + ), + }); + + const params: any = {}; + const command = new DocumentTypeCommand(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 = [ + { + stringValue: "string", + documentValue: 10, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Document types can be JSON scalars too. + */ +it("DocumentOutputBoolean:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringValue": "string", + "documentValue": false + }` + ), + }); + + const params: any = {}; + const command = new DocumentTypeCommand(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 = [ + { + stringValue: "string", + documentValue: false, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Document types can be JSON arrays. + */ +it("DocumentOutputArray:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringValue": "string", + "documentValue": [ + true, + false + ] + }` + ), + }); + + const params: any = {}; + const command = new DocumentTypeCommand(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 = [ + { + stringValue: "string", + documentValue: [true, false], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a map that uses documents as the value. + */ +it("DocumentTypeAsMapValueInput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeAsMapValueCommand({ + docValuedMap: { + foo: { + f: 1, + o: 2, + }, + bar: ["b", "a", "r"], + baz: "BAZ", + } 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("PUT"); + expect(r.path).toBe("/DocumentTypeAsMapValue"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"docValuedMap\": { + \"foo\": { \"f\": 1, \"o\": 2 }, + \"bar\": [ \"b\", \"a\", \"r\" ], + \"baz\": \"BAZ\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a map that uses documents as the value. + */ +it("DocumentTypeAsMapValueOutput:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "docValuedMap": { + "foo": { "f": 1, "o": 2 }, + "bar": [ "b", "a", "r" ], + "baz": "BAZ" + } + }` + ), + }); + + const params: any = {}; + const command = new DocumentTypeAsMapValueCommand(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 = [ + { + docValuedMap: { + foo: { + f: 1, + o: 2, + }, + bar: ["b", "a", "r"], + baz: "BAZ", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a document as the target of the httpPayload trait. + */ +it("DocumentTypeAsPayloadInput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeAsPayloadCommand({ + documentValue: { + foo: "bar", + }, + } 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("PUT"); + expect(r.path).toBe("/DocumentTypeAsPayload"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"foo\": \"bar\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a document as the target of the httpPayload trait using a string. + */ +it("DocumentTypeAsPayloadInputString:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new DocumentTypeAsPayloadCommand({ + documentValue: "hello", + } 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("PUT"); + expect(r.path).toBe("/DocumentTypeAsPayload"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `\"hello\"`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a document as the target of the httpPayload trait. + */ +it("DocumentTypeAsPayloadOutput:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "foo": "bar" + }` + ), + }); + + const params: any = {}; + const command = new DocumentTypeAsPayloadCommand(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 = [ + { + documentValue: { + foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a document as a payload string. + */ +it("DocumentTypeAsPayloadOutputString:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `"hello"` + ), + }); + + const params: any = {}; + const command = new DocumentTypeAsPayloadCommand(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 = [ + { + documentValue: "hello", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Clients should not serialize a JSON payload when no parameters + * are given that are sent in the body. A service will tolerate + * clients that omit a payload or that send a JSON object. + */ +it("RestJsonEmptyInputAndEmptyOutput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyInputAndEmptyOutputCommand({} 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("/EmptyInputAndEmptyOutput"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * As of January 2021, server implementations are expected to + * respond with a JSON object regardless of if the output + * parameters are empty. + */ +it("RestJsonEmptyInputAndEmptyOutput:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new EmptyInputAndEmptyOutputCommand(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); +}); + +/** + * This test ensures that clients can gracefully handle + * situations where a service omits a JSON payload entirely. + */ +it("RestJsonEmptyInputAndEmptyOutputJsonObjectOutput:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new EmptyInputAndEmptyOutputCommand(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); +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait. + */ +it("RestJsonEndpointTrait:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointOperationCommand({}); + 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("/EndpointOperation"); + + expect(r.headers["host"]).toBe("foo.example.com"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait, and can use the host label trait to define + * further customization based on user input. + */ +it("RestJsonEndpointTraitWithHostLabel:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointWithHostLabelOperationCommand({ + label: "bar", + } 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("/EndpointWithHostLabelOperation"); + + expect(r.headers["host"]).toBe("foo.bar.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"label\": \"bar\"}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that clients can correctly parse datetime timestamps with fractional seconds + */ +it("RestJsonDateTimeWithFractionalSeconds:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + undefined, + ` { + "datetime": "2000-01-02T20:34:56.123Z" + } + ` + ), + }); + + const params: any = {}; + const command = new FractionalSecondsCommand(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 = [ + { + datetime: new Date(9.46845296123e8 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that operations with errors successfully know how + * to deserialize a successful response. As of January 2021, + * server implementations are expected to respond with a + * JSON object regardless of if the output parameters are + * empty. + */ +it("RestJsonGreetingWithErrors:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-greeting": "Hello", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(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 = [ + { + greeting: "Hello", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * This test is similar to RestJsonGreetingWithErrors, but it + * ensures that clients can gracefully deal with a server + * omitting a response payload. + */ +it("RestJsonGreetingWithErrorsNoPayload:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-greeting": "Hello", + }, + `` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(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 = [ + { + greeting: "Hello", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses simple JSON errors + */ +it("RestJsonInvalidGreetingError:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "x-amzn-errortype": "InvalidGreeting", + "content-type": "application/json", + }, + `{ + "Message": "Hi" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "InvalidGreeting") { + console.log(err); + fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Serializes a complex error with no message member + */ +it("RestJsonComplexErrorWithNoMessage:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 403, + { + "x-amzn-errortype": "ComplexError", + "x-header": "Header", + "content-type": "application/json", + }, + `{ + "TopLevel": "Top level", + "Nested": { + "Fooooo": "bar" + } + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(403); + const paramsToValidate: any = [ + { + Header: "Header", + TopLevel: "Top level", + Nested: { + Foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +it("RestJsonEmptyComplexErrorWithNoMessage:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 403, + { + "x-amzn-errortype": "ComplexError", + "content-type": "application/json", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(403); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Serializes the X-Amzn-ErrorType header. For an example service, see Amazon EKS. + */ +it("RestJsonFooErrorUsingXAmznErrorType:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": "FooError", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some X-Amzn-Errortype headers contain URLs. Clients need to split the URL on ':' and take only the first half of the string. For example, 'ValidationException:http://internal.amazon.com/coral/com.amazon.coral.validate/' + * is to be interpreted as 'ValidationException'. + * + * For an example service see Amazon Polly. + */ +it("RestJsonFooErrorUsingXAmznErrorTypeWithUri:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": "FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * X-Amzn-Errortype might contain a URL and a namespace. Client should extract only the shape name. This is a pathalogical case that might not actually happen in any deployed AWS service. + */ +it("RestJsonFooErrorUsingXAmznErrorTypeWithUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(false, 500, { + "x-amzn-errortype": + "aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/", + }), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * This example uses the 'code' property in the output rather than X-Amzn-Errortype. Some services do this though it's preferable to send the X-Amzn-Errortype. Client implementations must first check for the X-Amzn-Errortype and then check for a top-level 'code' property. + * + * For example service see Amazon S3 Glacier. + */ +it("RestJsonFooErrorUsingCode:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/json", + }, + `{ + "code": "FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using code, and it might contain a namespace. Clients should just take the last part of the string after '#'. + */ +it("RestJsonFooErrorUsingCodeAndNamespace:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/json", + }, + `{ + "code": "aws.protocoltests.restjson#FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using code, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service. + */ +it("RestJsonFooErrorUsingCodeUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/json", + }, + `{ + "code": "aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type. + */ +it("RestJsonFooErrorWithDunderType:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/json", + }, + `{ + "__type": "FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type, and it might contain a namespace. Clients should just take the last part of the string after '#'. + */ +it("RestJsonFooErrorWithDunderTypeAndNamespace:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/json", + }, + `{ + "__type": "aws.protocoltests.restjson#FooError" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service. + */ +it("RestJsonFooErrorWithDunderTypeUriAndNamespace:Error:GreetingWithErrors", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 500, + { + "content-type": "application/json", + }, + `{ + "__type": "aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" + }` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "FooError") { + console.log(err); + fail(`Expected a FooError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(500); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Custom endpoints supplied by users can have paths + */ +it("RestJsonHostWithPath:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + endpoint: "https://example.com/custom", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HostWithPathOperationCommand({}); + 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("/custom/HostWithPathOperation"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Adds Content-MD5 header + */ +it("RestJsonHttpChecksumRequired:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpChecksumRequiredCommand({ + foo: "base64 encoded md5 checksum", + } 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("/HttpChecksumRequired"); + + expect(r.headers["content-md5"]).toBe("iB0/3YSo7maijL0IGOgA9g=="); + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"foo\":\"base64 encoded md5 checksum\" + } + `; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes all request headers, using specific when present + */ +it("RestJsonHttpEmptyPrefixHeadersRequestClient:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpEmptyPrefixHeadersCommand({ + prefixHeaders: { + "x-foo": "Foo", + hello: "Hello", + } as any, + specificHeader: "There", + } 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("GET"); + expect(r.path).toBe("/HttpEmptyPrefixHeaders"); + + expect(r.headers["hello"]).toBe("There"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Deserializes all response headers with the same for prefix and specific + */ +it("RestJsonHttpEmptyPrefixHeadersResponseClient:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-foo": "Foo", + hello: "There", + }), + }); + + const params: any = {}; + const command = new HttpEmptyPrefixHeadersCommand(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 = [ + { + prefixHeaders: { + "x-foo": "Foo", + hello: "There", + }, + specificHeader: "There", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +it("RestJsonEnumPayloadRequest:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpEnumPayloadCommand({ + payload: "enumvalue", + } 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("/EnumPayload"); + + expect(r.headers["content-type"]).toBe("text/plain"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `enumvalue`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +it("RestJsonEnumPayloadResponse:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/plain", + }, + `enumvalue` + ), + }); + + const params: any = {}; + const command = new HttpEnumPayloadCommand(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 = [ + { + payload: "enumvalue", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a blob in the HTTP payload + */ +it("RestJsonHttpPayloadTraitsWithBlob:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadTraitsCommand({ + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + } 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("/HttpPayloadTraits"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/octet-stream"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `blobby blob blob`; + const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an empty blob in the HTTP payload + */ +it("RestJsonHttpPayloadTraitsWithNoBlobBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadTraitsCommand({ + foo: "Foo", + } 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("/HttpPayloadTraits"); + + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a blob in the HTTP payload + */ +it("RestJsonHttpPayloadTraitsWithBlob:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + }, + `blobby blob blob` + ), + }); + + const params: any = {}; + const command = new HttpPayloadTraitsCommand(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 = [ + { + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes an empty blob in the HTTP payload + */ +it("RestJsonHttpPayloadTraitsWithNoBlobBody:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + }, + `` + ), + }); + + const params: any = {}; + const command = new HttpPayloadTraitsCommand(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 = [ + { + foo: "Foo", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a blob in the HTTP payload with a content-type + */ +it("RestJsonHttpPayloadTraitsWithMediaTypeWithBlob:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadTraitsWithMediaTypeCommand({ + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + } 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("/HttpPayloadTraitsWithMediaType"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("text/plain"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `blobby blob blob`; + const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a blob in the HTTP payload with a content-type + */ +it("RestJsonHttpPayloadTraitsWithMediaTypeWithBlob:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "text/plain", + }, + `blobby blob blob` + ), + }); + + const params: any = {}; + const command = new HttpPayloadTraitsWithMediaTypeCommand(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 = [ + { + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a structure in the payload + */ +it("RestJsonHttpPayloadWithStructure:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithStructureCommand({ + nested: { + greeting: "hello", + name: "Phreddy", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithStructure"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"greeting\": \"hello\", + \"name\": \"Phreddy\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure in the payload + */ +it("RestJsonHttpPayloadWithStructure:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "greeting": "hello", + "name": "Phreddy" + }` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithStructureCommand(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 = [ + { + nested: { + greeting: "hello", + name: "Phreddy", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a union in the payload. + */ +it("RestJsonHttpPayloadWithUnion:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithUnionCommand({ + nested: { + greeting: "hello", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithUnion"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"greeting\": \"hello\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * No payload is sent if the union has no value. + */ +it("RestJsonHttpPayloadWithUnsetUnion:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithUnionCommand({} 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithUnion"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a union in the payload. + */ +it("RestJsonHttpPayloadWithUnion:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "greeting": "hello" + }` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithUnionCommand(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 = [ + { + nested: { + greeting: "hello", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * No payload is sent if the union has no value. + */ +it("RestJsonHttpPayloadWithUnsetUnion:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-length": "0", + }, + `` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithUnionCommand(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); +}); + +/** + * Adds headers by prefix + */ +it("RestJsonHttpPrefixHeadersArePresent:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + foo: "Foo", + fooMap: { + abc: "Abc value", + def: "Def value", + } 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("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo"]).toBe("Foo"); + expect(r.headers["x-foo-abc"]).toBe("Abc value"); + expect(r.headers["x-foo-def"]).toBe("Def value"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * No prefix headers are serialized because the value is not present + */ +it("RestJsonHttpPrefixHeadersAreNotPresent:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + foo: "Foo", + fooMap: {} 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("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serialize prefix headers were the value is present but empty + */ +it("RestJsonHttpPrefixEmptyHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + fooMap: { + abc: "", + } 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("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo-abc"]).toBe(""); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Adds headers by prefix + */ +it("RestJsonHttpPrefixHeadersArePresent:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-foo": "Foo", + "x-foo-abc": "Abc value", + "x-foo-def": "Def value", + }), + }); + + const params: any = {}; + const command = new HttpPrefixHeadersCommand(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 = [ + { + foo: "Foo", + fooMap: { + abc: "Abc value", + def: "Def value", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * (de)serializes all response headers + */ +it("HttpPrefixHeadersResponse:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-foo": "Foo", + hello: "Hello", + }), + }); + + const params: any = {}; + const command = new HttpPrefixHeadersInResponseCommand(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 = [ + { + prefixHeaders: { + "x-foo": "Foo", + hello: "Hello", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling NaN float label values. + */ +it("RestJsonSupportsNaNFloatLabels:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithFloatLabelsCommand({ + float: NaN, + double: NaN, + } 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("GET"); + expect(r.path).toBe("/FloatHttpLabels/NaN/NaN"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling Infinity float label values. + */ +it("RestJsonSupportsInfinityFloatLabels:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithFloatLabelsCommand({ + float: Infinity, + double: Infinity, + } 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("GET"); + expect(r.path).toBe("/FloatHttpLabels/Infinity/Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling -Infinity float label values. + */ +it("RestJsonSupportsNegativeInfinityFloatLabels:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithFloatLabelsCommand({ + float: -Infinity, + double: -Infinity, + } 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("GET"); + expect(r.path).toBe("/FloatHttpLabels/-Infinity/-Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes greedy labels and normal labels + */ +it("RestJsonHttpRequestWithGreedyLabelInPath:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithGreedyLabelInPathCommand({ + foo: "hello/escape", + baz: "there/guy", + } 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("GET"); + expect(r.path).toBe("/HttpRequestWithGreedyLabelInPath/foo/hello%2Fescape/baz/there/guy"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Sends a GET request that uses URI label bindings + */ +it("RestJsonInputWithHeadersAndAllParams:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithLabelsCommand({ + string: "string", + short: 1, + integer: 2, + long: 3, + float: 4.1, + double: 5.1, + boolean: true, + timestamp: new Date(1576540098000), + } 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("GET"); + expect(r.path).toBe("/HttpRequestWithLabels/string/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Sends a GET request that uses URI label bindings + */ +it("RestJsonHttpRequestLabelEscaping:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithLabelsCommand({ + string: " %:/?#[]@!$&'()*+,;=😹", + short: 1, + integer: 2, + long: 3, + float: 4.1, + double: 5.1, + boolean: true, + timestamp: new Date(1576540098000), + } 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("GET"); + expect(r.path).toBe( + "/HttpRequestWithLabels/%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z" + ); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes different timestamp formats in URI labels + */ +it("RestJsonHttpRequestWithLabelsAndTimestampFormat:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithLabelsAndTimestampFormatCommand({ + memberEpochSeconds: new Date(1576540098000), + memberHttpDate: new Date(1576540098000), + memberDateTime: new Date(1576540098000), + defaultFormat: new Date(1576540098000), + targetEpochSeconds: new Date(1576540098000), + targetHttpDate: new Date(1576540098000), + targetDateTime: new Date(1576540098000), + } 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("GET"); + expect(r.path).toBe( + "/HttpRequestWithLabelsAndTimestampFormat/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z/2019-12-16T23%3A48%3A18Z/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z" + ); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Path matching is not broken by regex expressions in literal segments + */ +it("RestJsonToleratesRegexCharsInSegments:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithRegexLiteralCommand({ + str: "abc", + } 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("GET"); + expect(r.path).toBe("/ReDosLiteral/abc/(a+)+"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Binds the http response code to an output structure. Note that + * even though all members are bound outside of the payload, an + * empty JSON object is serialized in the response. However, + * clients should be able to handle an empty JSON object or an + * empty payload without failing to deserialize a response. + */ +it("RestJsonHttpResponseCode:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 201, + { + "content-type": "application/json", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new HttpResponseCodeCommand(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(201); + const paramsToValidate: any = [ + { + Status: 201, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * This test ensures that clients gracefully handle cases where + * the service responds with no payload rather than an empty JSON + * object. + */ +it("RestJsonHttpResponseCodeWithNoPayload:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 201, undefined, ``), + }); + + const params: any = {}; + const command = new HttpResponseCodeCommand(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(201); + const paramsToValidate: any = [ + { + Status: 201, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +it("RestJsonStringPayloadRequest:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpStringPayloadCommand({ + payload: "rawstring", + } 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("/StringPayload"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("text/plain"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `rawstring`; + const unequalParts: any = compareEquivalentTextBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +it("RestJsonStringPayloadResponse:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/plain", + }, + `rawstring` + ), + }); + + const params: any = {}; + const command = new HttpStringPayloadCommand(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 = [ + { + payload: "rawstring", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Query parameters must be ignored when serializing the output + * of an operation. As of January 2021, server implementations + * are expected to respond with a JSON object regardless of + * if the output parameters are empty. + */ +it("RestJsonIgnoreQueryParamsInResponse:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new IgnoreQueryParamsInResponseCommand(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); +}); + +/** + * This test is similar to RestJsonIgnoreQueryParamsInResponse, + * but it ensures that clients gracefully handle responses from + * the server that do not serialize an empty JSON object. + */ +it("RestJsonIgnoreQueryParamsInResponseNoPayload:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new IgnoreQueryParamsInResponseCommand(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); +}); + +/** + * Tests requests with string header bindings + */ +it("RestJsonInputAndOutputWithStringHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerString: "Hello", + headerStringList: ["a", "b", "c"], + headerStringSet: ["a", "b", "c"], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-string"]).toBe("Hello"); + expect(r.headers["x-stringlist"]).toBe("a, b, c"); + expect(r.headers["x-stringset"]).toBe("a, b, c"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with string list header bindings that require quoting + */ +it("RestJsonInputAndOutputWithQuotedStringHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerStringList: ["b,c", '"def"', "a"], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-stringlist"]).toBe('"b,c", "\\"def\\"", a'); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with numeric header bindings + */ +it("RestJsonInputAndOutputWithNumericHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerByte: 1, + headerShort: 123, + headerInteger: 123, + headerLong: 123, + headerFloat: 1.1, + headerDouble: 1.1, + headerIntegerList: [1, 2, 3], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-byte"]).toBe("1"); + expect(r.headers["x-double"]).toBe("1.1"); + expect(r.headers["x-float"]).toBe("1.1"); + expect(r.headers["x-integer"]).toBe("123"); + expect(r.headers["x-integerlist"]).toBe("1, 2, 3"); + expect(r.headers["x-long"]).toBe("123"); + expect(r.headers["x-short"]).toBe("123"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with boolean header bindings + */ +it("RestJsonInputAndOutputWithBooleanHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerTrueBool: true, + headerFalseBool: false, + headerBooleanList: [true, false, true], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-boolean1"]).toBe("true"); + expect(r.headers["x-boolean2"]).toBe("false"); + expect(r.headers["x-booleanlist"]).toBe("true, false, true"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with timestamp header bindings + */ +it("RestJsonInputAndOutputWithTimestampHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerTimestampList: [new Date(1576540098000), new Date(1576540098000)], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-timestamplist"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with enum header bindings + */ +it("RestJsonInputAndOutputWithEnumHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerEnum: "Foo", + headerEnumList: ["Foo", "Bar", "Baz"], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-enum"]).toBe("Foo"); + expect(r.headers["x-enumlist"]).toBe("Foo, Bar, Baz"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with intEnum header bindings + */ +it("RestJsonInputAndOutputWithIntEnumHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerIntegerEnum: 1, + headerIntegerEnumList: [1, 2, 3], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-integerenum"]).toBe("1"); + expect(r.headers["x-integerenumlist"]).toBe("1, 2, 3"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling NaN float header values. + */ +it("RestJsonSupportsNaNFloatHeaderInputs:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerFloat: NaN, + headerDouble: NaN, + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-double"]).toBe("NaN"); + expect(r.headers["x-float"]).toBe("NaN"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling Infinity float header values. + */ +it("RestJsonSupportsInfinityFloatHeaderInputs:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerFloat: Infinity, + headerDouble: Infinity, + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-double"]).toBe("Infinity"); + expect(r.headers["x-float"]).toBe("Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling -Infinity float header values. + */ +it("RestJsonSupportsNegativeInfinityFloatHeaderInputs:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerFloat: -Infinity, + headerDouble: -Infinity, + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-double"]).toBe("-Infinity"); + expect(r.headers["x-float"]).toBe("-Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests responses with string header bindings + */ +it("RestJsonInputAndOutputWithStringHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-stringlist": "a, b, c", + "x-stringset": "a, b, c", + "x-string": "Hello", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerString: "Hello", + headerStringList: ["a", "b", "c"], + headerStringSet: ["a", "b", "c"], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with string list header bindings that require quoting + */ +it("RestJsonInputAndOutputWithQuotedStringHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-stringlist": '"b,c", "\\"def\\"", a', + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerStringList: ["b,c", '"def"', "a"], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with numeric header bindings + */ +it("RestJsonInputAndOutputWithNumericHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-float": "1.1", + "x-byte": "1", + "x-long": "123", + "x-integer": "123", + "x-integerlist": "1, 2, 3", + "x-double": "1.1", + "x-short": "123", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerByte: 1, + headerShort: 123, + headerInteger: 123, + headerLong: 123, + headerFloat: 1.1, + headerDouble: 1.1, + headerIntegerList: [1, 2, 3], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with boolean header bindings + */ +it("RestJsonInputAndOutputWithBooleanHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-booleanlist": "true, false, true", + "x-boolean1": "true", + "x-boolean2": "false", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerTrueBool: true, + headerFalseBool: false, + headerBooleanList: [true, false, true], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with timestamp header bindings + */ +it("RestJsonInputAndOutputWithTimestampHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-timestamplist": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerTimestampList: [new Date(1576540098 * 1000), new Date(1576540098 * 1000)], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with enum header bindings + */ +it("RestJsonInputAndOutputWithEnumHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-enumlist": "Foo, Bar, Baz", + "x-enum": "Foo", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerEnum: "Foo", + headerEnumList: ["Foo", "Bar", "Baz"], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with intEnum header bindings + */ +it("RestJsonInputAndOutputWithIntEnumHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-integerenum": "1", + "x-integerenumlist": "1, 2, 3", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerIntegerEnum: 1, + headerIntegerEnumList: [1, 2, 3], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling NaN float header values. + */ +it("RestJsonSupportsNaNFloatHeaderOutputs:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-float": "NaN", + "x-double": "NaN", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerFloat: NaN, + headerDouble: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float header values. + */ +it("RestJsonSupportsInfinityFloatHeaderOutputs:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-float": "Infinity", + "x-double": "Infinity", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerFloat: Infinity, + headerDouble: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float header values. + */ +it("RestJsonSupportsNegativeInfinityFloatHeaderOutputs:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-float": "-Infinity", + "x-double": "-Infinity", + }), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerFloat: -Infinity, + headerDouble: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Blobs are base64 encoded + */ +it("RestJsonJsonBlobs:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonBlobsCommand({ + data: Uint8Array.from("value", (c) => c.charCodeAt(0)), + } 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("/JsonBlobs"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"data\": \"dmFsdWU=\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Blobs are base64 encoded + */ +it("RestJsonJsonBlobs:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "data": "dmFsdWU=" + }` + ), + }); + + const params: any = {}; + const command = new JsonBlobsCommand(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 = [ + { + data: Uint8Array.from("value", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("RestJsonJsonEnums:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonEnumsCommand({ + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + } 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("PUT"); + expect(r.path).toBe("/JsonEnums"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"fooEnum1\": \"Foo\", + \"fooEnum2\": \"0\", + \"fooEnum3\": \"1\", + \"fooEnumList\": [ + \"Foo\", + \"0\" + ], + \"fooEnumSet\": [ + \"Foo\", + \"0\" + ], + \"fooEnumMap\": { + \"hi\": \"Foo\", + \"zero\": \"0\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("RestJsonJsonEnums:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "fooEnum1": "Foo", + "fooEnum2": "0", + "fooEnum3": "1", + "fooEnumList": [ + "Foo", + "0" + ], + "fooEnumSet": [ + "Foo", + "0" + ], + "fooEnumMap": { + "hi": "Foo", + "zero": "0" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonEnumsCommand(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 = [ + { + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes intEnums as integers + */ +it("RestJsonJsonIntEnums:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonIntEnumsCommand({ + integerEnum1: 1, + integerEnum2: 2, + integerEnum3: 3, + integerEnumList: [1, 2, 3], + integerEnumSet: [1, 2], + integerEnumMap: { + abc: 1, + def: 2, + } 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("PUT"); + expect(r.path).toBe("/JsonIntEnums"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"integerEnum1\": 1, + \"integerEnum2\": 2, + \"integerEnum3\": 3, + \"integerEnumList\": [ + 1, + 2, + 3 + ], + \"integerEnumSet\": [ + 1, + 2 + ], + \"integerEnumMap\": { + \"abc\": 1, + \"def\": 2 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes intEnums as integers + */ +it("RestJsonJsonIntEnums:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "integerEnum1": 1, + "integerEnum2": 2, + "integerEnum3": 3, + "integerEnumList": [ + 1, + 2, + 3 + ], + "integerEnumSet": [ + 1, + 2 + ], + "integerEnumMap": { + "abc": 1, + "def": 2 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonIntEnumsCommand(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 = [ + { + integerEnum1: 1, + integerEnum2: 2, + integerEnum3: 3, + integerEnumList: [1, 2, 3], + integerEnumSet: [1, 2], + integerEnumMap: { + abc: 1, + def: 2, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes JSON lists + */ +it("RestJsonLists:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonListsCommand({ + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238000), new Date(1398796238000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + structureList: [ + { + a: "1", + b: "2", + } as any, + { + a: "3", + b: "4", + } 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("PUT"); + expect(r.path).toBe("/JsonLists"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringList\": [ + \"foo\", + \"bar\" + ], + \"stringSet\": [ + \"foo\", + \"bar\" + ], + \"integerList\": [ + 1, + 2 + ], + \"booleanList\": [ + true, + false + ], + \"timestampList\": [ + 1398796238, + 1398796238 + ], + \"enumList\": [ + \"Foo\", + \"0\" + ], + \"intEnumList\": [ + 1, + 2 + ], + \"nestedStringList\": [ + [ + \"foo\", + \"bar\" + ], + [ + \"baz\", + \"qux\" + ] + ], + \"myStructureList\": [ + { + \"value\": \"1\", + \"other\": \"2\" + }, + { + \"value\": \"3\", + \"other\": \"4\" + } + ] + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes empty JSON lists + */ +it("RestJsonListsEmpty:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonListsCommand({ + stringList: [], + } 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("PUT"); + expect(r.path).toBe("/JsonLists"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringList\": [] + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes JSON lists + */ +it("RestJsonLists:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringList": [ + "foo", + "bar" + ], + "stringSet": [ + "foo", + "bar" + ], + "integerList": [ + 1, + 2 + ], + "booleanList": [ + true, + false + ], + "timestampList": [ + 1398796238, + 1398796238 + ], + "enumList": [ + "Foo", + "0" + ], + "intEnumList": [ + 1, + 2 + ], + "nestedStringList": [ + [ + "foo", + "bar" + ], + [ + "baz", + "qux" + ] + ], + "myStructureList": [ + { + "value": "1", + "other": "2" + }, + { + "value": "3", + "other": "4" + } + ] + }` + ), + }); + + const params: any = {}; + const command = new JsonListsCommand(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 = [ + { + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238 * 1000), new Date(1398796238 * 1000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + structureList: [ + { + a: "1", + b: "2", + }, + { + a: "3", + b: "4", + }, + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes empty JSON lists + */ +it("RestJsonListsEmpty:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringList": [] + }` + ), + }); + + const params: any = {}; + const command = new JsonListsCommand(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 = [ + { + stringList: [], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes JSON maps + */ +it("RestJsonJsonMaps:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonMapsCommand({ + denseStructMap: { + foo: { + hi: "there", + } as any, + baz: { + hi: "bye", + } 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("/JsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"denseStructMap\": { + \"foo\": { + \"hi\": \"there\" + }, + \"baz\": { + \"hi\": \"bye\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RestJsonSerializesZeroValuesInMaps:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonMapsCommand({ + denseNumberMap: { + x: 0, + } as any, + denseBooleanMap: { + x: false, + } 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("/JsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"denseNumberMap\": { + \"x\": 0 + }, + \"denseBooleanMap\": { + \"x\": false + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * A request that contains a dense map of sets. + */ +it("RestJsonSerializesDenseSetMap:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonMapsCommand({ + denseSetMap: { + x: [], + y: ["a", "b"], + } 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("/JsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"denseSetMap\": { + \"x\": [], + \"y\": [\"a\", \"b\"] + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes JSON maps + */ +it("RestJsonJsonMaps:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "denseStructMap": { + "foo": { + "hi": "there" + }, + "baz": { + "hi": "bye" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonMapsCommand(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 = [ + { + denseStructMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RestJsonDeserializesZeroValuesInMaps:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "denseNumberMap": { + "x": 0 + }, + "denseBooleanMap": { + "x": false + } + }` + ), + }); + + const params: any = {}; + const command = new JsonMapsCommand(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 = [ + { + denseNumberMap: { + x: 0, + }, + denseBooleanMap: { + x: false, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * A response that contains a dense map of sets. + */ +it("RestJsonDeserializesDenseSetMap:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "denseSetMap": { + "x": [], + "y": ["a", "b"] + } + }` + ), + }); + + const params: any = {}; + const command = new JsonMapsCommand(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 = [ + { + denseSetMap: { + x: [], + y: ["a", "b"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Clients SHOULD tolerate seeing a null value in a dense map, and they SHOULD + * drop the null key-value pair. + */ +it("RestJsonDeserializesDenseSetMapAndSkipsNull:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "denseSetMap": { + "x": [], + "y": ["a", "b"], + "z": null + } + }` + ), + }); + + const params: any = {}; + const command = new JsonMapsCommand(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 = [ + { + denseSetMap: { + x: [], + y: ["a", "b"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests how normal timestamps are serialized + */ +it("RestJsonJsonTimestamps:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonTimestampsCommand({ + normal: new Date(1398796238000), + } 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("/JsonTimestamps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"normal\": 1398796238 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of date-time works like normal timestamps + */ +it("RestJsonJsonTimestampsWithDateTimeFormat:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonTimestampsCommand({ + dateTime: new Date(1398796238000), + } 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("/JsonTimestamps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"dateTime\": \"2014-04-29T18:30:38Z\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of date-time on the target shape works like normal timestamps + */ +it("RestJsonJsonTimestampsWithDateTimeOnTargetFormat:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonTimestampsCommand({ + dateTimeOnTarget: new Date(1398796238000), + } 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("/JsonTimestamps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of epoch-seconds works + */ +it("RestJsonJsonTimestampsWithEpochSecondsFormat:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonTimestampsCommand({ + epochSeconds: new Date(1398796238000), + } 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("/JsonTimestamps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"epochSeconds\": 1398796238 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of epoch-seconds on the target shape works + */ +it("RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonTimestampsCommand({ + epochSecondsOnTarget: new Date(1398796238000), + } 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("/JsonTimestamps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"epochSecondsOnTarget\": 1398796238 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of http-date works + */ +it("RestJsonJsonTimestampsWithHttpDateFormat:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonTimestampsCommand({ + httpDate: new Date(1398796238000), + } 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("/JsonTimestamps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of http-date on the target shape works + */ +it("RestJsonJsonTimestampsWithHttpDateOnTargetFormat:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonTimestampsCommand({ + httpDateOnTarget: new Date(1398796238000), + } 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("/JsonTimestamps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Tests how normal timestamps are serialized + */ +it("RestJsonJsonTimestamps:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "normal": 1398796238 + }` + ), + }); + + const params: any = {}; + const command = new JsonTimestampsCommand(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 = [ + { + normal: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time works like normal timestamps + */ +it("RestJsonJsonTimestampsWithDateTimeFormat:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "dateTime": "2014-04-29T18:30:38Z" + }` + ), + }); + + const params: any = {}; + const command = new JsonTimestampsCommand(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 = [ + { + dateTime: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time on the target shape works like normal timestamps + */ +it("RestJsonJsonTimestampsWithDateTimeOnTargetFormat:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "dateTimeOnTarget": "2014-04-29T18:30:38Z" + }` + ), + }); + + const params: any = {}; + const command = new JsonTimestampsCommand(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 = [ + { + dateTimeOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds works + */ +it("RestJsonJsonTimestampsWithEpochSecondsFormat:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "epochSeconds": 1398796238 + }` + ), + }); + + const params: any = {}; + const command = new JsonTimestampsCommand(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 = [ + { + epochSeconds: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds on the target shape works + */ +it("RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "epochSecondsOnTarget": 1398796238 + }` + ), + }); + + const params: any = {}; + const command = new JsonTimestampsCommand(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 = [ + { + epochSecondsOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date works + */ +it("RestJsonJsonTimestampsWithHttpDateFormat:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "httpDate": "Tue, 29 Apr 2014 18:30:38 GMT" + }` + ), + }); + + const params: any = {}; + const command = new JsonTimestampsCommand(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 = [ + { + httpDate: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date on the target shape works + */ +it("RestJsonJsonTimestampsWithHttpDateOnTargetFormat:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "httpDateOnTarget": "Tue, 29 Apr 2014 18:30:38 GMT" + }` + ), + }); + + const params: any = {}; + const command = new JsonTimestampsCommand(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 = [ + { + httpDateOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a string union value + */ +it("RestJsonSerializeStringUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + stringValue: "foo", + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"stringValue\": \"foo\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a boolean union value + */ +it("RestJsonSerializeBooleanUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + booleanValue: true, + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"booleanValue\": true + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a number union value + */ +it("RestJsonSerializeNumberUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + numberValue: 1, + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"numberValue\": 1 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a blob union value + */ +it("RestJsonSerializeBlobUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"blobValue\": \"Zm9v\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a timestamp union value + */ +it("RestJsonSerializeTimestampUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + timestampValue: new Date(1398796238000), + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"timestampValue\": 1398796238 + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an enum union value + */ +it("RestJsonSerializeEnumUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + enumValue: "Foo", + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"enumValue\": \"Foo\" + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a list union value + */ +it("RestJsonSerializeListUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + listValue: ["foo", "bar"], + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"listValue\": [\"foo\", \"bar\"] + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a map union value + */ +it("RestJsonSerializeMapUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + mapValue: { + foo: "bar", + spam: "eggs", + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"mapValue\": { + \"foo\": \"bar\", + \"spam\": \"eggs\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure union value + */ +it("RestJsonSerializeStructureUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + structureValue: { + hi: "hello", + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"structureValue\": { + \"hi\": \"hello\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a renamed structure union value + */ +it("RestJsonSerializeRenamedStructureUnionValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new JsonUnionsCommand({ + contents: { + renamedStructureValue: { + salutation: "hello!", + } 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("PUT"); + expect(r.path).toBe("/JsonUnions"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"contents\": { + \"renamedStructureValue\": { + \"salutation\": \"hello!\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes a string union value + */ +it("RestJsonDeserializeStringUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "stringValue": "foo" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + stringValue: "foo", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a boolean union value + */ +it("RestJsonDeserializeBooleanUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "booleanValue": true + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + booleanValue: true, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a number union value + */ +it("RestJsonDeserializeNumberUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "numberValue": 1 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + numberValue: 1, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a blob union value + */ +it("RestJsonDeserializeBlobUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "blobValue": "Zm9v" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a timestamp union value + */ +it("RestJsonDeserializeTimestampUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "timestampValue": 1398796238 + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + timestampValue: new Date(1398796238 * 1000), + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes an enum union value + */ +it("RestJsonDeserializeEnumUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "enumValue": "Foo" + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + enumValue: "Foo", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a list union value + */ +it("RestJsonDeserializeListUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "listValue": ["foo", "bar"] + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + listValue: ["foo", "bar"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a map union value + */ +it("RestJsonDeserializeMapUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "mapValue": { + "foo": "bar", + "spam": "eggs" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + mapValue: { + foo: "bar", + spam: "eggs", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes a structure union value + */ +it("RestJsonDeserializeStructureUnionValue:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "structureValue": { + "hi": "hello" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + structureValue: { + hi: "hello", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ignores an unrecognized __type property + */ +it("RestJsonDeserializeIgnoreType:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "contents": { + "__type": "aws.protocoltests.json10#MyUnion", + "structureValue": { + "hi": "hello" + } + } + }` + ), + }); + + const params: any = {}; + const command = new JsonUnionsCommand(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 = [ + { + contents: { + structureValue: { + hi: "hello", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Headers that target strings with a mediaType are base64 encoded + */ +it("MediaTypeHeaderInputBase64:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new MediaTypeHeaderCommand({ + json: "true", + } 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("GET"); + expect(r.path).toBe("/MediaTypeHeader"); + + expect(r.headers["x-json"]).toBe("dHJ1ZQ=="); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Headers that target strings with a mediaType are base64 encoded + */ +it("MediaTypeHeaderOutputBase64:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-json": "dHJ1ZQ==", + }), + }); + + const params: any = {}; + const command = new MediaTypeHeaderCommand(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 = [ + { + json: "true", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * No input serializes no payload. When clients do not need to + * serialize any data in the payload, they should omit a payload + * altogether. + */ +it("RestJsonNoInputAndNoOutput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndNoOutputCommand({}); + 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("/NoInputAndNoOutput"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * When an operation does not define output, the service will respond + * with an empty payload, and may optionally include the content-type + * header. + */ +it("RestJsonNoInputAndNoOutput:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new NoInputAndNoOutputCommand(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); +}); + +/** + * No input serializes no payload. When clients do not need to + * serialize any data in the payload, they should omit a payload + * altogether. + */ +it("RestJsonNoInputAndOutput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndOutputCommand({}); + 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("/NoInputAndOutputOutput"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Operations that define output and do not bind anything to + * the payload return a JSON object in the response. + */ +it("RestJsonNoInputAndOutputWithJson:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new NoInputAndOutputCommand(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); +}); + +/** + * This test is similar to RestJsonNoInputAndOutputWithJson, but + * it ensures that clients can gracefully handle responses that + * omit a JSON payload. + */ +it("RestJsonNoInputAndOutputNoPayload:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new NoInputAndOutputCommand(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); +}); + +/** + * Do not send null values, but do send empty strings and empty lists over the wire in headers + */ +it.skip("RestJsonNullAndEmptyHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NullAndEmptyHeadersClientCommand({ + a: null, + b: "", + c: [], + } 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("GET"); + expect(r.path).toBe("/NullAndEmptyHeadersClient"); + + expect( + r.headers["x-a"], + `Header key "x-a" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(r.headers["x-b"]).toBe(""); + expect(r.headers["x-c"]).toBe(""); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Omits null query values + */ +it("RestJsonOmitsNullQuery:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OmitsNullSerializesEmptyStringCommand({ + nullValue: null, + } 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("GET"); + expect(r.path).toBe("/OmitsNullSerializesEmptyString"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes empty query strings + */ +it("RestJsonSerializesEmptyQueryValue:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OmitsNullSerializesEmptyStringCommand({ + emptyString: "", + } 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("GET"); + expect(r.path).toBe("/OmitsNullSerializesEmptyString"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Empty="); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports omitting empty lists. + */ +it("RestJsonOmitsEmptyListQueryValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OmitsSerializingEmptyListsCommand({ + queryStringList: [], + queryIntegerList: [], + queryDoubleList: [], + queryBooleanList: [], + queryTimestampList: [], + queryEnumList: [], + queryIntegerEnumList: [], + } 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("/OmitsSerializingEmptyLists"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Client populates default values in input. + */ +it.skip("RestJsonClientPopulatesDefaultValuesInInput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + defaults: {} 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("/OperationWithDefaults"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"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()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client skips top level default values in input. + */ +it.skip("RestJsonClientSkipsTopLevelDefaultValuesInInput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({} 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("/OperationWithDefaults"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client uses explicitly provided member values over defaults + */ +it.skip("RestJsonClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + 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 { + 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"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"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()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * 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.skip("RestJsonClientUsesExplicitlyProvidedValuesInTopLevel:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + topLevelDefault: "hi", + otherTopLevelDefault: 0, + } 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("/OperationWithDefaults"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"topLevelDefault\": \"hi\", + \"otherTopLevelDefault\": 0 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored. + */ +it.skip("RestJsonClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + clientOptionalDefaults: {} 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("/OperationWithDefaults"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"clientOptionalDefaults\": {} + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client populates default values when missing in response. + */ +it.skip("RestJsonClientPopulatesDefaultsValuesWhenMissingInResponse:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{}` + ), + }); + + const params: any = {}; + const command = new OperationWithDefaultsCommand(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 = [ + { + 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) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Client ignores default values if member values are present in the response. + */ +it.skip("RestJsonClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "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 OperationWithDefaultsCommand(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 = [ + { + defaultString: "bye", + defaultBoolean: false, + defaultList: ["a"], + defaultDocumentMap: { + name: "Jack", + }, + defaultDocumentString: "bye", + defaultDocumentBoolean: false, + defaultDocumentList: ["b"], + defaultNullDocument: "notNull", + defaultTimestamp: new Date(2 * 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) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Client populates nested default values when missing. + */ +it.skip("RestJsonClientPopulatesNestedDefaultValuesWhenMissing:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + 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"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).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], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[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"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).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], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[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"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).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"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).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"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).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], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[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], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[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], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header. + */ +it("SDKAppliedContentEncoding_restJson1:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/requestcompression/putcontentwithencoding"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header, and the + * user-provided content-encoding is in the Content-Encoding header before the + * request compression encoding from the HTTP binding. + * + */ +it("SDKAppendedGzipAfterProvidedEncoding_restJson1:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + encoding: "custom", + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/requestcompression/putcontentwithencoding"); + + expect(r.headers["content-encoding"]).toBe("custom, gzip"); + } +}); + +/** + * Automatically adds idempotency token when not set + */ +it("RestJsonQueryIdempotencyTokenAutoFill:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000000", + } 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("/QueryIdempotencyTokenAutoFill"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("token=00000000-0000-4000-8000-000000000000"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Uses the given idempotency token as-is + */ +it("RestJsonQueryIdempotencyTokenAutoFillIsSet:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000000", + } 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("/QueryIdempotencyTokenAutoFill"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("token=00000000-0000-4000-8000-000000000000"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serialize query params from map of list strings + */ +it("RestJsonQueryParamsStringListMap:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryParamsAsStringListMapCommand({ + qux: "named", + foo: { + baz: ["bar", "qux"], + } 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("/StringListMap"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("corge=named"); + expect(queryString).toContain("baz=bar"); + expect(queryString).toContain("baz=qux"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Prefer named query parameters when serializing + */ +it("RestJsonQueryPrecedence:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryPrecedenceCommand({ + foo: "named", + baz: { + bar: "fromMap", + qux: "alsoFromMap", + } 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("/Precedence"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("bar=named"); + expect(queryString).toContain("qux=alsoFromMap"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes recursive structures + */ +it("RestJsonRecursiveShapes:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RecursiveShapesCommand({ + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + } 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("PUT"); + expect(r.path).toBe("/RecursiveShapes"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"nested\": { + \"foo\": \"Foo1\", + \"nested\": { + \"bar\": \"Bar1\", + \"recursiveMember\": { + \"foo\": \"Foo2\", + \"nested\": { + \"bar\": \"Bar2\" + } + } + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes recursive structures + */ +it("RestJsonRecursiveShapes:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "nested": { + "foo": "Foo1", + "nested": { + "bar": "Bar1", + "recursiveMember": { + "foo": "Foo2", + "nested": { + "bar": "Bar2" + } + } + } + } + }` + ), + }); + + const params: any = {}; + const command = new RecursiveShapesCommand(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 = [ + { + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + }, + }, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("RestJsonSimpleScalarProperties:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + foo: "Foo", + stringValue: "string", + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/json"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"stringValue\": \"string\", + \"trueBooleanValue\": true, + \"falseBooleanValue\": false, + \"byteValue\": 1, + \"shortValue\": 2, + \"integerValue\": 3, + \"longValue\": 4, + \"floatValue\": 5.5, + \"DoubleDribble\": 6.5 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Rest Json should not serialize null structure values + */ +it("RestJsonDoesntSerializeNullStructureValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + stringValue: null, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling NaN float values. + */ +it("RestJsonSupportsNaNFloatInputs:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: NaN, + doubleValue: NaN, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"NaN\", + \"DoubleDribble\": \"NaN\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("RestJsonSupportsInfinityFloatInputs:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: Infinity, + doubleValue: Infinity, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"Infinity\", + \"DoubleDribble\": \"Infinity\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling -Infinity float values. + */ +it("RestJsonSupportsNegativeInfinityFloatInputs:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: -Infinity, + doubleValue: -Infinity, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"floatValue\": \"-Infinity\", + \"DoubleDribble\": \"-Infinity\" + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("RestJsonSimpleScalarProperties:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/json", + }, + `{ + "stringValue": "string", + "trueBooleanValue": true, + "falseBooleanValue": false, + "byteValue": 1, + "shortValue": 2, + "integerValue": 3, + "longValue": 4, + "floatValue": 5.5, + "DoubleDribble": 6.5 + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + foo: "Foo", + stringValue: "string", + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Rest Json should not deserialize null structure values + */ +it("RestJsonDoesntDeserializeNullStructureValues:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "stringValue": null + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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); +}); + +/** + * Supports handling NaN float values. + */ +it("RestJsonSupportsNaNFloatInputs:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "floatValue": "NaN", + "DoubleDribble": "NaN" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: NaN, + doubleValue: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float values. + */ +it("RestJsonSupportsInfinityFloatInputs:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "floatValue": "Infinity", + "DoubleDribble": "Infinity" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: Infinity, + doubleValue: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float values. + */ +it("RestJsonSupportsNegativeInfinityFloatInputs:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "floatValue": "-Infinity", + "DoubleDribble": "-Infinity" + }` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: -Infinity, + doubleValue: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes null values in sparse lists + */ +it("RestJsonSparseListsSerializeNull:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseJsonListsCommand({ + sparseStringList: [null, "hi"], + sparseShortList: [null, 2], + } 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("PUT"); + expect(r.path).toBe("/SparseJsonLists"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseStringList\": [ + null, + \"hi\" + ], + \"sparseShortList\": [ + null, + 2 + ] + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes null values in sparse lists + */ +it("RestJsonSparseListsSerializeNull:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "sparseStringList": [ + null, + "hi" + ], + "sparseShortList": [ + null, + 2 + ] + }` + ), + }); + + const params: any = {}; + const command = new SparseJsonListsCommand(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 = [ + { + sparseStringList: [null, "hi"], + sparseShortList: [null, 2], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes JSON maps + */ +it("RestJsonSparseJsonMaps:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseJsonMapsCommand({ + sparseStructMap: { + foo: { + hi: "there", + } as any, + baz: { + hi: "bye", + } 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("/SparseJsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseStructMap\": { + \"foo\": { + \"hi\": \"there\" + }, + \"baz\": { + \"hi\": \"bye\" + } + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes JSON map values in sparse maps + */ +it("RestJsonSerializesSparseNullMapValues:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseJsonMapsCommand({ + sparseBooleanMap: { + x: null, + } as any, + sparseNumberMap: { + x: null, + } as any, + sparseStringMap: { + x: null, + } as any, + sparseStructMap: { + x: null, + } 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("/SparseJsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseBooleanMap\": { + \"x\": null + }, + \"sparseNumberMap\": { + \"x\": null + }, + \"sparseStringMap\": { + \"x\": null + }, + \"sparseStructMap\": { + \"x\": null + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RestJsonSerializesZeroValuesInSparseMaps:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseJsonMapsCommand({ + sparseNumberMap: { + x: 0, + } as any, + sparseBooleanMap: { + x: false, + } 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("/SparseJsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseNumberMap\": { + \"x\": 0 + }, + \"sparseBooleanMap\": { + \"x\": false + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * A request that contains a sparse map of sets + */ +it("RestJsonSerializesSparseSetMap:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseJsonMapsCommand({ + sparseSetMap: { + x: [], + y: ["a", "b"], + } 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("/SparseJsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseSetMap\": { + \"x\": [], + \"y\": [\"a\", \"b\"] + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * A request that contains a sparse map of sets. + */ +it("RestJsonSerializesSparseSetMapAndRetainsNull:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseJsonMapsCommand({ + sparseSetMap: { + x: [], + y: ["a", "b"], + z: null, + } 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("/SparseJsonMaps"); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{ + \"sparseSetMap\": { + \"x\": [], + \"y\": [\"a\", \"b\"], + \"z\": null + } + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes JSON maps + */ +it("RestJsonSparseJsonMaps:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "sparseStructMap": { + "foo": { + "hi": "there" + }, + "baz": { + "hi": "bye" + } + } + }` + ), + }); + + const params: any = {}; + const command = new SparseJsonMapsCommand(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 = [ + { + sparseStructMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes null JSON map values + */ +it("RestJsonDeserializesSparseNullMapValues:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "sparseBooleanMap": { + "x": null + }, + "sparseNumberMap": { + "x": null + }, + "sparseStringMap": { + "x": null + }, + "sparseStructMap": { + "x": null + } + }` + ), + }); + + const params: any = {}; + const command = new SparseJsonMapsCommand(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 = [ + { + sparseBooleanMap: { + x: null, + }, + sparseNumberMap: { + x: null, + }, + sparseStringMap: { + x: null, + }, + sparseStructMap: { + x: null, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RestJsonDeserializesZeroValuesInSparseMaps:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "sparseNumberMap": { + "x": 0 + }, + "sparseBooleanMap": { + "x": false + } + }` + ), + }); + + const params: any = {}; + const command = new SparseJsonMapsCommand(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 = [ + { + sparseNumberMap: { + x: 0, + }, + sparseBooleanMap: { + x: false, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * A response that contains a sparse map of sets + */ +it("RestJsonDeserializesSparseSetMap:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "sparseSetMap": { + "x": [], + "y": ["a", "b"] + } + }` + ), + }); + + const params: any = {}; + const command = new SparseJsonMapsCommand(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 = [ + { + sparseSetMap: { + x: [], + y: ["a", "b"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * A response that contains a sparse map of sets. + */ +it("RestJsonDeserializesSparseSetMapAndRetainsNull:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/json", + }, + `{ + "sparseSetMap": { + "x": [], + "y": ["a", "b"], + "z": null + } + }` + ), + }); + + const params: any = {}; + const command = new SparseJsonMapsCommand(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 = [ + { + sparseSetMap: { + x: [], + y: ["a", "b"], + z: null, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a blob in the HTTP payload + */ +it("RestJsonStreamingTraitsWithBlob:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new StreamingTraitsCommand({ + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + } 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("/StreamingTraits"); + + expect(r.headers["content-type"]).toBe("application/octet-stream"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `blobby blob blob`; + const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an empty blob in the HTTP payload + */ +it("RestJsonStreamingTraitsWithNoBlobBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new StreamingTraitsCommand({ + foo: "Foo", + } 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("/StreamingTraits"); + + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a blob in the HTTP payload + */ +it("RestJsonStreamingTraitsWithBlob:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/octet-stream", + }, + `blobby blob blob` + ), + }); + + const params: any = {}; + const command = new StreamingTraitsCommand(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 = [ + { + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + }, + ][0]; + const comparableBlob = await client.config.streamCollector(r["blob"]); + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + if (param === "blob") { + expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); + } else { + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + } + }); +}); + +/** + * Serializes an empty blob in the HTTP payload + */ +it("RestJsonStreamingTraitsWithNoBlobBody:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + }, + `` + ), + }); + + const params: any = {}; + const command = new StreamingTraitsCommand(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 = [ + { + foo: "Foo", + }, + ][0]; + const comparableBlob = await client.config.streamCollector(r["blob"]); + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + if (param === "blob") { + expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); + } else { + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + } + }); +}); + +/** + * Serializes a blob in the HTTP payload with a required length + */ +it("RestJsonStreamingTraitsRequireLengthWithBlob:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new StreamingTraitsRequireLengthCommand({ + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + } 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("/StreamingTraitsRequireLength"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/octet-stream"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `blobby blob blob`; + const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an empty blob in the HTTP payload + */ +it("RestJsonStreamingTraitsRequireLengthWithNoBlobBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new StreamingTraitsRequireLengthCommand({ + foo: "Foo", + } 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("/StreamingTraitsRequireLength"); + + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a blob in the HTTP payload with a content-type + */ +it("RestJsonStreamingTraitsWithMediaTypeWithBlob:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new StreamingTraitsWithMediaTypeCommand({ + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + } 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("/StreamingTraitsWithMediaType"); + + expect(r.headers["content-type"]).toBe("text/plain"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `blobby blob blob`; + const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a blob in the HTTP payload with a content-type + */ +it("RestJsonStreamingTraitsWithMediaTypeWithBlob:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "text/plain", + }, + `blobby blob blob` + ), + }); + + const params: any = {}; + const command = new StreamingTraitsWithMediaTypeCommand(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 = [ + { + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + }, + ][0]; + const comparableBlob = await client.config.streamCollector(r["blob"]); + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + if (param === "blob") { + expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); + } else { + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + } + }); +}); + +/** + * Serializes a structure + */ +it("RestJsonTestBodyStructure:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestBodyStructureCommand({ + testConfig: { + timeout: 10, + } 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("/body"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"testConfig\": + {\"timeout\": 10} + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an empty structure in the body + */ +it("RestJsonHttpWithEmptyBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestBodyStructureCommand({} 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("/body"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a GET request for an operation with no input, and therefore no modeled body + */ +it("RestJsonHttpGetWithNoInput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestGetNoInputNoPayloadCommand({}); + 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-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a GET request with no modeled body + */ +it("RestJsonHttpGetWithNoModeledBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestGetNoPayloadCommand({} 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("GET"); + expect(r.path).toBe("/no_payload"); + + expect( + r.headers["content-length"], + `Header key "content-length" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a GET request with header member but no modeled body + */ +it("RestJsonHttpGetWithHeaderMemberNoModeledBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestGetNoPayloadCommand({ + testId: "t-12345", + } 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("GET"); + expect(r.path).toBe("/no_payload"); + + expect( + r.headers["content-length"], + `Header key "content-length" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(r.headers["x-amz-test-id"]).toBe("t-12345"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a payload targeting an empty blob + */ +it("RestJsonHttpWithEmptyBlobPayload:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPayloadBlobCommand({} 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("/blob_payload"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a payload targeting a blob + */ +it("RestJsonTestPayloadBlob:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPayloadBlobCommand({ + contentType: "image/jpg", + data: Uint8Array.from("1234", (c) => c.charCodeAt(0)), + } 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("/blob_payload"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("image/jpg"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `1234`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a payload targeting an empty structure + */ +it("RestJsonHttpWithEmptyStructurePayload:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPayloadStructureCommand({} 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("/payload"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a payload targeting a structure + */ +it("RestJsonTestPayloadStructure:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPayloadStructureCommand({ + payloadConfig: { + data: 25, + } 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("/payload"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/json"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{\"data\": 25 + }`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an request with header members but no payload + */ +it("RestJsonHttpWithHeadersButNoPayload:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPayloadStructureCommand({ + testId: "t-12345", + } 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("/payload"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/json"); + expect(r.headers["x-amz-test-id"]).toBe("t-12345"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `{}`; + const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a POST request for an operation with no input, and therefore no modeled body + */ +it("RestJsonHttpPostWithNoInput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPostNoInputNoPayloadCommand({}); + 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("/no_input_no_payload"); + + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a POST request with no modeled body + */ +it("RestJsonHttpPostWithNoModeledBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPostNoPayloadCommand({} 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("/no_payload"); + + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a POST request with header member but no modeled body + */ +it("RestJsonHttpWithPostHeaderMemberNoModeledBody:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TestPostNoPayloadCommand({ + testId: "t-12345", + } 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("/no_payload"); + + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(r.headers["x-amz-test-id"]).toBe("t-12345"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests how timestamp request headers are serialized + */ +it("RestJsonTimestampFormatHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TimestampFormatHeadersCommand({ + memberEpochSeconds: new Date(1576540098000), + memberHttpDate: new Date(1576540098000), + memberDateTime: new Date(1576540098000), + defaultFormat: new Date(1576540098000), + targetEpochSeconds: new Date(1576540098000), + targetHttpDate: new Date(1576540098000), + targetDateTime: new Date(1576540098000), + } 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("/TimestampFormatHeaders"); + + expect(r.headers["x-defaultformat"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); + expect(r.headers["x-memberdatetime"]).toBe("2019-12-16T23:48:18Z"); + expect(r.headers["x-memberepochseconds"]).toBe("1576540098"); + expect(r.headers["x-memberhttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); + expect(r.headers["x-targetdatetime"]).toBe("2019-12-16T23:48:18Z"); + expect(r.headers["x-targetepochseconds"]).toBe("1576540098"); + expect(r.headers["x-targethttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests how timestamp response headers are serialized + */ +it("RestJsonTimestampFormatHeaders:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-targetepochseconds": "1576540098", + "x-memberdatetime": "2019-12-16T23:48:18Z", + "x-defaultformat": "Mon, 16 Dec 2019 23:48:18 GMT", + "x-memberepochseconds": "1576540098", + "x-targethttpdate": "Mon, 16 Dec 2019 23:48:18 GMT", + "x-memberhttpdate": "Mon, 16 Dec 2019 23:48:18 GMT", + "x-targetdatetime": "2019-12-16T23:48:18Z", + }), + }); + + const params: any = {}; + const command = new TimestampFormatHeadersCommand(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 = [ + { + memberEpochSeconds: new Date(1576540098 * 1000), + memberHttpDate: new Date(1576540098 * 1000), + memberDateTime: new Date(1576540098 * 1000), + defaultFormat: new Date(1576540098 * 1000), + targetEpochSeconds: new Date(1576540098 * 1000), + targetHttpDate: new Date(1576540098 * 1000), + targetDateTime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * A unit type input serializes no payload. When clients do not + * need to serialize any data in the payload, they should omit + * a payload altogether. + */ +it("RestJsonUnitInputAndOutput:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new UnitInputAndOutputCommand({}); + 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("/UnitInputAndOutput"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * When an operation defines Unit output, the service will respond + * with an empty payload, and may optionally include the content-type + * header. + */ +it("RestJsonUnitInputAndOutputNoOutput:Response", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new UnitInputAndOutputCommand(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); +}); + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentJsonBodies = (expectedBody: string, generatedBody: string): Object => { + const expectedParts = JSON.parse(expectedBody); + const generatedParts = JSON.parse(generatedBody); + + return compareParts(expectedParts, generatedParts); +}; + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentOctetStreamBodies = ( + utf8Encoder: __Encoder, + expectedBody: string, + generatedBody: Uint8Array +): Object => { + const expectedParts = { Value: expectedBody }; + const generatedParts = { Value: utf8Encoder(generatedBody) }; + + 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. + */ +const compareEquivalentUnknownTypeBodies = ( + utf8Encoder: __Encoder, + expectedBody: string, + generatedBody: string | Uint8Array +): Object => { + const expectedParts = { Value: expectedBody }; + const generatedParts = { + Value: generatedBody instanceof Uint8Array ? utf8Encoder(generatedBody) : generatedBody, + }; + + return compareParts(expectedParts, generatedParts); +}; diff --git a/private/aws-protocoltests-restjson-schema/tsconfig.cjs.json b/private/aws-protocoltests-restjson-schema/tsconfig.cjs.json new file mode 100644 index 0000000000000..9224176da7f72 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-restjson-schema/tsconfig.es.json b/private/aws-protocoltests-restjson-schema/tsconfig.es.json new file mode 100644 index 0000000000000..5a76fb6593463 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "ESNext", + "moduleResolution": "bundler", + "outDir": "dist-es", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-restjson-schema/tsconfig.json b/private/aws-protocoltests-restjson-schema/tsconfig.json new file mode 100644 index 0000000000000..956bed461a6ce --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/private/aws-protocoltests-restjson-schema/tsconfig.types.json b/private/aws-protocoltests-restjson-schema/tsconfig.types.json new file mode 100644 index 0000000000000..b9a5eb7844868 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/tsconfig.types.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true, + "noCheck": false + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/private/aws-protocoltests-restjson-schema/vite.config.js b/private/aws-protocoltests-restjson-schema/vite.config.js new file mode 100644 index 0000000000000..e7147d3ac9e1d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-restxml-schema/.gitignore b/private/aws-protocoltests-restxml-schema/.gitignore new file mode 100644 index 0000000000000..54f14c9aef253 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/private/aws-protocoltests-restxml-schema/LICENSE b/private/aws-protocoltests-restxml-schema/LICENSE new file mode 100644 index 0000000000000..ba9d6d1526906 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/private/aws-protocoltests-restxml-schema/README.md b/private/aws-protocoltests-restxml-schema/README.md new file mode 100644 index 0000000000000..7bca8b6d3a33b --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/README.md @@ -0,0 +1,2565 @@ + + +# @aws-sdk/aws-protocoltests-restxml-schema + +## Description + +AWS SDK for JavaScript RestXmlProtocol Client for Node.js, Browser and React Native. + +A REST XML service that sends XML requests and responses. + +## Installing + +To install this package, simply type add or install @aws-sdk/aws-protocoltests-restxml-schema +using your favorite package manager: + +- `npm install @aws-sdk/aws-protocoltests-restxml-schema` +- `yarn add @aws-sdk/aws-protocoltests-restxml-schema` +- `pnpm add @aws-sdk/aws-protocoltests-restxml-schema` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RestXmlProtocolClient` and +the commands you need, for example `XmlBlobsCommand`: + +```js +// ES5 example +const { RestXmlProtocolClient, XmlBlobsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); +``` + +```ts +// ES6+ example +import { RestXmlProtocolClient, XmlBlobsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new RestXmlProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new XmlBlobsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-protocoltests-restxml-schema"; +const client = new AWS.RestXmlProtocol({ region: "REGION" }); + +// async/await. +try { + const data = await client.xmlBlobs(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .xmlBlobs(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.xmlBlobs(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-protocoltests-restxml-schema` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +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/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EmptyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyOperationCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +KitchenSinkOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/KitchenSinkOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/KitchenSinkOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/KitchenSinkOperationCommandOutput/) + +
+
+ +NullOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NullOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullOperationCommandOutput/) + +
+
+ +OperationWithOptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithOptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithOptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithOptionalInputOutputCommandOutput/) + +
+
+ +PutAndGetInlineDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PutAndGetInlineDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutAndGetInlineDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutAndGetInlineDocumentsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseNullsOperationCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +OperationWithRequiredMembers + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithRequiredMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithRequiredMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithRequiredMembersCommandOutput/) + +
+
+ +OperationWithRequiredMembersWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithRequiredMembersWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithRequiredMembersWithDefaultsCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +AcceptHeaderStarService + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/AcceptHeaderStarServiceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/AcceptHeaderStarServiceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/AcceptHeaderStarServiceCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +IgnoresWrappingXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/IgnoresWrappingXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoresWrappingXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoresWrappingXmlNameCommandOutput/) + +
+
+ +NestedStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NestedStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedStructuresCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryListsCommandOutput/) + +
+
+ +QueryMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryMapsCommandOutput/) + +
+
+ +QueryTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryTimestampsCommandOutput/) + +
+
+ +RecursiveXmlShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RecursiveXmlShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveXmlShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveXmlShapesCommandOutput/) + +
+
+ +SimpleInputParams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleInputParamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleInputParamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleInputParamsCommandOutput/) + +
+
+ +SimpleScalarXmlProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarXmlPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarXmlPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarXmlPropertiesCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +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/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +DocumentType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DocumentTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DocumentTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DocumentTypeCommandOutput/) + +
+
+ +DocumentTypeAsMapValue + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DocumentTypeAsMapValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DocumentTypeAsMapValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DocumentTypeAsMapValueCommandOutput/) + +
+
+ +DocumentTypeAsPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DocumentTypeAsPayloadCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HostWithPathOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HostWithPathOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HostWithPathOperationCommandOutput/) + +
+
+ +HttpChecksumRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpChecksumRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpChecksumRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpChecksumRequiredCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpPrefixHeadersInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPrefixHeadersInResponseCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpRequestWithRegexLiteral + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithRegexLiteralCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithRegexLiteralCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithRegexLiteralCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +JsonBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonBlobsCommandOutput/) + +
+
+ +JsonEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonEnumsCommandOutput/) + +
+
+ +JsonIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonIntEnumsCommandOutput/) + +
+
+ +JsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonListsCommandOutput/) + +
+
+ +JsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonMapsCommandOutput/) + +
+
+ +JsonTimestamps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonTimestampsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonTimestampsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonTimestampsCommandOutput/) + +
+
+ +JsonUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/JsonUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/JsonUnionsCommandOutput/) + +
+
+ +MalformedAcceptWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedAcceptWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedAcceptWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedAcceptWithBodyCommandOutput/) + +
+
+ +MalformedAcceptWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedAcceptWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedAcceptWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedAcceptWithGenericStringCommandOutput/) + +
+
+ +MalformedAcceptWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedAcceptWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedAcceptWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedAcceptWithPayloadCommandOutput/) + +
+
+ +MalformedBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedBlobCommandOutput/) + +
+
+ +MalformedBoolean + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedBooleanCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedBooleanCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedBooleanCommandOutput/) + +
+
+ +MalformedByte + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedByteCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedByteCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedByteCommandOutput/) + +
+
+ +MalformedContentTypeWithBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedContentTypeWithBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithGenericString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedContentTypeWithGenericStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithGenericStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithGenericStringCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedContentTypeWithoutBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithoutBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithoutBodyCommandOutput/) + +
+
+ +MalformedContentTypeWithoutBodyEmptyInput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedContentTypeWithoutBodyEmptyInputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithoutBodyEmptyInputCommandOutput/) + +
+
+ +MalformedContentTypeWithPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedContentTypeWithPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedContentTypeWithPayloadCommandOutput/) + +
+
+ +MalformedDouble + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedDoubleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedDoubleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedDoubleCommandOutput/) + +
+
+ +MalformedFloat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedFloatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedFloatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedFloatCommandOutput/) + +
+
+ +MalformedInteger + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedIntegerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedIntegerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedIntegerCommandOutput/) + +
+
+ +MalformedList + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedListCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedListCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedListCommandOutput/) + +
+
+ +MalformedLong + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedLongCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLongCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLongCommandOutput/) + +
+
+ +MalformedMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedMapCommandOutput/) + +
+
+ +MalformedRequestBody + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedRequestBodyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRequestBodyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRequestBodyCommandOutput/) + +
+
+ +MalformedShort + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedShortCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedShortCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedShortCommandOutput/) + +
+
+ +MalformedString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedStringCommandOutput/) + +
+
+ +MalformedTimestampBodyDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampBodyDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampBodyDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampBodyDateTimeCommandOutput/) + +
+
+ +MalformedTimestampBodyDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampBodyDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampBodyDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampBodyDefaultCommandOutput/) + +
+
+ +MalformedTimestampBodyHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampBodyHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampBodyHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampBodyHttpDateCommandOutput/) + +
+
+ +MalformedTimestampHeaderDateTime + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampHeaderDateTimeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampHeaderDateTimeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampHeaderDateTimeCommandOutput/) + +
+
+ +MalformedTimestampHeaderDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampHeaderDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampHeaderDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampHeaderDefaultCommandOutput/) + +
+
+ +MalformedTimestampHeaderEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampHeaderEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampHeaderEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampHeaderEpochCommandOutput/) + +
+
+ +MalformedTimestampPathDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampPathDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampPathDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampPathDefaultCommandOutput/) + +
+
+ +MalformedTimestampPathEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampPathEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampPathEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampPathEpochCommandOutput/) + +
+
+ +MalformedTimestampPathHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampPathHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampPathHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampPathHttpDateCommandOutput/) + +
+
+ +MalformedTimestampQueryDefault + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampQueryDefaultCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampQueryDefaultCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampQueryDefaultCommandOutput/) + +
+
+ +MalformedTimestampQueryEpoch + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampQueryEpochCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampQueryEpochCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampQueryEpochCommandOutput/) + +
+
+ +MalformedTimestampQueryHttpDate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedTimestampQueryHttpDateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampQueryHttpDateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedTimestampQueryHttpDateCommandOutput/) + +
+
+ +MalformedUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedUnionCommandOutput/) + +
+
+ +MediaTypeHeader + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MediaTypeHeaderCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MediaTypeHeaderCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MediaTypeHeaderCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +OmitsSerializingEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OmitsSerializingEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OmitsSerializingEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OmitsSerializingEmptyListsCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OperationWithNestedStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithNestedStructureCommandOutput/) + +
+
+ +PostPlayerAction + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PostPlayerActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PostPlayerActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PostPlayerActionCommandOutput/) + +
+
+ +PostUnionWithJsonName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PostUnionWithJsonNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PostUnionWithJsonNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PostUnionWithJsonNameCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +ResponseCodeHttpFallback + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ResponseCodeHttpFallbackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ResponseCodeHttpFallbackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ResponseCodeHttpFallbackCommandOutput/) + +
+
+ +ResponseCodeRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ResponseCodeRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ResponseCodeRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ResponseCodeRequiredCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseJsonLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SparseJsonListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseJsonListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseJsonListsCommandOutput/) + +
+
+ +SparseJsonMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SparseJsonMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseJsonMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseJsonMapsCommandOutput/) + +
+
+ +StreamingTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/StreamingTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/StreamingTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/StreamingTraitsCommandOutput/) + +
+
+ +StreamingTraitsRequireLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/StreamingTraitsRequireLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/StreamingTraitsRequireLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/StreamingTraitsRequireLengthCommandOutput/) + +
+
+ +StreamingTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/StreamingTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/StreamingTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/StreamingTraitsWithMediaTypeCommandOutput/) + +
+
+ +TestBodyStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TestBodyStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestBodyStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestBodyStructureCommandOutput/) + +
+
+ +TestGetNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TestGetNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestGetNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestGetNoInputNoPayloadCommandOutput/) + +
+
+ +TestGetNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TestGetNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestGetNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestGetNoPayloadCommandOutput/) + +
+
+ +TestPayloadBlob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TestPayloadBlobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPayloadBlobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPayloadBlobCommandOutput/) + +
+
+ +TestPayloadStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TestPayloadStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPayloadStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPayloadStructureCommandOutput/) + +
+
+ +TestPostNoInputNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TestPostNoInputNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPostNoInputNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPostNoInputNoPayloadCommandOutput/) + +
+
+ +TestPostNoPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TestPostNoPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPostNoPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TestPostNoPayloadCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +UnitInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/UnitInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/UnitInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/UnitInputAndOutputCommandOutput/) + +
+
+ +MalformedEnum + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedEnumCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedEnumCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedEnumCommandOutput/) + +
+
+ +MalformedLength + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedLengthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLengthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLengthCommandOutput/) + +
+
+ +MalformedLengthOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedLengthOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLengthOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLengthOverrideCommandOutput/) + +
+
+ +MalformedLengthQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedLengthQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLengthQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedLengthQueryStringCommandOutput/) + +
+
+ +MalformedPattern + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedPatternCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedPatternCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedPatternCommandOutput/) + +
+
+ +MalformedPatternOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedPatternOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedPatternOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedPatternOverrideCommandOutput/) + +
+
+ +MalformedRange + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedRangeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRangeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRangeCommandOutput/) + +
+
+ +MalformedRangeOverride + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedRangeOverrideCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRangeOverrideCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRangeOverrideCommandOutput/) + +
+
+ +MalformedRequired + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedRequiredCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRequiredCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedRequiredCommandOutput/) + +
+
+ +MalformedUniqueItems + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/MalformedUniqueItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedUniqueItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/MalformedUniqueItemsCommandOutput/) + +
+
+ +RecursiveStructures + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RecursiveStructuresCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveStructuresCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveStructuresCommandOutput/) + +
+
+ +SensitiveValidation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SensitiveValidationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SensitiveValidationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SensitiveValidationCommandOutput/) + +
+
+ +AllQueryStringTypes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/AllQueryStringTypesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/AllQueryStringTypesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/AllQueryStringTypesCommandOutput/) + +
+
+ +BodyWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/BodyWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/BodyWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/BodyWithXmlNameCommandOutput/) + +
+
+ +ConstantAndVariableQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ConstantAndVariableQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantAndVariableQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantAndVariableQueryStringCommandOutput/) + +
+
+ +ConstantQueryString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ConstantQueryStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantQueryStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ConstantQueryStringCommandOutput/) + +
+
+ +ContentTypeParameters + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ContentTypeParametersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ContentTypeParametersCommandOutput/) + +
+
+ +DatetimeOffsets + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DatetimeOffsetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DatetimeOffsetsCommandOutput/) + +
+
+ +EmptyInputAndEmptyOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EmptyInputAndEmptyOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputAndEmptyOutputCommandOutput/) + +
+
+ +EndpointOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelHeaderOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointWithHostLabelHeaderOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelHeaderOperationCommandOutput/) + +
+
+ +EndpointWithHostLabelOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EndpointWithHostLabelOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EndpointWithHostLabelOperationCommandOutput/) + +
+
+ +FlattenedXmlMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FlattenedXmlMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FlattenedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNameCommandOutput/) + +
+
+ +FlattenedXmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FlattenedXmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FlattenedXmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +HttpEmptyPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpEmptyPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEmptyPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEmptyPrefixHeadersCommandOutput/) + +
+
+ +HttpEnumPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpEnumPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEnumPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpEnumPayloadCommandOutput/) + +
+
+ +HttpPayloadTraits + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadTraitsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsCommandOutput/) + +
+
+ +HttpPayloadTraitsWithMediaType + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadTraitsWithMediaTypeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadTraitsWithMediaTypeCommandOutput/) + +
+
+ +HttpPayloadWithMemberXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithMemberXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithMemberXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithMemberXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithStructure + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithStructureCommandOutput/) + +
+
+ +HttpPayloadWithUnion + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithUnionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithUnionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithUnionCommandOutput/) + +
+
+ +HttpPayloadWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithXmlNameCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithXmlNamespaceCommandOutput/) + +
+
+ +HttpPayloadWithXmlNamespaceAndPrefix + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPayloadWithXmlNamespaceAndPrefixCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPayloadWithXmlNamespaceAndPrefixCommandOutput/) + +
+
+ +HttpPrefixHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpPrefixHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPrefixHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpPrefixHeadersCommandOutput/) + +
+
+ +HttpRequestWithFloatLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithFloatLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithFloatLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithFloatLabelsCommandOutput/) + +
+
+ +HttpRequestWithGreedyLabelInPath + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithGreedyLabelInPathCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithGreedyLabelInPathCommandOutput/) + +
+
+ +HttpRequestWithLabels + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithLabelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsCommandOutput/) + +
+
+ +HttpRequestWithLabelsAndTimestampFormat + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpRequestWithLabelsAndTimestampFormatCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpRequestWithLabelsAndTimestampFormatCommandOutput/) + +
+
+ +HttpResponseCode + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpResponseCodeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpResponseCodeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpResponseCodeCommandOutput/) + +
+
+ +HttpStringPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpStringPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpStringPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpStringPayloadCommandOutput/) + +
+
+ +IgnoreQueryParamsInResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/IgnoreQueryParamsInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoreQueryParamsInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/IgnoreQueryParamsInResponseCommandOutput/) + +
+
+ +InputAndOutputWithHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputAndOutputWithHeadersCommandOutput/) + +
+
+ +NestedXmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NestedXmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedXmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedXmlMapsCommandOutput/) + +
+
+ +NestedXmlMapWithXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NestedXmlMapWithXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedXmlMapWithXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NestedXmlMapWithXmlNameCommandOutput/) + +
+
+ +NoInputAndNoOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndNoOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndNoOutputCommandOutput/) + +
+
+ +NoInputAndOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputAndOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputAndOutputCommandOutput/) + +
+
+ +NullAndEmptyHeadersClient + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NullAndEmptyHeadersClientCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersClientCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersClientCommandOutput/) + +
+
+ +NullAndEmptyHeadersServer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NullAndEmptyHeadersServerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersServerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NullAndEmptyHeadersServerCommandOutput/) + +
+
+ +OmitsNullSerializesEmptyString + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OmitsNullSerializesEmptyStringCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OmitsNullSerializesEmptyStringCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OmitsNullSerializesEmptyStringCommandOutput/) + +
+
+ +PutWithContentEncoding + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PutWithContentEncodingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PutWithContentEncodingCommandOutput/) + +
+
+ +QueryIdempotencyTokenAutoFill + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryIdempotencyTokenAutoFillCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryIdempotencyTokenAutoFillCommandOutput/) + +
+
+ +QueryParamsAsStringListMap + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryParamsAsStringListMapCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryParamsAsStringListMapCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryParamsAsStringListMapCommandOutput/) + +
+
+ +QueryPrecedence + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/QueryPrecedenceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryPrecedenceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/QueryPrecedenceCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +TimestampFormatHeaders + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/TimestampFormatHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TimestampFormatHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/TimestampFormatHeadersCommandOutput/) + +
+
+ +XmlAttributes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlAttributesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlAttributesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlAttributesCommandOutput/) + +
+
+ +XmlAttributesOnPayload + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlAttributesOnPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlAttributesOnPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlAttributesOnPayloadCommandOutput/) + +
+
+ +XmlBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlBlobsCommandOutput/) + +
+
+ +XmlEmptyBlobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyBlobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyBlobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyBlobsCommandOutput/) + +
+
+ +XmlEmptyLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyListsCommandOutput/) + +
+
+ +XmlEmptyMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyMapsCommandOutput/) + +
+
+ +XmlEmptyStrings + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEmptyStringsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyStringsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEmptyStringsCommandOutput/) + +
+
+ +XmlEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlEnumsCommandOutput/) + +
+
+ +XmlIntEnums + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlIntEnumsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlIntEnumsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlIntEnumsCommandOutput/) + +
+
+ +XmlLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlListsCommandOutput/) + +
+
+ +XmlMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsCommandOutput/) + +
+
+ +XmlMapsXmlName + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlMapsXmlNameCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsXmlNameCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapsXmlNameCommandOutput/) + +
+
+ +XmlMapWithXmlNamespace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlMapWithXmlNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapWithXmlNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlMapWithXmlNamespaceCommandOutput/) + +
+
+ +XmlNamespaces + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlNamespacesCommandOutput/) + +
+
+ +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/) + +
+
+ +XmlUnions + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/XmlUnionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlUnionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/XmlUnionsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +GetRestApis + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GetRestApisCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GetRestApisCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GetRestApisCommandOutput/) + +
+
+ +UploadArchive + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/UploadArchiveCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/UploadArchiveCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/UploadArchiveCommandOutput/) + +
+
+ +UploadMultipartPart + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/UploadMultipartPartCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/UploadMultipartPartCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/UploadMultipartPartCommandOutput/) + +
+
+ +Predict + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/PredictCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PredictCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/PredictCommandOutput/) + +
+
+ +DeleteObjectTagging + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DeleteObjectTaggingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DeleteObjectTaggingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DeleteObjectTaggingCommandOutput/) + +
+
+ +GetBucketLocation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GetBucketLocationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GetBucketLocationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GetBucketLocationCommandOutput/) + +
+
+ +GetObject + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GetObjectCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GetObjectCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GetObjectCommandOutput/) + +
+
+ +ListObjectsV2 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/ListObjectsV2Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ListObjectsV2CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/ListObjectsV2CommandOutput/) + +
+
+ +EmptyInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/EmptyInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/EmptyInputOutputCommandOutput/) + +
+
+ +Float16 + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/Float16Command/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/Float16CommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/Float16CommandOutput/) + +
+
+ +FractionalSeconds + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/FractionalSecondsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/FractionalSecondsCommandOutput/) + +
+
+ +GreetingWithErrors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/GreetingWithErrorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/GreetingWithErrorsCommandOutput/) + +
+
+ +NoInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/NoInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/NoInputOutputCommandOutput/) + +
+
+ +OperationWithDefaults + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OperationWithDefaultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithDefaultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OperationWithDefaultsCommandOutput/) + +
+
+ +OptionalInputOutput + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OptionalInputOutputCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OptionalInputOutputCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OptionalInputOutputCommandOutput/) + +
+
+ +RecursiveShapes + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RecursiveShapesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveShapesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RecursiveShapesCommandOutput/) + +
+
+ +RpcV2CborDenseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RpcV2CborDenseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RpcV2CborDenseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RpcV2CborDenseMapsCommandOutput/) + +
+
+ +RpcV2CborLists + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RpcV2CborListsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RpcV2CborListsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RpcV2CborListsCommandOutput/) + +
+
+ +RpcV2CborSparseMaps + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/RpcV2CborSparseMapsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RpcV2CborSparseMapsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/RpcV2CborSparseMapsCommandOutput/) + +
+
+ +SimpleScalarProperties + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SimpleScalarPropertiesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SimpleScalarPropertiesCommandOutput/) + +
+
+ +SparseNullsOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/SparseNullsOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseNullsOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/SparseNullsOperationCommandOutput/) + +
diff --git a/private/aws-protocoltests-restxml-schema/api-extractor.json b/private/aws-protocoltests-restxml-schema/api-extractor.json new file mode 100644 index 0000000000000..d5bf5ffeee851 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/private/aws-protocoltests-restxml-schema/package.json b/private/aws-protocoltests-restxml-schema/package.json new file mode 100644 index 0000000000000..e38a77eb9e45a --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/package.json @@ -0,0 +1,109 @@ +{ + "name": "@aws-sdk/aws-protocoltests-restxml-schema", + "description": "@aws-sdk/aws-protocoltests-restxml-schema client", + "version": "1.0.0-alpha.1", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "test": "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@aws-sdk/xml-builder": "*", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.5.2", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-compression": "^4.1.10", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.10", + "@smithy/middleware-retry": "^4.1.11", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/smithy-client": "^4.4.2", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.18", + "@smithy/util-defaults-mode-node": "^4.0.18", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "@smithy/util-stream": "^4.2.2", + "@smithy/util-utf8": "^4.0.0", + "@types/uuid": "^9.0.1", + "entities": "2.2.0", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@tsconfig/node18": "18.2.4", + "@types/node": "^18.19.69", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~5.8.3", + "vitest": "2.1.8" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "private": true, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-protocoltests-restxml-schema", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/aws-protocoltests-restxml-schema" + } +} diff --git a/private/aws-protocoltests-restxml-schema/src/RestXmlProtocol.ts b/private/aws-protocoltests-restxml-schema/src/RestXmlProtocol.ts new file mode 100644 index 0000000000000..50615e113b4cd --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/RestXmlProtocol.ts @@ -0,0 +1,1420 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + AllQueryStringTypesCommand, + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, +} from "./commands/AllQueryStringTypesCommand"; +import { + BodyWithXmlNameCommand, + BodyWithXmlNameCommandInput, + BodyWithXmlNameCommandOutput, +} from "./commands/BodyWithXmlNameCommand"; +import { + ConstantAndVariableQueryStringCommand, + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, +} from "./commands/ConstantAndVariableQueryStringCommand"; +import { + ConstantQueryStringCommand, + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, +} from "./commands/ConstantQueryStringCommand"; +import { + ContentTypeParametersCommand, + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { + DatetimeOffsetsCommand, + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, +} from "./commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommand, + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { + EndpointOperationCommand, + EndpointOperationCommandInput, + EndpointOperationCommandOutput, +} from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelHeaderOperationCommand, + EndpointWithHostLabelHeaderOperationCommandInput, + EndpointWithHostLabelHeaderOperationCommandOutput, +} from "./commands/EndpointWithHostLabelHeaderOperationCommand"; +import { + EndpointWithHostLabelOperationCommand, + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { + FlattenedXmlMapCommand, + FlattenedXmlMapCommandInput, + FlattenedXmlMapCommandOutput, +} from "./commands/FlattenedXmlMapCommand"; +import { + FlattenedXmlMapWithXmlNameCommand, + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNameCommand"; +import { + FlattenedXmlMapWithXmlNamespaceCommand, + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { + FractionalSecondsCommand, + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, +} from "./commands/FractionalSecondsCommand"; +import { + GreetingWithErrorsCommand, + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, +} from "./commands/GreetingWithErrorsCommand"; +import { + HttpEmptyPrefixHeadersCommand, + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, +} from "./commands/HttpEmptyPrefixHeadersCommand"; +import { + HttpEnumPayloadCommand, + HttpEnumPayloadCommandInput, + HttpEnumPayloadCommandOutput, +} from "./commands/HttpEnumPayloadCommand"; +import { + HttpPayloadTraitsCommand, + HttpPayloadTraitsCommandInput, + HttpPayloadTraitsCommandOutput, +} from "./commands/HttpPayloadTraitsCommand"; +import { + HttpPayloadTraitsWithMediaTypeCommand, + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, +} from "./commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { + HttpPayloadWithMemberXmlNameCommand, + HttpPayloadWithMemberXmlNameCommandInput, + HttpPayloadWithMemberXmlNameCommandOutput, +} from "./commands/HttpPayloadWithMemberXmlNameCommand"; +import { + HttpPayloadWithStructureCommand, + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, +} from "./commands/HttpPayloadWithStructureCommand"; +import { + HttpPayloadWithUnionCommand, + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, +} from "./commands/HttpPayloadWithUnionCommand"; +import { + HttpPayloadWithXmlNameCommand, + HttpPayloadWithXmlNameCommandInput, + HttpPayloadWithXmlNameCommandOutput, +} from "./commands/HttpPayloadWithXmlNameCommand"; +import { + HttpPayloadWithXmlNamespaceAndPrefixCommand, + HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + HttpPayloadWithXmlNamespaceAndPrefixCommandOutput, +} from "./commands/HttpPayloadWithXmlNamespaceAndPrefixCommand"; +import { + HttpPayloadWithXmlNamespaceCommand, + HttpPayloadWithXmlNamespaceCommandInput, + HttpPayloadWithXmlNamespaceCommandOutput, +} from "./commands/HttpPayloadWithXmlNamespaceCommand"; +import { + HttpPrefixHeadersCommand, + HttpPrefixHeadersCommandInput, + HttpPrefixHeadersCommandOutput, +} from "./commands/HttpPrefixHeadersCommand"; +import { + HttpRequestWithFloatLabelsCommand, + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, +} from "./commands/HttpRequestWithFloatLabelsCommand"; +import { + HttpRequestWithGreedyLabelInPathCommand, + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, +} from "./commands/HttpRequestWithGreedyLabelInPathCommand"; +import { + HttpRequestWithLabelsAndTimestampFormatCommand, + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, +} from "./commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { + HttpRequestWithLabelsCommand, + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, +} from "./commands/HttpRequestWithLabelsCommand"; +import { + HttpResponseCodeCommand, + HttpResponseCodeCommandInput, + HttpResponseCodeCommandOutput, +} from "./commands/HttpResponseCodeCommand"; +import { + HttpStringPayloadCommand, + HttpStringPayloadCommandInput, + HttpStringPayloadCommandOutput, +} from "./commands/HttpStringPayloadCommand"; +import { + IgnoreQueryParamsInResponseCommand, + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, +} from "./commands/IgnoreQueryParamsInResponseCommand"; +import { + InputAndOutputWithHeadersCommand, + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, +} from "./commands/InputAndOutputWithHeadersCommand"; +import { + NestedXmlMapsCommand, + NestedXmlMapsCommandInput, + NestedXmlMapsCommandOutput, +} from "./commands/NestedXmlMapsCommand"; +import { + NestedXmlMapWithXmlNameCommand, + NestedXmlMapWithXmlNameCommandInput, + NestedXmlMapWithXmlNameCommandOutput, +} from "./commands/NestedXmlMapWithXmlNameCommand"; +import { + NoInputAndNoOutputCommand, + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, +} from "./commands/NoInputAndNoOutputCommand"; +import { + NoInputAndOutputCommand, + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, +} from "./commands/NoInputAndOutputCommand"; +import { + NullAndEmptyHeadersClientCommand, + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, +} from "./commands/NullAndEmptyHeadersClientCommand"; +import { + NullAndEmptyHeadersServerCommand, + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, +} from "./commands/NullAndEmptyHeadersServerCommand"; +import { + OmitsNullSerializesEmptyStringCommand, + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, +} from "./commands/OmitsNullSerializesEmptyStringCommand"; +import { + PutWithContentEncodingCommand, + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommand, + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { + QueryParamsAsStringListMapCommand, + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, +} from "./commands/QueryParamsAsStringListMapCommand"; +import { + QueryPrecedenceCommand, + QueryPrecedenceCommandInput, + QueryPrecedenceCommandOutput, +} from "./commands/QueryPrecedenceCommand"; +import { + RecursiveShapesCommand, + RecursiveShapesCommandInput, + RecursiveShapesCommandOutput, +} from "./commands/RecursiveShapesCommand"; +import { + SimpleScalarPropertiesCommand, + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + TimestampFormatHeadersCommand, + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, +} from "./commands/TimestampFormatHeadersCommand"; +import { + XmlAttributesCommand, + XmlAttributesCommandInput, + XmlAttributesCommandOutput, +} from "./commands/XmlAttributesCommand"; +import { + XmlAttributesOnPayloadCommand, + XmlAttributesOnPayloadCommandInput, + XmlAttributesOnPayloadCommandOutput, +} from "./commands/XmlAttributesOnPayloadCommand"; +import { XmlBlobsCommand, XmlBlobsCommandInput, XmlBlobsCommandOutput } from "./commands/XmlBlobsCommand"; +import { + XmlEmptyBlobsCommand, + XmlEmptyBlobsCommandInput, + XmlEmptyBlobsCommandOutput, +} from "./commands/XmlEmptyBlobsCommand"; +import { + XmlEmptyListsCommand, + XmlEmptyListsCommandInput, + XmlEmptyListsCommandOutput, +} from "./commands/XmlEmptyListsCommand"; +import { + XmlEmptyMapsCommand, + XmlEmptyMapsCommandInput, + XmlEmptyMapsCommandOutput, +} from "./commands/XmlEmptyMapsCommand"; +import { + XmlEmptyStringsCommand, + XmlEmptyStringsCommandInput, + XmlEmptyStringsCommandOutput, +} from "./commands/XmlEmptyStringsCommand"; +import { XmlEnumsCommand, XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand"; +import { XmlIntEnumsCommand, XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand"; +import { XmlListsCommand, XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand"; +import { XmlMapsCommand, XmlMapsCommandInput, XmlMapsCommandOutput } from "./commands/XmlMapsCommand"; +import { + XmlMapsXmlNameCommand, + XmlMapsXmlNameCommandInput, + XmlMapsXmlNameCommandOutput, +} from "./commands/XmlMapsXmlNameCommand"; +import { + XmlMapWithXmlNamespaceCommand, + XmlMapWithXmlNamespaceCommandInput, + XmlMapWithXmlNamespaceCommandOutput, +} from "./commands/XmlMapWithXmlNamespaceCommand"; +import { + XmlNamespacesCommand, + XmlNamespacesCommandInput, + XmlNamespacesCommandOutput, +} from "./commands/XmlNamespacesCommand"; +import { + XmlTimestampsCommand, + XmlTimestampsCommandInput, + XmlTimestampsCommandOutput, +} from "./commands/XmlTimestampsCommand"; +import { XmlUnionsCommand, XmlUnionsCommandInput, XmlUnionsCommandOutput } from "./commands/XmlUnionsCommand"; +import { RestXmlProtocolClient, RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; + +const commands = { + AllQueryStringTypesCommand, + BodyWithXmlNameCommand, + ConstantAndVariableQueryStringCommand, + ConstantQueryStringCommand, + ContentTypeParametersCommand, + DatetimeOffsetsCommand, + EmptyInputAndEmptyOutputCommand, + EndpointOperationCommand, + EndpointWithHostLabelHeaderOperationCommand, + EndpointWithHostLabelOperationCommand, + FlattenedXmlMapCommand, + FlattenedXmlMapWithXmlNameCommand, + FlattenedXmlMapWithXmlNamespaceCommand, + FractionalSecondsCommand, + GreetingWithErrorsCommand, + HttpEmptyPrefixHeadersCommand, + HttpEnumPayloadCommand, + HttpPayloadTraitsCommand, + HttpPayloadTraitsWithMediaTypeCommand, + HttpPayloadWithMemberXmlNameCommand, + HttpPayloadWithStructureCommand, + HttpPayloadWithUnionCommand, + HttpPayloadWithXmlNameCommand, + HttpPayloadWithXmlNamespaceCommand, + HttpPayloadWithXmlNamespaceAndPrefixCommand, + HttpPrefixHeadersCommand, + HttpRequestWithFloatLabelsCommand, + HttpRequestWithGreedyLabelInPathCommand, + HttpRequestWithLabelsCommand, + HttpRequestWithLabelsAndTimestampFormatCommand, + HttpResponseCodeCommand, + HttpStringPayloadCommand, + IgnoreQueryParamsInResponseCommand, + InputAndOutputWithHeadersCommand, + NestedXmlMapsCommand, + NestedXmlMapWithXmlNameCommand, + NoInputAndNoOutputCommand, + NoInputAndOutputCommand, + NullAndEmptyHeadersClientCommand, + NullAndEmptyHeadersServerCommand, + OmitsNullSerializesEmptyStringCommand, + PutWithContentEncodingCommand, + QueryIdempotencyTokenAutoFillCommand, + QueryParamsAsStringListMapCommand, + QueryPrecedenceCommand, + RecursiveShapesCommand, + SimpleScalarPropertiesCommand, + TimestampFormatHeadersCommand, + XmlAttributesCommand, + XmlAttributesOnPayloadCommand, + XmlBlobsCommand, + XmlEmptyBlobsCommand, + XmlEmptyListsCommand, + XmlEmptyMapsCommand, + XmlEmptyStringsCommand, + XmlEnumsCommand, + XmlIntEnumsCommand, + XmlListsCommand, + XmlMapsCommand, + XmlMapsXmlNameCommand, + XmlMapWithXmlNamespaceCommand, + XmlNamespacesCommand, + XmlTimestampsCommand, + XmlUnionsCommand, +}; + +export interface RestXmlProtocol { + /** + * @see {@link AllQueryStringTypesCommand} + */ + allQueryStringTypes(): Promise; + allQueryStringTypes( + args: AllQueryStringTypesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + allQueryStringTypes( + args: AllQueryStringTypesCommandInput, + cb: (err: any, data?: AllQueryStringTypesCommandOutput) => void + ): void; + allQueryStringTypes( + args: AllQueryStringTypesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AllQueryStringTypesCommandOutput) => void + ): void; + + /** + * @see {@link BodyWithXmlNameCommand} + */ + bodyWithXmlName(): Promise; + bodyWithXmlName( + args: BodyWithXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + bodyWithXmlName(args: BodyWithXmlNameCommandInput, cb: (err: any, data?: BodyWithXmlNameCommandOutput) => void): void; + bodyWithXmlName( + args: BodyWithXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BodyWithXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link ConstantAndVariableQueryStringCommand} + */ + constantAndVariableQueryString(): Promise; + constantAndVariableQueryString( + args: ConstantAndVariableQueryStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + constantAndVariableQueryString( + args: ConstantAndVariableQueryStringCommandInput, + cb: (err: any, data?: ConstantAndVariableQueryStringCommandOutput) => void + ): void; + constantAndVariableQueryString( + args: ConstantAndVariableQueryStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ConstantAndVariableQueryStringCommandOutput) => void + ): void; + + /** + * @see {@link ConstantQueryStringCommand} + */ + constantQueryString( + args: ConstantQueryStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + constantQueryString( + args: ConstantQueryStringCommandInput, + cb: (err: any, data?: ConstantQueryStringCommandOutput) => void + ): void; + constantQueryString( + args: ConstantQueryStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ConstantQueryStringCommandOutput) => void + ): void; + + /** + * @see {@link ContentTypeParametersCommand} + */ + contentTypeParameters(): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + contentTypeParameters( + args: ContentTypeParametersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ContentTypeParametersCommandOutput) => void + ): void; + + /** + * @see {@link DatetimeOffsetsCommand} + */ + datetimeOffsets(): Promise; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + datetimeOffsets(args: DatetimeOffsetsCommandInput, cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void): void; + datetimeOffsets( + args: DatetimeOffsetsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DatetimeOffsetsCommandOutput) => void + ): void; + + /** + * @see {@link EmptyInputAndEmptyOutputCommand} + */ + emptyInputAndEmptyOutput(): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + emptyInputAndEmptyOutput( + args: EmptyInputAndEmptyOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EmptyInputAndEmptyOutputCommandOutput) => void + ): void; + + /** + * @see {@link EndpointOperationCommand} + */ + endpointOperation(): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointOperation( + args: EndpointOperationCommandInput, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + endpointOperation( + args: EndpointOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointWithHostLabelHeaderOperationCommand} + */ + endpointWithHostLabelHeaderOperation( + args: EndpointWithHostLabelHeaderOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointWithHostLabelHeaderOperation( + args: EndpointWithHostLabelHeaderOperationCommandInput, + cb: (err: any, data?: EndpointWithHostLabelHeaderOperationCommandOutput) => void + ): void; + endpointWithHostLabelHeaderOperation( + args: EndpointWithHostLabelHeaderOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointWithHostLabelHeaderOperationCommandOutput) => void + ): void; + + /** + * @see {@link EndpointWithHostLabelOperationCommand} + */ + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + endpointWithHostLabelOperation( + args: EndpointWithHostLabelOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EndpointWithHostLabelOperationCommandOutput) => void + ): void; + + /** + * @see {@link FlattenedXmlMapCommand} + */ + flattenedXmlMap(): Promise; + flattenedXmlMap( + args: FlattenedXmlMapCommandInput, + options?: __HttpHandlerOptions + ): Promise; + flattenedXmlMap(args: FlattenedXmlMapCommandInput, cb: (err: any, data?: FlattenedXmlMapCommandOutput) => void): void; + flattenedXmlMap( + args: FlattenedXmlMapCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FlattenedXmlMapCommandOutput) => void + ): void; + + /** + * @see {@link FlattenedXmlMapWithXmlNameCommand} + */ + flattenedXmlMapWithXmlName(): Promise; + flattenedXmlMapWithXmlName( + args: FlattenedXmlMapWithXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + flattenedXmlMapWithXmlName( + args: FlattenedXmlMapWithXmlNameCommandInput, + cb: (err: any, data?: FlattenedXmlMapWithXmlNameCommandOutput) => void + ): void; + flattenedXmlMapWithXmlName( + args: FlattenedXmlMapWithXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FlattenedXmlMapWithXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link FlattenedXmlMapWithXmlNamespaceCommand} + */ + flattenedXmlMapWithXmlNamespace(): Promise; + flattenedXmlMapWithXmlNamespace( + args: FlattenedXmlMapWithXmlNamespaceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + flattenedXmlMapWithXmlNamespace( + args: FlattenedXmlMapWithXmlNamespaceCommandInput, + cb: (err: any, data?: FlattenedXmlMapWithXmlNamespaceCommandOutput) => void + ): void; + flattenedXmlMapWithXmlNamespace( + args: FlattenedXmlMapWithXmlNamespaceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FlattenedXmlMapWithXmlNamespaceCommandOutput) => void + ): void; + + /** + * @see {@link FractionalSecondsCommand} + */ + fractionalSeconds(): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + + /** + * @see {@link GreetingWithErrorsCommand} + */ + greetingWithErrors(): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + + /** + * @see {@link HttpEmptyPrefixHeadersCommand} + */ + httpEmptyPrefixHeaders(): Promise; + httpEmptyPrefixHeaders( + args: HttpEmptyPrefixHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpEmptyPrefixHeaders( + args: HttpEmptyPrefixHeadersCommandInput, + cb: (err: any, data?: HttpEmptyPrefixHeadersCommandOutput) => void + ): void; + httpEmptyPrefixHeaders( + args: HttpEmptyPrefixHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpEmptyPrefixHeadersCommandOutput) => void + ): void; + + /** + * @see {@link HttpEnumPayloadCommand} + */ + httpEnumPayload(): Promise; + httpEnumPayload( + args: HttpEnumPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpEnumPayload(args: HttpEnumPayloadCommandInput, cb: (err: any, data?: HttpEnumPayloadCommandOutput) => void): void; + httpEnumPayload( + args: HttpEnumPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpEnumPayloadCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadTraitsCommand} + */ + httpPayloadTraits(): Promise; + httpPayloadTraits( + args: HttpPayloadTraitsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadTraits( + args: HttpPayloadTraitsCommandInput, + cb: (err: any, data?: HttpPayloadTraitsCommandOutput) => void + ): void; + httpPayloadTraits( + args: HttpPayloadTraitsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadTraitsCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadTraitsWithMediaTypeCommand} + */ + httpPayloadTraitsWithMediaType(): Promise; + httpPayloadTraitsWithMediaType( + args: HttpPayloadTraitsWithMediaTypeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadTraitsWithMediaType( + args: HttpPayloadTraitsWithMediaTypeCommandInput, + cb: (err: any, data?: HttpPayloadTraitsWithMediaTypeCommandOutput) => void + ): void; + httpPayloadTraitsWithMediaType( + args: HttpPayloadTraitsWithMediaTypeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadTraitsWithMediaTypeCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithMemberXmlNameCommand} + */ + httpPayloadWithMemberXmlName(): Promise; + httpPayloadWithMemberXmlName( + args: HttpPayloadWithMemberXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithMemberXmlName( + args: HttpPayloadWithMemberXmlNameCommandInput, + cb: (err: any, data?: HttpPayloadWithMemberXmlNameCommandOutput) => void + ): void; + httpPayloadWithMemberXmlName( + args: HttpPayloadWithMemberXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithMemberXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithStructureCommand} + */ + httpPayloadWithStructure(): Promise; + httpPayloadWithStructure( + args: HttpPayloadWithStructureCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithStructure( + args: HttpPayloadWithStructureCommandInput, + cb: (err: any, data?: HttpPayloadWithStructureCommandOutput) => void + ): void; + httpPayloadWithStructure( + args: HttpPayloadWithStructureCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithStructureCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithUnionCommand} + */ + httpPayloadWithUnion(): Promise; + httpPayloadWithUnion( + args: HttpPayloadWithUnionCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithUnion( + args: HttpPayloadWithUnionCommandInput, + cb: (err: any, data?: HttpPayloadWithUnionCommandOutput) => void + ): void; + httpPayloadWithUnion( + args: HttpPayloadWithUnionCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithUnionCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithXmlNameCommand} + */ + httpPayloadWithXmlName(): Promise; + httpPayloadWithXmlName( + args: HttpPayloadWithXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithXmlName( + args: HttpPayloadWithXmlNameCommandInput, + cb: (err: any, data?: HttpPayloadWithXmlNameCommandOutput) => void + ): void; + httpPayloadWithXmlName( + args: HttpPayloadWithXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithXmlNamespaceCommand} + */ + httpPayloadWithXmlNamespace(): Promise; + httpPayloadWithXmlNamespace( + args: HttpPayloadWithXmlNamespaceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithXmlNamespace( + args: HttpPayloadWithXmlNamespaceCommandInput, + cb: (err: any, data?: HttpPayloadWithXmlNamespaceCommandOutput) => void + ): void; + httpPayloadWithXmlNamespace( + args: HttpPayloadWithXmlNamespaceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithXmlNamespaceCommandOutput) => void + ): void; + + /** + * @see {@link HttpPayloadWithXmlNamespaceAndPrefixCommand} + */ + httpPayloadWithXmlNamespaceAndPrefix(): Promise; + httpPayloadWithXmlNamespaceAndPrefix( + args: HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPayloadWithXmlNamespaceAndPrefix( + args: HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + cb: (err: any, data?: HttpPayloadWithXmlNamespaceAndPrefixCommandOutput) => void + ): void; + httpPayloadWithXmlNamespaceAndPrefix( + args: HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPayloadWithXmlNamespaceAndPrefixCommandOutput) => void + ): void; + + /** + * @see {@link HttpPrefixHeadersCommand} + */ + httpPrefixHeaders(): Promise; + httpPrefixHeaders( + args: HttpPrefixHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpPrefixHeaders( + args: HttpPrefixHeadersCommandInput, + cb: (err: any, data?: HttpPrefixHeadersCommandOutput) => void + ): void; + httpPrefixHeaders( + args: HttpPrefixHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpPrefixHeadersCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithFloatLabelsCommand} + */ + httpRequestWithFloatLabels( + args: HttpRequestWithFloatLabelsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithFloatLabels( + args: HttpRequestWithFloatLabelsCommandInput, + cb: (err: any, data?: HttpRequestWithFloatLabelsCommandOutput) => void + ): void; + httpRequestWithFloatLabels( + args: HttpRequestWithFloatLabelsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithFloatLabelsCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithGreedyLabelInPathCommand} + */ + httpRequestWithGreedyLabelInPath( + args: HttpRequestWithGreedyLabelInPathCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithGreedyLabelInPath( + args: HttpRequestWithGreedyLabelInPathCommandInput, + cb: (err: any, data?: HttpRequestWithGreedyLabelInPathCommandOutput) => void + ): void; + httpRequestWithGreedyLabelInPath( + args: HttpRequestWithGreedyLabelInPathCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithGreedyLabelInPathCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithLabelsCommand} + */ + httpRequestWithLabels( + args: HttpRequestWithLabelsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithLabels( + args: HttpRequestWithLabelsCommandInput, + cb: (err: any, data?: HttpRequestWithLabelsCommandOutput) => void + ): void; + httpRequestWithLabels( + args: HttpRequestWithLabelsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithLabelsCommandOutput) => void + ): void; + + /** + * @see {@link HttpRequestWithLabelsAndTimestampFormatCommand} + */ + httpRequestWithLabelsAndTimestampFormat( + args: HttpRequestWithLabelsAndTimestampFormatCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpRequestWithLabelsAndTimestampFormat( + args: HttpRequestWithLabelsAndTimestampFormatCommandInput, + cb: (err: any, data?: HttpRequestWithLabelsAndTimestampFormatCommandOutput) => void + ): void; + httpRequestWithLabelsAndTimestampFormat( + args: HttpRequestWithLabelsAndTimestampFormatCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpRequestWithLabelsAndTimestampFormatCommandOutput) => void + ): void; + + /** + * @see {@link HttpResponseCodeCommand} + */ + httpResponseCode(): Promise; + httpResponseCode( + args: HttpResponseCodeCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpResponseCode( + args: HttpResponseCodeCommandInput, + cb: (err: any, data?: HttpResponseCodeCommandOutput) => void + ): void; + httpResponseCode( + args: HttpResponseCodeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpResponseCodeCommandOutput) => void + ): void; + + /** + * @see {@link HttpStringPayloadCommand} + */ + httpStringPayload(): Promise; + httpStringPayload( + args: HttpStringPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpStringPayload( + args: HttpStringPayloadCommandInput, + cb: (err: any, data?: HttpStringPayloadCommandOutput) => void + ): void; + httpStringPayload( + args: HttpStringPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpStringPayloadCommandOutput) => void + ): void; + + /** + * @see {@link IgnoreQueryParamsInResponseCommand} + */ + ignoreQueryParamsInResponse(): Promise; + ignoreQueryParamsInResponse( + args: IgnoreQueryParamsInResponseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + ignoreQueryParamsInResponse( + args: IgnoreQueryParamsInResponseCommandInput, + cb: (err: any, data?: IgnoreQueryParamsInResponseCommandOutput) => void + ): void; + ignoreQueryParamsInResponse( + args: IgnoreQueryParamsInResponseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: IgnoreQueryParamsInResponseCommandOutput) => void + ): void; + + /** + * @see {@link InputAndOutputWithHeadersCommand} + */ + inputAndOutputWithHeaders(): Promise; + inputAndOutputWithHeaders( + args: InputAndOutputWithHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + inputAndOutputWithHeaders( + args: InputAndOutputWithHeadersCommandInput, + cb: (err: any, data?: InputAndOutputWithHeadersCommandOutput) => void + ): void; + inputAndOutputWithHeaders( + args: InputAndOutputWithHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InputAndOutputWithHeadersCommandOutput) => void + ): void; + + /** + * @see {@link NestedXmlMapsCommand} + */ + nestedXmlMaps(): Promise; + nestedXmlMaps(args: NestedXmlMapsCommandInput, options?: __HttpHandlerOptions): Promise; + nestedXmlMaps(args: NestedXmlMapsCommandInput, cb: (err: any, data?: NestedXmlMapsCommandOutput) => void): void; + nestedXmlMaps( + args: NestedXmlMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NestedXmlMapsCommandOutput) => void + ): void; + + /** + * @see {@link NestedXmlMapWithXmlNameCommand} + */ + nestedXmlMapWithXmlName(): Promise; + nestedXmlMapWithXmlName( + args: NestedXmlMapWithXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + nestedXmlMapWithXmlName( + args: NestedXmlMapWithXmlNameCommandInput, + cb: (err: any, data?: NestedXmlMapWithXmlNameCommandOutput) => void + ): void; + nestedXmlMapWithXmlName( + args: NestedXmlMapWithXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NestedXmlMapWithXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndNoOutputCommand} + */ + noInputAndNoOutput(): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + noInputAndNoOutput( + args: NoInputAndNoOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndNoOutputCommandOutput) => void + ): void; + + /** + * @see {@link NoInputAndOutputCommand} + */ + noInputAndOutput(): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + noInputAndOutput( + args: NoInputAndOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputAndOutputCommandOutput) => void + ): void; + + /** + * @see {@link NullAndEmptyHeadersClientCommand} + */ + nullAndEmptyHeadersClient(): Promise; + nullAndEmptyHeadersClient( + args: NullAndEmptyHeadersClientCommandInput, + options?: __HttpHandlerOptions + ): Promise; + nullAndEmptyHeadersClient( + args: NullAndEmptyHeadersClientCommandInput, + cb: (err: any, data?: NullAndEmptyHeadersClientCommandOutput) => void + ): void; + nullAndEmptyHeadersClient( + args: NullAndEmptyHeadersClientCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NullAndEmptyHeadersClientCommandOutput) => void + ): void; + + /** + * @see {@link NullAndEmptyHeadersServerCommand} + */ + nullAndEmptyHeadersServer(): Promise; + nullAndEmptyHeadersServer( + args: NullAndEmptyHeadersServerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + nullAndEmptyHeadersServer( + args: NullAndEmptyHeadersServerCommandInput, + cb: (err: any, data?: NullAndEmptyHeadersServerCommandOutput) => void + ): void; + nullAndEmptyHeadersServer( + args: NullAndEmptyHeadersServerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NullAndEmptyHeadersServerCommandOutput) => void + ): void; + + /** + * @see {@link OmitsNullSerializesEmptyStringCommand} + */ + omitsNullSerializesEmptyString(): Promise; + omitsNullSerializesEmptyString( + args: OmitsNullSerializesEmptyStringCommandInput, + options?: __HttpHandlerOptions + ): Promise; + omitsNullSerializesEmptyString( + args: OmitsNullSerializesEmptyStringCommandInput, + cb: (err: any, data?: OmitsNullSerializesEmptyStringCommandOutput) => void + ): void; + omitsNullSerializesEmptyString( + args: OmitsNullSerializesEmptyStringCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OmitsNullSerializesEmptyStringCommandOutput) => void + ): void; + + /** + * @see {@link PutWithContentEncodingCommand} + */ + putWithContentEncoding(): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + putWithContentEncoding( + args: PutWithContentEncodingCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutWithContentEncodingCommandOutput) => void + ): void; + + /** + * @see {@link QueryIdempotencyTokenAutoFillCommand} + */ + queryIdempotencyTokenAutoFill(): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + queryIdempotencyTokenAutoFill( + args: QueryIdempotencyTokenAutoFillCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryIdempotencyTokenAutoFillCommandOutput) => void + ): void; + + /** + * @see {@link QueryParamsAsStringListMapCommand} + */ + queryParamsAsStringListMap(): Promise; + queryParamsAsStringListMap( + args: QueryParamsAsStringListMapCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryParamsAsStringListMap( + args: QueryParamsAsStringListMapCommandInput, + cb: (err: any, data?: QueryParamsAsStringListMapCommandOutput) => void + ): void; + queryParamsAsStringListMap( + args: QueryParamsAsStringListMapCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryParamsAsStringListMapCommandOutput) => void + ): void; + + /** + * @see {@link QueryPrecedenceCommand} + */ + queryPrecedence(): Promise; + queryPrecedence( + args: QueryPrecedenceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + queryPrecedence(args: QueryPrecedenceCommandInput, cb: (err: any, data?: QueryPrecedenceCommandOutput) => void): void; + queryPrecedence( + args: QueryPrecedenceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: QueryPrecedenceCommandOutput) => void + ): void; + + /** + * @see {@link RecursiveShapesCommand} + */ + recursiveShapes(): Promise; + recursiveShapes( + args: RecursiveShapesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + recursiveShapes(args: RecursiveShapesCommandInput, cb: (err: any, data?: RecursiveShapesCommandOutput) => void): void; + recursiveShapes( + args: RecursiveShapesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RecursiveShapesCommandOutput) => void + ): void; + + /** + * @see {@link SimpleScalarPropertiesCommand} + */ + simpleScalarProperties(): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + + /** + * @see {@link TimestampFormatHeadersCommand} + */ + timestampFormatHeaders(): Promise; + timestampFormatHeaders( + args: TimestampFormatHeadersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + timestampFormatHeaders( + args: TimestampFormatHeadersCommandInput, + cb: (err: any, data?: TimestampFormatHeadersCommandOutput) => void + ): void; + timestampFormatHeaders( + args: TimestampFormatHeadersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TimestampFormatHeadersCommandOutput) => void + ): void; + + /** + * @see {@link XmlAttributesCommand} + */ + xmlAttributes(): Promise; + xmlAttributes(args: XmlAttributesCommandInput, options?: __HttpHandlerOptions): Promise; + xmlAttributes(args: XmlAttributesCommandInput, cb: (err: any, data?: XmlAttributesCommandOutput) => void): void; + xmlAttributes( + args: XmlAttributesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlAttributesCommandOutput) => void + ): void; + + /** + * @see {@link XmlAttributesOnPayloadCommand} + */ + xmlAttributesOnPayload(): Promise; + xmlAttributesOnPayload( + args: XmlAttributesOnPayloadCommandInput, + options?: __HttpHandlerOptions + ): Promise; + xmlAttributesOnPayload( + args: XmlAttributesOnPayloadCommandInput, + cb: (err: any, data?: XmlAttributesOnPayloadCommandOutput) => void + ): void; + xmlAttributesOnPayload( + args: XmlAttributesOnPayloadCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlAttributesOnPayloadCommandOutput) => void + ): void; + + /** + * @see {@link XmlBlobsCommand} + */ + xmlBlobs(): Promise; + xmlBlobs(args: XmlBlobsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlBlobs(args: XmlBlobsCommandInput, cb: (err: any, data?: XmlBlobsCommandOutput) => void): void; + xmlBlobs( + args: XmlBlobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlBlobsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyBlobsCommand} + */ + xmlEmptyBlobs(): Promise; + xmlEmptyBlobs(args: XmlEmptyBlobsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyBlobs(args: XmlEmptyBlobsCommandInput, cb: (err: any, data?: XmlEmptyBlobsCommandOutput) => void): void; + xmlEmptyBlobs( + args: XmlEmptyBlobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyBlobsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyListsCommand} + */ + xmlEmptyLists(): Promise; + xmlEmptyLists(args: XmlEmptyListsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyLists(args: XmlEmptyListsCommandInput, cb: (err: any, data?: XmlEmptyListsCommandOutput) => void): void; + xmlEmptyLists( + args: XmlEmptyListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyListsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyMapsCommand} + */ + xmlEmptyMaps(): Promise; + xmlEmptyMaps(args: XmlEmptyMapsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEmptyMaps(args: XmlEmptyMapsCommandInput, cb: (err: any, data?: XmlEmptyMapsCommandOutput) => void): void; + xmlEmptyMaps( + args: XmlEmptyMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyMapsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEmptyStringsCommand} + */ + xmlEmptyStrings(): Promise; + xmlEmptyStrings( + args: XmlEmptyStringsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + xmlEmptyStrings(args: XmlEmptyStringsCommandInput, cb: (err: any, data?: XmlEmptyStringsCommandOutput) => void): void; + xmlEmptyStrings( + args: XmlEmptyStringsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEmptyStringsCommandOutput) => void + ): void; + + /** + * @see {@link XmlEnumsCommand} + */ + xmlEnums(): Promise; + xmlEnums(args: XmlEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlEnums(args: XmlEnumsCommandInput, cb: (err: any, data?: XmlEnumsCommandOutput) => void): void; + xmlEnums( + args: XmlEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlEnumsCommandOutput) => void + ): void; + + /** + * @see {@link XmlIntEnumsCommand} + */ + xmlIntEnums(): Promise; + xmlIntEnums(args: XmlIntEnumsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlIntEnums(args: XmlIntEnumsCommandInput, cb: (err: any, data?: XmlIntEnumsCommandOutput) => void): void; + xmlIntEnums( + args: XmlIntEnumsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlIntEnumsCommandOutput) => void + ): void; + + /** + * @see {@link XmlListsCommand} + */ + xmlLists(): Promise; + xmlLists(args: XmlListsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlLists(args: XmlListsCommandInput, cb: (err: any, data?: XmlListsCommandOutput) => void): void; + xmlLists( + args: XmlListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlListsCommandOutput) => void + ): void; + + /** + * @see {@link XmlMapsCommand} + */ + xmlMaps(): Promise; + xmlMaps(args: XmlMapsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlMaps(args: XmlMapsCommandInput, cb: (err: any, data?: XmlMapsCommandOutput) => void): void; + xmlMaps( + args: XmlMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlMapsCommandOutput) => void + ): void; + + /** + * @see {@link XmlMapsXmlNameCommand} + */ + xmlMapsXmlName(): Promise; + xmlMapsXmlName( + args: XmlMapsXmlNameCommandInput, + options?: __HttpHandlerOptions + ): Promise; + xmlMapsXmlName(args: XmlMapsXmlNameCommandInput, cb: (err: any, data?: XmlMapsXmlNameCommandOutput) => void): void; + xmlMapsXmlName( + args: XmlMapsXmlNameCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlMapsXmlNameCommandOutput) => void + ): void; + + /** + * @see {@link XmlMapWithXmlNamespaceCommand} + */ + xmlMapWithXmlNamespace(): Promise; + xmlMapWithXmlNamespace( + args: XmlMapWithXmlNamespaceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + xmlMapWithXmlNamespace( + args: XmlMapWithXmlNamespaceCommandInput, + cb: (err: any, data?: XmlMapWithXmlNamespaceCommandOutput) => void + ): void; + xmlMapWithXmlNamespace( + args: XmlMapWithXmlNamespaceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlMapWithXmlNamespaceCommandOutput) => void + ): void; + + /** + * @see {@link XmlNamespacesCommand} + */ + xmlNamespaces(): Promise; + xmlNamespaces(args: XmlNamespacesCommandInput, options?: __HttpHandlerOptions): Promise; + xmlNamespaces(args: XmlNamespacesCommandInput, cb: (err: any, data?: XmlNamespacesCommandOutput) => void): void; + xmlNamespaces( + args: XmlNamespacesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlNamespacesCommandOutput) => void + ): void; + + /** + * @see {@link XmlTimestampsCommand} + */ + xmlTimestamps(): Promise; + xmlTimestamps(args: XmlTimestampsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlTimestamps(args: XmlTimestampsCommandInput, cb: (err: any, data?: XmlTimestampsCommandOutput) => void): void; + xmlTimestamps( + args: XmlTimestampsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlTimestampsCommandOutput) => void + ): void; + + /** + * @see {@link XmlUnionsCommand} + */ + xmlUnions(): Promise; + xmlUnions(args: XmlUnionsCommandInput, options?: __HttpHandlerOptions): Promise; + xmlUnions(args: XmlUnionsCommandInput, cb: (err: any, data?: XmlUnionsCommandOutput) => void): void; + xmlUnions( + args: XmlUnionsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: XmlUnionsCommandOutput) => void + ): void; +} + +/** + * A REST XML service that sends XML requests and responses. + * @public + */ +export class RestXmlProtocol extends RestXmlProtocolClient implements RestXmlProtocol {} +createAggregatedClient(commands, RestXmlProtocol); diff --git a/private/aws-protocoltests-restxml-schema/src/RestXmlProtocolClient.ts b/private/aws-protocoltests-restxml-schema/src/RestXmlProtocolClient.ts new file mode 100644 index 0000000000000..970dd768282f0 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/RestXmlProtocolClient.ts @@ -0,0 +1,638 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + AwsCredentialIdentityProvider, + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + ClientProtocol, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + HttpRequest, + HttpResponse, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + defaultRestXmlProtocolHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, +} from "./commands/AllQueryStringTypesCommand"; +import { BodyWithXmlNameCommandInput, BodyWithXmlNameCommandOutput } from "./commands/BodyWithXmlNameCommand"; +import { + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, +} from "./commands/ConstantAndVariableQueryStringCommand"; +import { + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, +} from "./commands/ConstantQueryStringCommand"; +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "./commands/ContentTypeParametersCommand"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "./commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "./commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "./commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelHeaderOperationCommandInput, + EndpointWithHostLabelHeaderOperationCommandOutput, +} from "./commands/EndpointWithHostLabelHeaderOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "./commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommandInput, FlattenedXmlMapCommandOutput } from "./commands/FlattenedXmlMapCommand"; +import { + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNameCommand"; +import { + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, +} from "./commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "./commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "./commands/GreetingWithErrorsCommand"; +import { + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, +} from "./commands/HttpEmptyPrefixHeadersCommand"; +import { HttpEnumPayloadCommandInput, HttpEnumPayloadCommandOutput } from "./commands/HttpEnumPayloadCommand"; +import { HttpPayloadTraitsCommandInput, HttpPayloadTraitsCommandOutput } from "./commands/HttpPayloadTraitsCommand"; +import { + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, +} from "./commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { + HttpPayloadWithMemberXmlNameCommandInput, + HttpPayloadWithMemberXmlNameCommandOutput, +} from "./commands/HttpPayloadWithMemberXmlNameCommand"; +import { + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, +} from "./commands/HttpPayloadWithStructureCommand"; +import { + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, +} from "./commands/HttpPayloadWithUnionCommand"; +import { + HttpPayloadWithXmlNameCommandInput, + HttpPayloadWithXmlNameCommandOutput, +} from "./commands/HttpPayloadWithXmlNameCommand"; +import { + HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + HttpPayloadWithXmlNamespaceAndPrefixCommandOutput, +} from "./commands/HttpPayloadWithXmlNamespaceAndPrefixCommand"; +import { + HttpPayloadWithXmlNamespaceCommandInput, + HttpPayloadWithXmlNamespaceCommandOutput, +} from "./commands/HttpPayloadWithXmlNamespaceCommand"; +import { HttpPrefixHeadersCommandInput, HttpPrefixHeadersCommandOutput } from "./commands/HttpPrefixHeadersCommand"; +import { + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, +} from "./commands/HttpRequestWithFloatLabelsCommand"; +import { + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, +} from "./commands/HttpRequestWithGreedyLabelInPathCommand"; +import { + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, +} from "./commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, +} from "./commands/HttpRequestWithLabelsCommand"; +import { HttpResponseCodeCommandInput, HttpResponseCodeCommandOutput } from "./commands/HttpResponseCodeCommand"; +import { HttpStringPayloadCommandInput, HttpStringPayloadCommandOutput } from "./commands/HttpStringPayloadCommand"; +import { + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, +} from "./commands/IgnoreQueryParamsInResponseCommand"; +import { + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, +} from "./commands/InputAndOutputWithHeadersCommand"; +import { NestedXmlMapsCommandInput, NestedXmlMapsCommandOutput } from "./commands/NestedXmlMapsCommand"; +import { + NestedXmlMapWithXmlNameCommandInput, + NestedXmlMapWithXmlNameCommandOutput, +} from "./commands/NestedXmlMapWithXmlNameCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "./commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "./commands/NoInputAndOutputCommand"; +import { + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, +} from "./commands/NullAndEmptyHeadersClientCommand"; +import { + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, +} from "./commands/NullAndEmptyHeadersServerCommand"; +import { + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, +} from "./commands/OmitsNullSerializesEmptyStringCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "./commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "./commands/QueryIdempotencyTokenAutoFillCommand"; +import { + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, +} from "./commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommandInput, QueryPrecedenceCommandOutput } from "./commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from "./commands/RecursiveShapesCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, +} from "./commands/TimestampFormatHeadersCommand"; +import { XmlAttributesCommandInput, XmlAttributesCommandOutput } from "./commands/XmlAttributesCommand"; +import { + XmlAttributesOnPayloadCommandInput, + XmlAttributesOnPayloadCommandOutput, +} from "./commands/XmlAttributesOnPayloadCommand"; +import { XmlBlobsCommandInput, XmlBlobsCommandOutput } from "./commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommandInput, XmlEmptyBlobsCommandOutput } from "./commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommandInput, XmlEmptyListsCommandOutput } from "./commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommandInput, XmlEmptyMapsCommandOutput } from "./commands/XmlEmptyMapsCommand"; +import { XmlEmptyStringsCommandInput, XmlEmptyStringsCommandOutput } from "./commands/XmlEmptyStringsCommand"; +import { XmlEnumsCommandInput, XmlEnumsCommandOutput } from "./commands/XmlEnumsCommand"; +import { XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "./commands/XmlIntEnumsCommand"; +import { XmlListsCommandInput, XmlListsCommandOutput } from "./commands/XmlListsCommand"; +import { XmlMapsCommandInput, XmlMapsCommandOutput } from "./commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommandInput, XmlMapsXmlNameCommandOutput } from "./commands/XmlMapsXmlNameCommand"; +import { + XmlMapWithXmlNamespaceCommandInput, + XmlMapWithXmlNamespaceCommandOutput, +} from "./commands/XmlMapWithXmlNamespaceCommand"; +import { XmlNamespacesCommandInput, XmlNamespacesCommandOutput } from "./commands/XmlNamespacesCommand"; +import { XmlTimestampsCommandInput, XmlTimestampsCommandOutput } from "./commands/XmlTimestampsCommand"; +import { XmlUnionsCommandInput, XmlUnionsCommandOutput } from "./commands/XmlUnionsCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | AllQueryStringTypesCommandInput + | BodyWithXmlNameCommandInput + | ConstantAndVariableQueryStringCommandInput + | ConstantQueryStringCommandInput + | ContentTypeParametersCommandInput + | DatetimeOffsetsCommandInput + | EmptyInputAndEmptyOutputCommandInput + | EndpointOperationCommandInput + | EndpointWithHostLabelHeaderOperationCommandInput + | EndpointWithHostLabelOperationCommandInput + | FlattenedXmlMapCommandInput + | FlattenedXmlMapWithXmlNameCommandInput + | FlattenedXmlMapWithXmlNamespaceCommandInput + | FractionalSecondsCommandInput + | GreetingWithErrorsCommandInput + | HttpEmptyPrefixHeadersCommandInput + | HttpEnumPayloadCommandInput + | HttpPayloadTraitsCommandInput + | HttpPayloadTraitsWithMediaTypeCommandInput + | HttpPayloadWithMemberXmlNameCommandInput + | HttpPayloadWithStructureCommandInput + | HttpPayloadWithUnionCommandInput + | HttpPayloadWithXmlNameCommandInput + | HttpPayloadWithXmlNamespaceAndPrefixCommandInput + | HttpPayloadWithXmlNamespaceCommandInput + | HttpPrefixHeadersCommandInput + | HttpRequestWithFloatLabelsCommandInput + | HttpRequestWithGreedyLabelInPathCommandInput + | HttpRequestWithLabelsAndTimestampFormatCommandInput + | HttpRequestWithLabelsCommandInput + | HttpResponseCodeCommandInput + | HttpStringPayloadCommandInput + | IgnoreQueryParamsInResponseCommandInput + | InputAndOutputWithHeadersCommandInput + | NestedXmlMapWithXmlNameCommandInput + | NestedXmlMapsCommandInput + | NoInputAndNoOutputCommandInput + | NoInputAndOutputCommandInput + | NullAndEmptyHeadersClientCommandInput + | NullAndEmptyHeadersServerCommandInput + | OmitsNullSerializesEmptyStringCommandInput + | PutWithContentEncodingCommandInput + | QueryIdempotencyTokenAutoFillCommandInput + | QueryParamsAsStringListMapCommandInput + | QueryPrecedenceCommandInput + | RecursiveShapesCommandInput + | SimpleScalarPropertiesCommandInput + | TimestampFormatHeadersCommandInput + | XmlAttributesCommandInput + | XmlAttributesOnPayloadCommandInput + | XmlBlobsCommandInput + | XmlEmptyBlobsCommandInput + | XmlEmptyListsCommandInput + | XmlEmptyMapsCommandInput + | XmlEmptyStringsCommandInput + | XmlEnumsCommandInput + | XmlIntEnumsCommandInput + | XmlListsCommandInput + | XmlMapWithXmlNamespaceCommandInput + | XmlMapsCommandInput + | XmlMapsXmlNameCommandInput + | XmlNamespacesCommandInput + | XmlTimestampsCommandInput + | XmlUnionsCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | AllQueryStringTypesCommandOutput + | BodyWithXmlNameCommandOutput + | ConstantAndVariableQueryStringCommandOutput + | ConstantQueryStringCommandOutput + | ContentTypeParametersCommandOutput + | DatetimeOffsetsCommandOutput + | EmptyInputAndEmptyOutputCommandOutput + | EndpointOperationCommandOutput + | EndpointWithHostLabelHeaderOperationCommandOutput + | EndpointWithHostLabelOperationCommandOutput + | FlattenedXmlMapCommandOutput + | FlattenedXmlMapWithXmlNameCommandOutput + | FlattenedXmlMapWithXmlNamespaceCommandOutput + | FractionalSecondsCommandOutput + | GreetingWithErrorsCommandOutput + | HttpEmptyPrefixHeadersCommandOutput + | HttpEnumPayloadCommandOutput + | HttpPayloadTraitsCommandOutput + | HttpPayloadTraitsWithMediaTypeCommandOutput + | HttpPayloadWithMemberXmlNameCommandOutput + | HttpPayloadWithStructureCommandOutput + | HttpPayloadWithUnionCommandOutput + | HttpPayloadWithXmlNameCommandOutput + | HttpPayloadWithXmlNamespaceAndPrefixCommandOutput + | HttpPayloadWithXmlNamespaceCommandOutput + | HttpPrefixHeadersCommandOutput + | HttpRequestWithFloatLabelsCommandOutput + | HttpRequestWithGreedyLabelInPathCommandOutput + | HttpRequestWithLabelsAndTimestampFormatCommandOutput + | HttpRequestWithLabelsCommandOutput + | HttpResponseCodeCommandOutput + | HttpStringPayloadCommandOutput + | IgnoreQueryParamsInResponseCommandOutput + | InputAndOutputWithHeadersCommandOutput + | NestedXmlMapWithXmlNameCommandOutput + | NestedXmlMapsCommandOutput + | NoInputAndNoOutputCommandOutput + | NoInputAndOutputCommandOutput + | NullAndEmptyHeadersClientCommandOutput + | NullAndEmptyHeadersServerCommandOutput + | OmitsNullSerializesEmptyStringCommandOutput + | PutWithContentEncodingCommandOutput + | QueryIdempotencyTokenAutoFillCommandOutput + | QueryParamsAsStringListMapCommandOutput + | QueryPrecedenceCommandOutput + | RecursiveShapesCommandOutput + | SimpleScalarPropertiesCommandOutput + | TimestampFormatHeadersCommandOutput + | XmlAttributesCommandOutput + | XmlAttributesOnPayloadCommandOutput + | XmlBlobsCommandOutput + | XmlEmptyBlobsCommandOutput + | XmlEmptyListsCommandOutput + | XmlEmptyMapsCommandOutput + | XmlEmptyStringsCommandOutput + | XmlEnumsCommandOutput + | XmlIntEnumsCommandOutput + | XmlListsCommandOutput + | XmlMapWithXmlNamespaceCommandOutput + | XmlMapsCommandOutput + | XmlMapsXmlNameCommandOutput + | XmlNamespacesCommandOutput + | XmlTimestampsCommandOutput + | XmlUnionsCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Default credentials provider; Not available in browser runtime. + * @deprecated + * @internal + */ + credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON) + * may be overridden. A default will always be set by the client. + * Available options depend on the service's supported protocols and will not be validated by + * the client. + * @alpha + * + */ + protocol?: ClientProtocol; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type RestXmlProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + RegionInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + CompressionInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of RestXmlProtocolClient class constructor that set the region, credentials and other options. + */ +export interface RestXmlProtocolClientConfig extends RestXmlProtocolClientConfigType {} + +/** + * @public + */ +export type RestXmlProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + RegionResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + CompressionResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of RestXmlProtocolClient class. This is resolved and normalized from the {@link RestXmlProtocolClientConfig | constructor configuration interface}. + */ +export interface RestXmlProtocolClientResolvedConfig extends RestXmlProtocolClientResolvedConfigType {} + +/** + * A REST XML service that sends XML requests and responses. + * @public + */ +export class RestXmlProtocolClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + RestXmlProtocolClientResolvedConfig +> { + /** + * The resolved configuration of RestXmlProtocolClient class. This is resolved and normalized from the {@link RestXmlProtocolClientConfig | constructor configuration interface}. + */ + readonly config: RestXmlProtocolClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + super(_config_0 as any); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveRegionConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveEndpointConfig(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveCompressionConfig(_config_7); + const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []); + this.config = _config_9; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultRestXmlProtocolHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: RestXmlProtocolClientResolvedConfig) => + new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + }), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/private/aws-protocoltests-restxml-schema/src/auth/httpAuthExtensionConfiguration.ts b/private/aws-protocoltests-restxml-schema/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 0000000000000..4a16a62791bef --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,72 @@ +// smithy-typescript generated code +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types"; + +import { RestXmlProtocolHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: RestXmlProtocolHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): RestXmlProtocolHttpAuthSchemeProvider; + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void; + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: RestXmlProtocolHttpAuthSchemeProvider; + credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: RestXmlProtocolHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): RestXmlProtocolHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void { + _credentials = credentials; + }, + credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined { + return _credentials; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials(), + }; +}; diff --git a/private/aws-protocoltests-restxml-schema/src/auth/httpAuthSchemeProvider.ts b/private/aws-protocoltests-restxml-schema/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 0000000000000..41224affdbf6f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,155 @@ +// smithy-typescript generated code +import { + AwsSdkSigV4AuthInputConfig, + AwsSdkSigV4AuthResolvedConfig, + AwsSdkSigV4PreviouslyResolved, + resolveAwsSdkSigV4Config, +} from "@aws-sdk/core"; +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, + Provider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { RestXmlProtocolClientConfig, RestXmlProtocolClientResolvedConfig } from "../RestXmlProtocolClient"; + +/** + * @internal + */ +export interface RestXmlProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters { + region?: string; +} + +/** + * @internal + */ +export interface RestXmlProtocolHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + RestXmlProtocolClientResolvedConfig, + HandlerExecutionContext, + RestXmlProtocolHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultRestXmlProtocolHttpAuthSchemeParametersProvider = async ( + config: RestXmlProtocolClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + region: + (await normalizeProvider(config.region)()) || + (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })(), + }; +}; + +function createAwsAuthSigv4HttpAuthOption(authParameters: RestXmlProtocolHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "restxml", + region: authParameters.region, + }, + propertiesExtractor: (config: Partial, context) => ({ + /** + * @internal + */ + signingProperties: { + config, + context, + }, + }), + }; +} + +/** + * @internal + */ +export interface RestXmlProtocolHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultRestXmlProtocolHttpAuthSchemeProvider: RestXmlProtocolHttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + authSchemePreference?: string[] | Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: RestXmlProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + readonly authSchemePreference: Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: RestXmlProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved +): T & HttpAuthSchemeResolvedConfig => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), + }) as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/private/aws-protocoltests-restxml-schema/src/commands/AllQueryStringTypesCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/AllQueryStringTypesCommand.ts new file mode 100644 index 0000000000000..68b8e13a41a48 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/AllQueryStringTypesCommand.ts @@ -0,0 +1,126 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { AllQueryStringTypesInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { AllQueryStringTypes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link AllQueryStringTypesCommand}. + */ +export interface AllQueryStringTypesCommandInput extends AllQueryStringTypesInput {} +/** + * @public + * + * The output of {@link AllQueryStringTypesCommand}. + */ +export interface AllQueryStringTypesCommandOutput extends __MetadataBearer {} + +/** + * This example uses all query string types. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, AllQueryStringTypesCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, AllQueryStringTypesCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // AllQueryStringTypesInput + * queryString: "STRING_VALUE", + * queryStringList: [ // StringList + * "STRING_VALUE", + * ], + * queryStringSet: [ // StringSet + * "STRING_VALUE", + * ], + * queryByte: 0, // BYTE_VALUE + * queryShort: Number("short"), + * queryInteger: Number("int"), + * queryIntegerList: [ // IntegerList + * Number("int"), + * ], + * queryIntegerSet: [ // IntegerSet + * Number("int"), + * ], + * queryLong: Number("long"), + * queryFloat: Number("float"), + * queryDouble: Number("double"), + * queryDoubleList: [ // DoubleList + * Number("double"), + * ], + * queryBoolean: true || false, + * queryBooleanList: [ // BooleanList + * true || false, + * ], + * queryTimestamp: new Date("TIMESTAMP"), + * queryTimestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * queryEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * queryEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * queryIntegerEnum: 1 || 2 || 3, + * queryIntegerEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * queryParamsMapOfStrings: { // StringMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new AllQueryStringTypesCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param AllQueryStringTypesCommandInput - {@link AllQueryStringTypesCommandInput} + * @returns {@link AllQueryStringTypesCommandOutput} + * @see {@link AllQueryStringTypesCommandInput} for command's `input` shape. + * @see {@link AllQueryStringTypesCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class AllQueryStringTypesCommand extends $Command + .classBuilder< + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "AllQueryStringTypes", {}) + .n("RestXmlProtocolClient", "AllQueryStringTypesCommand") + .f(void 0, void 0) + .sc(AllQueryStringTypes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: AllQueryStringTypesInput; + output: {}; + }; + sdk: { + input: AllQueryStringTypesCommandInput; + output: AllQueryStringTypesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/BodyWithXmlNameCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/BodyWithXmlNameCommand.ts new file mode 100644 index 0000000000000..aca8f1ec47a67 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/BodyWithXmlNameCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { BodyWithXmlNameInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { BodyWithXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link BodyWithXmlNameCommand}. + */ +export interface BodyWithXmlNameCommandInput extends BodyWithXmlNameInputOutput {} +/** + * @public + * + * The output of {@link BodyWithXmlNameCommand}. + */ +export interface BodyWithXmlNameCommandOutput extends BodyWithXmlNameInputOutput, __MetadataBearer {} + +/** + * The following example serializes a body that uses an XML name, + * changing the wrapper name. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, BodyWithXmlNameCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, BodyWithXmlNameCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // BodyWithXmlNameInputOutput + * nested: { // PayloadWithXmlName + * name: "STRING_VALUE", + * }, + * }; + * const command = new BodyWithXmlNameCommand(input); + * const response = await client.send(command); + * // { // BodyWithXmlNameInputOutput + * // nested: { // PayloadWithXmlName + * // name: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param BodyWithXmlNameCommandInput - {@link BodyWithXmlNameCommandInput} + * @returns {@link BodyWithXmlNameCommandOutput} + * @see {@link BodyWithXmlNameCommandInput} for command's `input` shape. + * @see {@link BodyWithXmlNameCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class BodyWithXmlNameCommand extends $Command + .classBuilder< + BodyWithXmlNameCommandInput, + BodyWithXmlNameCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "BodyWithXmlName", {}) + .n("RestXmlProtocolClient", "BodyWithXmlNameCommand") + .f(void 0, void 0) + .sc(BodyWithXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: BodyWithXmlNameInputOutput; + output: BodyWithXmlNameInputOutput; + }; + sdk: { + input: BodyWithXmlNameCommandInput; + output: BodyWithXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/ConstantAndVariableQueryStringCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/ConstantAndVariableQueryStringCommand.ts new file mode 100644 index 0000000000000..777e641c5853e --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/ConstantAndVariableQueryStringCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ConstantAndVariableQueryStringInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { ConstantAndVariableQueryString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ConstantAndVariableQueryStringCommand}. + */ +export interface ConstantAndVariableQueryStringCommandInput extends ConstantAndVariableQueryStringInput {} +/** + * @public + * + * The output of {@link ConstantAndVariableQueryStringCommand}. + */ +export interface ConstantAndVariableQueryStringCommandOutput extends __MetadataBearer {} + +/** + * This example uses fixed query string params and variable query string params. + * The fixed query string parameters and variable parameters must both be + * serialized (implementations may need to merge them together). + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, ConstantAndVariableQueryStringCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, ConstantAndVariableQueryStringCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // ConstantAndVariableQueryStringInput + * baz: "STRING_VALUE", + * maybeSet: "STRING_VALUE", + * }; + * const command = new ConstantAndVariableQueryStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ConstantAndVariableQueryStringCommandInput - {@link ConstantAndVariableQueryStringCommandInput} + * @returns {@link ConstantAndVariableQueryStringCommandOutput} + * @see {@link ConstantAndVariableQueryStringCommandInput} for command's `input` shape. + * @see {@link ConstantAndVariableQueryStringCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class ConstantAndVariableQueryStringCommand extends $Command + .classBuilder< + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "ConstantAndVariableQueryString", {}) + .n("RestXmlProtocolClient", "ConstantAndVariableQueryStringCommand") + .f(void 0, void 0) + .sc(ConstantAndVariableQueryString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ConstantAndVariableQueryStringInput; + output: {}; + }; + sdk: { + input: ConstantAndVariableQueryStringCommandInput; + output: ConstantAndVariableQueryStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/ConstantQueryStringCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/ConstantQueryStringCommand.ts new file mode 100644 index 0000000000000..c02f17671b263 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/ConstantQueryStringCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ConstantQueryStringInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { ConstantQueryString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ConstantQueryStringCommand}. + */ +export interface ConstantQueryStringCommandInput extends ConstantQueryStringInput {} +/** + * @public + * + * The output of {@link ConstantQueryStringCommand}. + */ +export interface ConstantQueryStringCommandOutput extends __MetadataBearer {} + +/** + * This example uses a constant query string parameters and a label. + * This simply tests that labels and query string parameters are + * compatible. The fixed query string parameter named "hello" should + * in no way conflict with the label, `\{hello\}`. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, ConstantQueryStringCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, ConstantQueryStringCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // ConstantQueryStringInput + * hello: "STRING_VALUE", // required + * }; + * const command = new ConstantQueryStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ConstantQueryStringCommandInput - {@link ConstantQueryStringCommandInput} + * @returns {@link ConstantQueryStringCommandOutput} + * @see {@link ConstantQueryStringCommandInput} for command's `input` shape. + * @see {@link ConstantQueryStringCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class ConstantQueryStringCommand extends $Command + .classBuilder< + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "ConstantQueryString", {}) + .n("RestXmlProtocolClient", "ConstantQueryStringCommand") + .f(void 0, void 0) + .sc(ConstantQueryString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ConstantQueryStringInput; + output: {}; + }; + sdk: { + input: ConstantQueryStringCommandInput; + output: ConstantQueryStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/ContentTypeParametersCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/ContentTypeParametersCommand.ts new file mode 100644 index 0000000000000..54fb6108e87bc --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/ContentTypeParametersCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ContentTypeParametersInput, ContentTypeParametersOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { ContentTypeParameters } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandInput extends ContentTypeParametersInput {} +/** + * @public + * + * The output of {@link ContentTypeParametersCommand}. + */ +export interface ContentTypeParametersCommandOutput extends ContentTypeParametersOutput, __MetadataBearer {} + +/** + * The example tests how servers must support requests + * containing a `Content-Type` header with parameters. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, ContentTypeParametersCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, ContentTypeParametersCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // ContentTypeParametersInput + * value: Number("int"), + * }; + * const command = new ContentTypeParametersCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param ContentTypeParametersCommandInput - {@link ContentTypeParametersCommandInput} + * @returns {@link ContentTypeParametersCommandOutput} + * @see {@link ContentTypeParametersCommandInput} for command's `input` shape. + * @see {@link ContentTypeParametersCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class ContentTypeParametersCommand extends $Command + .classBuilder< + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "ContentTypeParameters", {}) + .n("RestXmlProtocolClient", "ContentTypeParametersCommand") + .f(void 0, void 0) + .sc(ContentTypeParameters) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ContentTypeParametersInput; + output: {}; + }; + sdk: { + input: ContentTypeParametersCommandInput; + output: ContentTypeParametersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/DatetimeOffsetsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/DatetimeOffsetsCommand.ts new file mode 100644 index 0000000000000..f932ebc8259a0 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/DatetimeOffsetsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DatetimeOffsetsOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { DatetimeOffsets } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandInput {} +/** + * @public + * + * The output of {@link DatetimeOffsetsCommand}. + */ +export interface DatetimeOffsetsCommandOutput extends DatetimeOffsetsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, DatetimeOffsetsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, DatetimeOffsetsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new DatetimeOffsetsCommand(input); + * const response = await client.send(command); + * // { // DatetimeOffsetsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param DatetimeOffsetsCommandInput - {@link DatetimeOffsetsCommandInput} + * @returns {@link DatetimeOffsetsCommandOutput} + * @see {@link DatetimeOffsetsCommandInput} for command's `input` shape. + * @see {@link DatetimeOffsetsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class DatetimeOffsetsCommand extends $Command + .classBuilder< + DatetimeOffsetsCommandInput, + DatetimeOffsetsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "DatetimeOffsets", {}) + .n("RestXmlProtocolClient", "DatetimeOffsetsCommand") + .f(void 0, void 0) + .sc(DatetimeOffsets) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: DatetimeOffsetsOutput; + }; + sdk: { + input: DatetimeOffsetsCommandInput; + output: DatetimeOffsetsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts new file mode 100644 index 0000000000000..4c54c71ad03a9 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/EmptyInputAndEmptyOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { EmptyInputAndEmptyOutputInput, EmptyInputAndEmptyOutputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { EmptyInputAndEmptyOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandInput extends EmptyInputAndEmptyOutputInput {} +/** + * @public + * + * The output of {@link EmptyInputAndEmptyOutputCommand}. + */ +export interface EmptyInputAndEmptyOutputCommandOutput extends EmptyInputAndEmptyOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has an empty input + * and empty output structure that reuses the same shape. While this should + * be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, EmptyInputAndEmptyOutputCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, EmptyInputAndEmptyOutputCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new EmptyInputAndEmptyOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EmptyInputAndEmptyOutputCommandInput - {@link EmptyInputAndEmptyOutputCommandInput} + * @returns {@link EmptyInputAndEmptyOutputCommandOutput} + * @see {@link EmptyInputAndEmptyOutputCommandInput} for command's `input` shape. + * @see {@link EmptyInputAndEmptyOutputCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class EmptyInputAndEmptyOutputCommand extends $Command + .classBuilder< + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "EmptyInputAndEmptyOutput", {}) + .n("RestXmlProtocolClient", "EmptyInputAndEmptyOutputCommand") + .f(void 0, void 0) + .sc(EmptyInputAndEmptyOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EmptyInputAndEmptyOutputCommandInput; + output: EmptyInputAndEmptyOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/EndpointOperationCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/EndpointOperationCommand.ts new file mode 100644 index 0000000000000..97002737e042f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/EndpointOperationCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { EndpointOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandInput {} +/** + * @public + * + * The output of {@link EndpointOperationCommand}. + */ +export interface EndpointOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, EndpointOperationCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, EndpointOperationCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new EndpointOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointOperationCommandInput - {@link EndpointOperationCommandInput} + * @returns {@link EndpointOperationCommandOutput} + * @see {@link EndpointOperationCommandInput} for command's `input` shape. + * @see {@link EndpointOperationCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class EndpointOperationCommand extends $Command + .classBuilder< + EndpointOperationCommandInput, + EndpointOperationCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "EndpointOperation", {}) + .n("RestXmlProtocolClient", "EndpointOperationCommand") + .f(void 0, void 0) + .sc(EndpointOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EndpointOperationCommandInput; + output: EndpointOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/EndpointWithHostLabelHeaderOperationCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/EndpointWithHostLabelHeaderOperationCommand.ts new file mode 100644 index 0000000000000..ba1b59c231e26 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/EndpointWithHostLabelHeaderOperationCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HostLabelHeaderInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { EndpointWithHostLabelHeaderOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointWithHostLabelHeaderOperationCommand}. + */ +export interface EndpointWithHostLabelHeaderOperationCommandInput extends HostLabelHeaderInput {} +/** + * @public + * + * The output of {@link EndpointWithHostLabelHeaderOperationCommand}. + */ +export interface EndpointWithHostLabelHeaderOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, EndpointWithHostLabelHeaderOperationCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, EndpointWithHostLabelHeaderOperationCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HostLabelHeaderInput + * accountId: "STRING_VALUE", // required + * }; + * const command = new EndpointWithHostLabelHeaderOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointWithHostLabelHeaderOperationCommandInput - {@link EndpointWithHostLabelHeaderOperationCommandInput} + * @returns {@link EndpointWithHostLabelHeaderOperationCommandOutput} + * @see {@link EndpointWithHostLabelHeaderOperationCommandInput} for command's `input` shape. + * @see {@link EndpointWithHostLabelHeaderOperationCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class EndpointWithHostLabelHeaderOperationCommand extends $Command + .classBuilder< + EndpointWithHostLabelHeaderOperationCommandInput, + EndpointWithHostLabelHeaderOperationCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "EndpointWithHostLabelHeaderOperation", {}) + .n("RestXmlProtocolClient", "EndpointWithHostLabelHeaderOperationCommand") + .f(void 0, void 0) + .sc(EndpointWithHostLabelHeaderOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HostLabelHeaderInput; + output: {}; + }; + sdk: { + input: EndpointWithHostLabelHeaderOperationCommandInput; + output: EndpointWithHostLabelHeaderOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/EndpointWithHostLabelOperationCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/EndpointWithHostLabelOperationCommand.ts new file mode 100644 index 0000000000000..0dd43fe70327e --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/EndpointWithHostLabelOperationCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { EndpointWithHostLabelOperationRequest } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { EndpointWithHostLabelOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandInput extends EndpointWithHostLabelOperationRequest {} +/** + * @public + * + * The output of {@link EndpointWithHostLabelOperationCommand}. + */ +export interface EndpointWithHostLabelOperationCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, EndpointWithHostLabelOperationCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, EndpointWithHostLabelOperationCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // EndpointWithHostLabelOperationRequest + * label: "STRING_VALUE", // required + * }; + * const command = new EndpointWithHostLabelOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EndpointWithHostLabelOperationCommandInput - {@link EndpointWithHostLabelOperationCommandInput} + * @returns {@link EndpointWithHostLabelOperationCommandOutput} + * @see {@link EndpointWithHostLabelOperationCommandInput} for command's `input` shape. + * @see {@link EndpointWithHostLabelOperationCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class EndpointWithHostLabelOperationCommand extends $Command + .classBuilder< + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "EndpointWithHostLabelOperation", {}) + .n("RestXmlProtocolClient", "EndpointWithHostLabelOperationCommand") + .f(void 0, void 0) + .sc(EndpointWithHostLabelOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: EndpointWithHostLabelOperationRequest; + output: {}; + }; + sdk: { + input: EndpointWithHostLabelOperationCommandInput; + output: EndpointWithHostLabelOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapCommand.ts new file mode 100644 index 0000000000000..4f12bb1835602 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FlattenedXmlMapRequest, FlattenedXmlMapResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { FlattenedXmlMap } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FlattenedXmlMapCommand}. + */ +export interface FlattenedXmlMapCommandInput extends FlattenedXmlMapRequest {} +/** + * @public + * + * The output of {@link FlattenedXmlMapCommand}. + */ +export interface FlattenedXmlMapCommandOutput extends FlattenedXmlMapResponse, __MetadataBearer {} + +/** + * Flattened maps + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, FlattenedXmlMapCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, FlattenedXmlMapCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // FlattenedXmlMapRequest + * myMap: { // FooEnumMap + * "": "Foo" || "Baz" || "Bar" || "1" || "0", + * }, + * }; + * const command = new FlattenedXmlMapCommand(input); + * const response = await client.send(command); + * // { // FlattenedXmlMapResponse + * // myMap: { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }; + * + * ``` + * + * @param FlattenedXmlMapCommandInput - {@link FlattenedXmlMapCommandInput} + * @returns {@link FlattenedXmlMapCommandOutput} + * @see {@link FlattenedXmlMapCommandInput} for command's `input` shape. + * @see {@link FlattenedXmlMapCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class FlattenedXmlMapCommand extends $Command + .classBuilder< + FlattenedXmlMapCommandInput, + FlattenedXmlMapCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "FlattenedXmlMap", {}) + .n("RestXmlProtocolClient", "FlattenedXmlMapCommand") + .f(void 0, void 0) + .sc(FlattenedXmlMap) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: FlattenedXmlMapRequest; + output: FlattenedXmlMapResponse; + }; + sdk: { + input: FlattenedXmlMapCommandInput; + output: FlattenedXmlMapCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapWithXmlNameCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapWithXmlNameCommand.ts new file mode 100644 index 0000000000000..48ed02ac6077d --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapWithXmlNameCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FlattenedXmlMapWithXmlNameRequest, FlattenedXmlMapWithXmlNameResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { FlattenedXmlMapWithXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FlattenedXmlMapWithXmlNameCommand}. + */ +export interface FlattenedXmlMapWithXmlNameCommandInput extends FlattenedXmlMapWithXmlNameRequest {} +/** + * @public + * + * The output of {@link FlattenedXmlMapWithXmlNameCommand}. + */ +export interface FlattenedXmlMapWithXmlNameCommandOutput extends FlattenedXmlMapWithXmlNameResponse, __MetadataBearer {} + +/** + * Flattened maps with @xmlName + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, FlattenedXmlMapWithXmlNameCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, FlattenedXmlMapWithXmlNameCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // FlattenedXmlMapWithXmlNameRequest + * myMap: { // FlattenedXmlMapWithXmlNameInputOutputMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new FlattenedXmlMapWithXmlNameCommand(input); + * const response = await client.send(command); + * // { // FlattenedXmlMapWithXmlNameResponse + * // myMap: { // FlattenedXmlMapWithXmlNameInputOutputMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param FlattenedXmlMapWithXmlNameCommandInput - {@link FlattenedXmlMapWithXmlNameCommandInput} + * @returns {@link FlattenedXmlMapWithXmlNameCommandOutput} + * @see {@link FlattenedXmlMapWithXmlNameCommandInput} for command's `input` shape. + * @see {@link FlattenedXmlMapWithXmlNameCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class FlattenedXmlMapWithXmlNameCommand extends $Command + .classBuilder< + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "FlattenedXmlMapWithXmlName", {}) + .n("RestXmlProtocolClient", "FlattenedXmlMapWithXmlNameCommand") + .f(void 0, void 0) + .sc(FlattenedXmlMapWithXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: FlattenedXmlMapWithXmlNameRequest; + output: FlattenedXmlMapWithXmlNameResponse; + }; + sdk: { + input: FlattenedXmlMapWithXmlNameCommandInput; + output: FlattenedXmlMapWithXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts new file mode 100644 index 0000000000000..69b7e3ac9f977 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FlattenedXmlMapWithXmlNamespaceOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { FlattenedXmlMapWithXmlNamespace } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FlattenedXmlMapWithXmlNamespaceCommand}. + */ +export interface FlattenedXmlMapWithXmlNamespaceCommandInput {} +/** + * @public + * + * The output of {@link FlattenedXmlMapWithXmlNamespaceCommand}. + */ +export interface FlattenedXmlMapWithXmlNamespaceCommandOutput + extends FlattenedXmlMapWithXmlNamespaceOutput, + __MetadataBearer {} + +/** + * Flattened maps with @xmlNamespace and @xmlName + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, FlattenedXmlMapWithXmlNamespaceCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, FlattenedXmlMapWithXmlNamespaceCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new FlattenedXmlMapWithXmlNamespaceCommand(input); + * const response = await client.send(command); + * // { // FlattenedXmlMapWithXmlNamespaceOutput + * // myMap: { // FlattenedXmlMapWithXmlNamespaceOutputMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param FlattenedXmlMapWithXmlNamespaceCommandInput - {@link FlattenedXmlMapWithXmlNamespaceCommandInput} + * @returns {@link FlattenedXmlMapWithXmlNamespaceCommandOutput} + * @see {@link FlattenedXmlMapWithXmlNamespaceCommandInput} for command's `input` shape. + * @see {@link FlattenedXmlMapWithXmlNamespaceCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class FlattenedXmlMapWithXmlNamespaceCommand extends $Command + .classBuilder< + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "FlattenedXmlMapWithXmlNamespace", {}) + .n("RestXmlProtocolClient", "FlattenedXmlMapWithXmlNamespaceCommand") + .f(void 0, void 0) + .sc(FlattenedXmlMapWithXmlNamespace) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FlattenedXmlMapWithXmlNamespaceOutput; + }; + sdk: { + input: FlattenedXmlMapWithXmlNamespaceCommandInput; + output: FlattenedXmlMapWithXmlNamespaceCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/FractionalSecondsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/FractionalSecondsCommand.ts new file mode 100644 index 0000000000000..f4c4c74d555d4 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/FractionalSecondsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FractionalSecondsOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { FractionalSeconds } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandInput {} +/** + * @public + * + * The output of {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, FractionalSecondsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, FractionalSecondsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new FractionalSecondsCommand(input); + * const response = await client.send(command); + * // { // FractionalSecondsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput} + * @returns {@link FractionalSecondsCommandOutput} + * @see {@link FractionalSecondsCommandInput} for command's `input` shape. + * @see {@link FractionalSecondsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class FractionalSecondsCommand extends $Command + .classBuilder< + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "FractionalSeconds", {}) + .n("RestXmlProtocolClient", "FractionalSecondsCommand") + .f(void 0, void 0) + .sc(FractionalSeconds) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FractionalSecondsOutput; + }; + sdk: { + input: FractionalSecondsCommandInput; + output: FractionalSecondsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/GreetingWithErrorsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/GreetingWithErrorsCommand.ts new file mode 100644 index 0000000000000..6ba61d92c5266 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/GreetingWithErrorsCommand.ts @@ -0,0 +1,100 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { GreetingWithErrorsOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { GreetingWithErrors } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandInput {} +/** + * @public + * + * The output of {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {} + +/** + * This operation has three possible return values: + * + * 1. A successful response in the form of GreetingWithErrorsOutput + * 2. An InvalidGreeting error. + * 3. A BadRequest error. + * + * Implementations must be able to successfully take a response and + * properly (de)serialize successful and error responses based on the + * the presence of the + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, GreetingWithErrorsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, GreetingWithErrorsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new GreetingWithErrorsCommand(input); + * const response = await client.send(command); + * // { // GreetingWithErrorsOutput + * // greeting: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput} + * @returns {@link GreetingWithErrorsCommandOutput} + * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape. + * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link InvalidGreeting} (client fault) + * This error is thrown when an invalid greeting value is provided. + * + * @throws {@link ComplexError} (client fault) + * This error is thrown when a request is invalid. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class GreetingWithErrorsCommand extends $Command + .classBuilder< + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "GreetingWithErrors", {}) + .n("RestXmlProtocolClient", "GreetingWithErrorsCommand") + .f(void 0, void 0) + .sc(GreetingWithErrors) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: GreetingWithErrorsOutput; + }; + sdk: { + input: GreetingWithErrorsCommandInput; + output: GreetingWithErrorsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpEmptyPrefixHeadersCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpEmptyPrefixHeadersCommand.ts new file mode 100644 index 0000000000000..53d927841a27c --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpEmptyPrefixHeadersCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpEmptyPrefixHeadersInput, HttpEmptyPrefixHeadersOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpEmptyPrefixHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpEmptyPrefixHeadersCommand}. + */ +export interface HttpEmptyPrefixHeadersCommandInput extends HttpEmptyPrefixHeadersInput {} +/** + * @public + * + * The output of {@link HttpEmptyPrefixHeadersCommand}. + */ +export interface HttpEmptyPrefixHeadersCommandOutput extends HttpEmptyPrefixHeadersOutput, __MetadataBearer {} + +/** + * Clients that perform this test extract all headers from the response. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpEmptyPrefixHeadersCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpEmptyPrefixHeadersCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpEmptyPrefixHeadersInput + * prefixHeaders: { // StringMap + * "": "STRING_VALUE", + * }, + * specificHeader: "STRING_VALUE", + * }; + * const command = new HttpEmptyPrefixHeadersCommand(input); + * const response = await client.send(command); + * // { // HttpEmptyPrefixHeadersOutput + * // prefixHeaders: { // StringMap + * // "": "STRING_VALUE", + * // }, + * // specificHeader: "STRING_VALUE", + * // }; + * + * ``` + * + * @param HttpEmptyPrefixHeadersCommandInput - {@link HttpEmptyPrefixHeadersCommandInput} + * @returns {@link HttpEmptyPrefixHeadersCommandOutput} + * @see {@link HttpEmptyPrefixHeadersCommandInput} for command's `input` shape. + * @see {@link HttpEmptyPrefixHeadersCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpEmptyPrefixHeadersCommand extends $Command + .classBuilder< + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpEmptyPrefixHeaders", {}) + .n("RestXmlProtocolClient", "HttpEmptyPrefixHeadersCommand") + .f(void 0, void 0) + .sc(HttpEmptyPrefixHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpEmptyPrefixHeadersInput; + output: HttpEmptyPrefixHeadersOutput; + }; + sdk: { + input: HttpEmptyPrefixHeadersCommandInput; + output: HttpEmptyPrefixHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpEnumPayloadCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpEnumPayloadCommand.ts new file mode 100644 index 0000000000000..2e0a99c5ae052 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpEnumPayloadCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { EnumPayloadInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpEnumPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpEnumPayloadCommand}. + */ +export interface HttpEnumPayloadCommandInput extends EnumPayloadInput {} +/** + * @public + * + * The output of {@link HttpEnumPayloadCommand}. + */ +export interface HttpEnumPayloadCommandOutput extends EnumPayloadInput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpEnumPayloadCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpEnumPayloadCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // EnumPayloadInput + * payload: "enumvalue", + * }; + * const command = new HttpEnumPayloadCommand(input); + * const response = await client.send(command); + * // { // EnumPayloadInput + * // payload: "enumvalue", + * // }; + * + * ``` + * + * @param HttpEnumPayloadCommandInput - {@link HttpEnumPayloadCommandInput} + * @returns {@link HttpEnumPayloadCommandOutput} + * @see {@link HttpEnumPayloadCommandInput} for command's `input` shape. + * @see {@link HttpEnumPayloadCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class HttpEnumPayloadCommand extends $Command + .classBuilder< + HttpEnumPayloadCommandInput, + HttpEnumPayloadCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpEnumPayload", {}) + .n("RestXmlProtocolClient", "HttpEnumPayloadCommand") + .f(void 0, void 0) + .sc(HttpEnumPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: EnumPayloadInput; + output: EnumPayloadInput; + }; + sdk: { + input: HttpEnumPayloadCommandInput; + output: HttpEnumPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadTraitsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadTraitsCommand.ts new file mode 100644 index 0000000000000..2717ca3df7046 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadTraitsCommand.ts @@ -0,0 +1,108 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { BlobPayloadInputTypes, MetadataBearer as __MetadataBearer } from "@smithy/types"; +import { Uint8ArrayBlobAdapter } from "@smithy/util-stream"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadTraitsInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadTraits } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + */ +export type HttpPayloadTraitsCommandInputType = Omit & { + blob?: BlobPayloadInputTypes; +}; + +/** + * @public + * + * The input for {@link HttpPayloadTraitsCommand}. + */ +export interface HttpPayloadTraitsCommandInput extends HttpPayloadTraitsCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsCommandOutputType = Omit & { + blob?: Uint8ArrayBlobAdapter; +}; + +/** + * @public + * + * The output of {@link HttpPayloadTraitsCommand}. + */ +export interface HttpPayloadTraitsCommandOutput extends HttpPayloadTraitsCommandOutputType, __MetadataBearer {} + +/** + * This example serializes a blob shape in the payload. + * + * In this example, no XML document is synthesized because the payload is + * not a structure or a union type. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadTraitsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadTraitsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadTraitsInputOutput + * foo: "STRING_VALUE", + * blob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new HttpPayloadTraitsCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadTraitsInputOutput + * // foo: "STRING_VALUE", + * // blob: new Uint8Array(), + * // }; + * + * ``` + * + * @param HttpPayloadTraitsCommandInput - {@link HttpPayloadTraitsCommandInput} + * @returns {@link HttpPayloadTraitsCommandOutput} + * @see {@link HttpPayloadTraitsCommandInput} for command's `input` shape. + * @see {@link HttpPayloadTraitsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadTraitsCommand extends $Command + .classBuilder< + HttpPayloadTraitsCommandInput, + HttpPayloadTraitsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadTraits", {}) + .n("RestXmlProtocolClient", "HttpPayloadTraitsCommand") + .f(void 0, void 0) + .sc(HttpPayloadTraits) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadTraitsInputOutput; + output: HttpPayloadTraitsInputOutput; + }; + sdk: { + input: HttpPayloadTraitsCommandInput; + output: HttpPayloadTraitsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts new file mode 100644 index 0000000000000..1f14e36e70279 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts @@ -0,0 +1,111 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { BlobPayloadInputTypes, MetadataBearer as __MetadataBearer } from "@smithy/types"; +import { Uint8ArrayBlobAdapter } from "@smithy/util-stream"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadTraitsWithMediaTypeInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadTraitsWithMediaType } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandInputType = Omit & { + blob?: BlobPayloadInputTypes; +}; + +/** + * @public + * + * The input for {@link HttpPayloadTraitsWithMediaTypeCommand}. + */ +export interface HttpPayloadTraitsWithMediaTypeCommandInput extends HttpPayloadTraitsWithMediaTypeCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandOutputType = Omit< + HttpPayloadTraitsWithMediaTypeInputOutput, + "blob" +> & { + blob?: Uint8ArrayBlobAdapter; +}; + +/** + * @public + * + * The output of {@link HttpPayloadTraitsWithMediaTypeCommand}. + */ +export interface HttpPayloadTraitsWithMediaTypeCommandOutput + extends HttpPayloadTraitsWithMediaTypeCommandOutputType, + __MetadataBearer {} + +/** + * This example uses a `@mediaType` trait on the payload to force a custom + * content-type to be serialized. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadTraitsWithMediaTypeCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadTraitsWithMediaTypeCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadTraitsWithMediaTypeInputOutput + * foo: "STRING_VALUE", + * blob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new HttpPayloadTraitsWithMediaTypeCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadTraitsWithMediaTypeInputOutput + * // foo: "STRING_VALUE", + * // blob: new Uint8Array(), + * // }; + * + * ``` + * + * @param HttpPayloadTraitsWithMediaTypeCommandInput - {@link HttpPayloadTraitsWithMediaTypeCommandInput} + * @returns {@link HttpPayloadTraitsWithMediaTypeCommandOutput} + * @see {@link HttpPayloadTraitsWithMediaTypeCommandInput} for command's `input` shape. + * @see {@link HttpPayloadTraitsWithMediaTypeCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadTraitsWithMediaTypeCommand extends $Command + .classBuilder< + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadTraitsWithMediaType", {}) + .n("RestXmlProtocolClient", "HttpPayloadTraitsWithMediaTypeCommand") + .f(void 0, void 0) + .sc(HttpPayloadTraitsWithMediaType) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadTraitsWithMediaTypeInputOutput; + output: HttpPayloadTraitsWithMediaTypeInputOutput; + }; + sdk: { + input: HttpPayloadTraitsWithMediaTypeCommandInput; + output: HttpPayloadTraitsWithMediaTypeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithMemberXmlNameCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithMemberXmlNameCommand.ts new file mode 100644 index 0000000000000..7fda9d799291c --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithMemberXmlNameCommand.ts @@ -0,0 +1,95 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithMemberXmlNameInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadWithMemberXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithMemberXmlNameCommand}. + */ +export interface HttpPayloadWithMemberXmlNameCommandInput extends HttpPayloadWithMemberXmlNameInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithMemberXmlNameCommand}. + */ +export interface HttpPayloadWithMemberXmlNameCommandOutput + extends HttpPayloadWithMemberXmlNameInputOutput, + __MetadataBearer {} + +/** + * The following example serializes a payload that uses an XML name + * on the member, changing the wrapper name. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadWithMemberXmlNameCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadWithMemberXmlNameCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadWithMemberXmlNameInputOutput + * nested: { // PayloadWithXmlName + * name: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithMemberXmlNameCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithMemberXmlNameInputOutput + * // nested: { // PayloadWithXmlName + * // name: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithMemberXmlNameCommandInput - {@link HttpPayloadWithMemberXmlNameCommandInput} + * @returns {@link HttpPayloadWithMemberXmlNameCommandOutput} + * @see {@link HttpPayloadWithMemberXmlNameCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithMemberXmlNameCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadWithMemberXmlNameCommand extends $Command + .classBuilder< + HttpPayloadWithMemberXmlNameCommandInput, + HttpPayloadWithMemberXmlNameCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadWithMemberXmlName", {}) + .n("RestXmlProtocolClient", "HttpPayloadWithMemberXmlNameCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithMemberXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithMemberXmlNameInputOutput; + output: HttpPayloadWithMemberXmlNameInputOutput; + }; + sdk: { + input: HttpPayloadWithMemberXmlNameCommandInput; + output: HttpPayloadWithMemberXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithStructureCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithStructureCommand.ts new file mode 100644 index 0000000000000..c37b074694c90 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithStructureCommand.ts @@ -0,0 +1,97 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithStructureInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadWithStructure } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithStructureCommand}. + */ +export interface HttpPayloadWithStructureCommandInput extends HttpPayloadWithStructureInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithStructureCommand}. + */ +export interface HttpPayloadWithStructureCommandOutput extends HttpPayloadWithStructureInputOutput, __MetadataBearer {} + +/** + * This example serializes a structure in the payload. + * + * Note that serializing a structure changes the wrapper element name + * to match the targeted structure. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadWithStructureCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadWithStructureCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadWithStructureInputOutput + * nested: { // NestedPayload + * greeting: "STRING_VALUE", + * name: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithStructureCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithStructureInputOutput + * // nested: { // NestedPayload + * // greeting: "STRING_VALUE", + * // name: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithStructureCommandInput - {@link HttpPayloadWithStructureCommandInput} + * @returns {@link HttpPayloadWithStructureCommandOutput} + * @see {@link HttpPayloadWithStructureCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithStructureCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadWithStructureCommand extends $Command + .classBuilder< + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadWithStructure", {}) + .n("RestXmlProtocolClient", "HttpPayloadWithStructureCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithStructure) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithStructureInputOutput; + output: HttpPayloadWithStructureInputOutput; + }; + sdk: { + input: HttpPayloadWithStructureCommandInput; + output: HttpPayloadWithStructureCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithUnionCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithUnionCommand.ts new file mode 100644 index 0000000000000..2df786371d790 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithUnionCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithUnionInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadWithUnion } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithUnionCommand}. + */ +export interface HttpPayloadWithUnionCommandInput extends HttpPayloadWithUnionInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithUnionCommand}. + */ +export interface HttpPayloadWithUnionCommandOutput extends HttpPayloadWithUnionInputOutput, __MetadataBearer {} + +/** + * This example serializes a union in the payload. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadWithUnionCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadWithUnionCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadWithUnionInputOutput + * nested: { // UnionPayload Union: only one key present + * greeting: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithUnionCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithUnionInputOutput + * // nested: { // UnionPayload Union: only one key present + * // greeting: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithUnionCommandInput - {@link HttpPayloadWithUnionCommandInput} + * @returns {@link HttpPayloadWithUnionCommandOutput} + * @see {@link HttpPayloadWithUnionCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithUnionCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadWithUnionCommand extends $Command + .classBuilder< + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadWithUnion", {}) + .n("RestXmlProtocolClient", "HttpPayloadWithUnionCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithUnion) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithUnionInputOutput; + output: HttpPayloadWithUnionInputOutput; + }; + sdk: { + input: HttpPayloadWithUnionCommandInput; + output: HttpPayloadWithUnionCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNameCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNameCommand.ts new file mode 100644 index 0000000000000..735cfcfe8d49f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNameCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithXmlNameInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadWithXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithXmlNameCommand}. + */ +export interface HttpPayloadWithXmlNameCommandInput extends HttpPayloadWithXmlNameInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithXmlNameCommand}. + */ +export interface HttpPayloadWithXmlNameCommandOutput extends HttpPayloadWithXmlNameInputOutput, __MetadataBearer {} + +/** + * The following example serializes a payload that uses an XML name, + * changing the wrapper name. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadWithXmlNameCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadWithXmlNameCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadWithXmlNameInputOutput + * nested: { // PayloadWithXmlName + * name: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithXmlNameCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithXmlNameInputOutput + * // nested: { // PayloadWithXmlName + * // name: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithXmlNameCommandInput - {@link HttpPayloadWithXmlNameCommandInput} + * @returns {@link HttpPayloadWithXmlNameCommandOutput} + * @see {@link HttpPayloadWithXmlNameCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithXmlNameCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadWithXmlNameCommand extends $Command + .classBuilder< + HttpPayloadWithXmlNameCommandInput, + HttpPayloadWithXmlNameCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadWithXmlName", {}) + .n("RestXmlProtocolClient", "HttpPayloadWithXmlNameCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithXmlNameInputOutput; + output: HttpPayloadWithXmlNameInputOutput; + }; + sdk: { + input: HttpPayloadWithXmlNameCommandInput; + output: HttpPayloadWithXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts new file mode 100644 index 0000000000000..5907ac16cbda6 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts @@ -0,0 +1,95 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithXmlNamespaceAndPrefixInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadWithXmlNamespaceAndPrefix } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithXmlNamespaceAndPrefixCommand}. + */ +export interface HttpPayloadWithXmlNamespaceAndPrefixCommandInput + extends HttpPayloadWithXmlNamespaceAndPrefixInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithXmlNamespaceAndPrefixCommand}. + */ +export interface HttpPayloadWithXmlNamespaceAndPrefixCommandOutput + extends HttpPayloadWithXmlNamespaceAndPrefixInputOutput, + __MetadataBearer {} + +/** + * The following example serializes a payload that uses an XML namespace. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadWithXmlNamespaceAndPrefixCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadWithXmlNamespaceAndPrefixCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadWithXmlNamespaceAndPrefixInputOutput + * nested: { // PayloadWithXmlNamespaceAndPrefix + * name: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithXmlNamespaceAndPrefixCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithXmlNamespaceAndPrefixInputOutput + * // nested: { // PayloadWithXmlNamespaceAndPrefix + * // name: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithXmlNamespaceAndPrefixCommandInput - {@link HttpPayloadWithXmlNamespaceAndPrefixCommandInput} + * @returns {@link HttpPayloadWithXmlNamespaceAndPrefixCommandOutput} + * @see {@link HttpPayloadWithXmlNamespaceAndPrefixCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithXmlNamespaceAndPrefixCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadWithXmlNamespaceAndPrefixCommand extends $Command + .classBuilder< + HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + HttpPayloadWithXmlNamespaceAndPrefixCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadWithXmlNamespaceAndPrefix", {}) + .n("RestXmlProtocolClient", "HttpPayloadWithXmlNamespaceAndPrefixCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithXmlNamespaceAndPrefix) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithXmlNamespaceAndPrefixInputOutput; + output: HttpPayloadWithXmlNamespaceAndPrefixInputOutput; + }; + sdk: { + input: HttpPayloadWithXmlNamespaceAndPrefixCommandInput; + output: HttpPayloadWithXmlNamespaceAndPrefixCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNamespaceCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNamespaceCommand.ts new file mode 100644 index 0000000000000..ce9dc232a1c56 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPayloadWithXmlNamespaceCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPayloadWithXmlNamespaceInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPayloadWithXmlNamespace } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPayloadWithXmlNamespaceCommand}. + */ +export interface HttpPayloadWithXmlNamespaceCommandInput extends HttpPayloadWithXmlNamespaceInputOutput {} +/** + * @public + * + * The output of {@link HttpPayloadWithXmlNamespaceCommand}. + */ +export interface HttpPayloadWithXmlNamespaceCommandOutput + extends HttpPayloadWithXmlNamespaceInputOutput, + __MetadataBearer {} + +/** + * The following example serializes a payload that uses an XML namespace. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPayloadWithXmlNamespaceCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPayloadWithXmlNamespaceCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPayloadWithXmlNamespaceInputOutput + * nested: { // PayloadWithXmlNamespace + * name: "STRING_VALUE", + * }, + * }; + * const command = new HttpPayloadWithXmlNamespaceCommand(input); + * const response = await client.send(command); + * // { // HttpPayloadWithXmlNamespaceInputOutput + * // nested: { // PayloadWithXmlNamespace + * // name: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPayloadWithXmlNamespaceCommandInput - {@link HttpPayloadWithXmlNamespaceCommandInput} + * @returns {@link HttpPayloadWithXmlNamespaceCommandOutput} + * @see {@link HttpPayloadWithXmlNamespaceCommandInput} for command's `input` shape. + * @see {@link HttpPayloadWithXmlNamespaceCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPayloadWithXmlNamespaceCommand extends $Command + .classBuilder< + HttpPayloadWithXmlNamespaceCommandInput, + HttpPayloadWithXmlNamespaceCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPayloadWithXmlNamespace", {}) + .n("RestXmlProtocolClient", "HttpPayloadWithXmlNamespaceCommand") + .f(void 0, void 0) + .sc(HttpPayloadWithXmlNamespace) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPayloadWithXmlNamespaceInputOutput; + output: HttpPayloadWithXmlNamespaceInputOutput; + }; + sdk: { + input: HttpPayloadWithXmlNamespaceCommandInput; + output: HttpPayloadWithXmlNamespaceCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpPrefixHeadersCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpPrefixHeadersCommand.ts new file mode 100644 index 0000000000000..1378340a5feb5 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpPrefixHeadersCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpPrefixHeadersInputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpPrefixHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpPrefixHeadersCommand}. + */ +export interface HttpPrefixHeadersCommandInput extends HttpPrefixHeadersInputOutput {} +/** + * @public + * + * The output of {@link HttpPrefixHeadersCommand}. + */ +export interface HttpPrefixHeadersCommandOutput extends HttpPrefixHeadersInputOutput, __MetadataBearer {} + +/** + * This examples adds headers to the input of a request and response by prefix. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpPrefixHeadersCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpPrefixHeadersCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpPrefixHeadersInputOutput + * foo: "STRING_VALUE", + * fooMap: { // FooPrefixHeaders + * "": "STRING_VALUE", + * }, + * }; + * const command = new HttpPrefixHeadersCommand(input); + * const response = await client.send(command); + * // { // HttpPrefixHeadersInputOutput + * // foo: "STRING_VALUE", + * // fooMap: { // FooPrefixHeaders + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param HttpPrefixHeadersCommandInput - {@link HttpPrefixHeadersCommandInput} + * @returns {@link HttpPrefixHeadersCommandOutput} + * @see {@link HttpPrefixHeadersCommandInput} for command's `input` shape. + * @see {@link HttpPrefixHeadersCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpPrefixHeadersCommand extends $Command + .classBuilder< + HttpPrefixHeadersCommandInput, + HttpPrefixHeadersCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpPrefixHeaders", {}) + .n("RestXmlProtocolClient", "HttpPrefixHeadersCommand") + .f(void 0, void 0) + .sc(HttpPrefixHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpPrefixHeadersInputOutput; + output: HttpPrefixHeadersInputOutput; + }; + sdk: { + input: HttpPrefixHeadersCommandInput; + output: HttpPrefixHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithFloatLabelsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithFloatLabelsCommand.ts new file mode 100644 index 0000000000000..929ba84aff6a3 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithFloatLabelsCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithFloatLabelsInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpRequestWithFloatLabels } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithFloatLabelsCommand}. + */ +export interface HttpRequestWithFloatLabelsCommandInput extends HttpRequestWithFloatLabelsInput {} +/** + * @public + * + * The output of {@link HttpRequestWithFloatLabelsCommand}. + */ +export interface HttpRequestWithFloatLabelsCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpRequestWithFloatLabelsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpRequestWithFloatLabelsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpRequestWithFloatLabelsInput + * float: Number("float"), // required + * double: Number("double"), // required + * }; + * const command = new HttpRequestWithFloatLabelsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithFloatLabelsCommandInput - {@link HttpRequestWithFloatLabelsCommandInput} + * @returns {@link HttpRequestWithFloatLabelsCommandOutput} + * @see {@link HttpRequestWithFloatLabelsCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithFloatLabelsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class HttpRequestWithFloatLabelsCommand extends $Command + .classBuilder< + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpRequestWithFloatLabels", {}) + .n("RestXmlProtocolClient", "HttpRequestWithFloatLabelsCommand") + .f(void 0, void 0) + .sc(HttpRequestWithFloatLabels) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithFloatLabelsInput; + output: {}; + }; + sdk: { + input: HttpRequestWithFloatLabelsCommandInput; + output: HttpRequestWithFloatLabelsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts new file mode 100644 index 0000000000000..386899dd00b90 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithGreedyLabelInPathInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpRequestWithGreedyLabelInPath } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithGreedyLabelInPathCommand}. + */ +export interface HttpRequestWithGreedyLabelInPathCommandInput extends HttpRequestWithGreedyLabelInPathInput {} +/** + * @public + * + * The output of {@link HttpRequestWithGreedyLabelInPathCommand}. + */ +export interface HttpRequestWithGreedyLabelInPathCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpRequestWithGreedyLabelInPathCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpRequestWithGreedyLabelInPathCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpRequestWithGreedyLabelInPathInput + * foo: "STRING_VALUE", // required + * baz: "STRING_VALUE", // required + * }; + * const command = new HttpRequestWithGreedyLabelInPathCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithGreedyLabelInPathCommandInput - {@link HttpRequestWithGreedyLabelInPathCommandInput} + * @returns {@link HttpRequestWithGreedyLabelInPathCommandOutput} + * @see {@link HttpRequestWithGreedyLabelInPathCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithGreedyLabelInPathCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class HttpRequestWithGreedyLabelInPathCommand extends $Command + .classBuilder< + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpRequestWithGreedyLabelInPath", {}) + .n("RestXmlProtocolClient", "HttpRequestWithGreedyLabelInPathCommand") + .f(void 0, void 0) + .sc(HttpRequestWithGreedyLabelInPath) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithGreedyLabelInPathInput; + output: {}; + }; + sdk: { + input: HttpRequestWithGreedyLabelInPathCommandInput; + output: HttpRequestWithGreedyLabelInPathCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts new file mode 100644 index 0000000000000..c7afb1da5c093 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithLabelsAndTimestampFormatInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpRequestWithLabelsAndTimestampFormat } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithLabelsAndTimestampFormatCommand}. + */ +export interface HttpRequestWithLabelsAndTimestampFormatCommandInput + extends HttpRequestWithLabelsAndTimestampFormatInput {} +/** + * @public + * + * The output of {@link HttpRequestWithLabelsAndTimestampFormatCommand}. + */ +export interface HttpRequestWithLabelsAndTimestampFormatCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests serialize different timestamp formats in the + * URI path. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpRequestWithLabelsAndTimestampFormatCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpRequestWithLabelsAndTimestampFormatCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpRequestWithLabelsAndTimestampFormatInput + * memberEpochSeconds: new Date("TIMESTAMP"), // required + * memberHttpDate: new Date("TIMESTAMP"), // required + * memberDateTime: new Date("TIMESTAMP"), // required + * defaultFormat: new Date("TIMESTAMP"), // required + * targetEpochSeconds: new Date("TIMESTAMP"), // required + * targetHttpDate: new Date("TIMESTAMP"), // required + * targetDateTime: new Date("TIMESTAMP"), // required + * }; + * const command = new HttpRequestWithLabelsAndTimestampFormatCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithLabelsAndTimestampFormatCommandInput - {@link HttpRequestWithLabelsAndTimestampFormatCommandInput} + * @returns {@link HttpRequestWithLabelsAndTimestampFormatCommandOutput} + * @see {@link HttpRequestWithLabelsAndTimestampFormatCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithLabelsAndTimestampFormatCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpRequestWithLabelsAndTimestampFormatCommand extends $Command + .classBuilder< + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpRequestWithLabelsAndTimestampFormat", {}) + .n("RestXmlProtocolClient", "HttpRequestWithLabelsAndTimestampFormatCommand") + .f(void 0, void 0) + .sc(HttpRequestWithLabelsAndTimestampFormat) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithLabelsAndTimestampFormatInput; + output: {}; + }; + sdk: { + input: HttpRequestWithLabelsAndTimestampFormatCommandInput; + output: HttpRequestWithLabelsAndTimestampFormatCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithLabelsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithLabelsCommand.ts new file mode 100644 index 0000000000000..4e3667f17a951 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpRequestWithLabelsCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpRequestWithLabelsInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpRequestWithLabels } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpRequestWithLabelsCommand}. + */ +export interface HttpRequestWithLabelsCommandInput extends HttpRequestWithLabelsInput {} +/** + * @public + * + * The output of {@link HttpRequestWithLabelsCommand}. + */ +export interface HttpRequestWithLabelsCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests are serialized when there's no input + * payload but there are HTTP labels. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpRequestWithLabelsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpRequestWithLabelsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // HttpRequestWithLabelsInput + * string: "STRING_VALUE", // required + * short: Number("short"), // required + * integer: Number("int"), // required + * long: Number("long"), // required + * float: Number("float"), // required + * double: Number("double"), // required + * boolean: true || false, // required + * timestamp: new Date("TIMESTAMP"), // required + * }; + * const command = new HttpRequestWithLabelsCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpRequestWithLabelsCommandInput - {@link HttpRequestWithLabelsCommandInput} + * @returns {@link HttpRequestWithLabelsCommandOutput} + * @see {@link HttpRequestWithLabelsCommandInput} for command's `input` shape. + * @see {@link HttpRequestWithLabelsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class HttpRequestWithLabelsCommand extends $Command + .classBuilder< + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpRequestWithLabels", {}) + .n("RestXmlProtocolClient", "HttpRequestWithLabelsCommand") + .f(void 0, void 0) + .sc(HttpRequestWithLabels) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpRequestWithLabelsInput; + output: {}; + }; + sdk: { + input: HttpRequestWithLabelsCommandInput; + output: HttpRequestWithLabelsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpResponseCodeCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpResponseCodeCommand.ts new file mode 100644 index 0000000000000..00acccf5c1b0a --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpResponseCodeCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpResponseCodeOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpResponseCode } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpResponseCodeCommand}. + */ +export interface HttpResponseCodeCommandInput {} +/** + * @public + * + * The output of {@link HttpResponseCodeCommand}. + */ +export interface HttpResponseCodeCommandOutput extends HttpResponseCodeOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpResponseCodeCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpResponseCodeCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new HttpResponseCodeCommand(input); + * const response = await client.send(command); + * // { // HttpResponseCodeOutput + * // Status: Number("int"), + * // }; + * + * ``` + * + * @param HttpResponseCodeCommandInput - {@link HttpResponseCodeCommandInput} + * @returns {@link HttpResponseCodeCommandOutput} + * @see {@link HttpResponseCodeCommandInput} for command's `input` shape. + * @see {@link HttpResponseCodeCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class HttpResponseCodeCommand extends $Command + .classBuilder< + HttpResponseCodeCommandInput, + HttpResponseCodeCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpResponseCode", {}) + .n("RestXmlProtocolClient", "HttpResponseCodeCommand") + .f(void 0, void 0) + .sc(HttpResponseCode) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: HttpResponseCodeOutput; + }; + sdk: { + input: HttpResponseCodeCommandInput; + output: HttpResponseCodeCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/HttpStringPayloadCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/HttpStringPayloadCommand.ts new file mode 100644 index 0000000000000..af967701b8a06 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/HttpStringPayloadCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { StringPayloadInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { HttpStringPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpStringPayloadCommand}. + */ +export interface HttpStringPayloadCommandInput extends StringPayloadInput {} +/** + * @public + * + * The output of {@link HttpStringPayloadCommand}. + */ +export interface HttpStringPayloadCommandOutput extends StringPayloadInput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, HttpStringPayloadCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, HttpStringPayloadCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // StringPayloadInput + * payload: "STRING_VALUE", + * }; + * const command = new HttpStringPayloadCommand(input); + * const response = await client.send(command); + * // { // StringPayloadInput + * // payload: "STRING_VALUE", + * // }; + * + * ``` + * + * @param HttpStringPayloadCommandInput - {@link HttpStringPayloadCommandInput} + * @returns {@link HttpStringPayloadCommandOutput} + * @see {@link HttpStringPayloadCommandInput} for command's `input` shape. + * @see {@link HttpStringPayloadCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class HttpStringPayloadCommand extends $Command + .classBuilder< + HttpStringPayloadCommandInput, + HttpStringPayloadCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "HttpStringPayload", {}) + .n("RestXmlProtocolClient", "HttpStringPayloadCommand") + .f(void 0, void 0) + .sc(HttpStringPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: StringPayloadInput; + output: StringPayloadInput; + }; + sdk: { + input: HttpStringPayloadCommandInput; + output: HttpStringPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/IgnoreQueryParamsInResponseCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/IgnoreQueryParamsInResponseCommand.ts new file mode 100644 index 0000000000000..5eacf14ec3bf4 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/IgnoreQueryParamsInResponseCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { IgnoreQueryParamsInResponseOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { IgnoreQueryParamsInResponse } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link IgnoreQueryParamsInResponseCommand}. + */ +export interface IgnoreQueryParamsInResponseCommandInput {} +/** + * @public + * + * The output of {@link IgnoreQueryParamsInResponseCommand}. + */ +export interface IgnoreQueryParamsInResponseCommandOutput extends IgnoreQueryParamsInResponseOutput, __MetadataBearer {} + +/** + * This example ensures that query string bound request parameters are + * serialized in the body of responses if the structure is used in both + * the request and response. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, IgnoreQueryParamsInResponseCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, IgnoreQueryParamsInResponseCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new IgnoreQueryParamsInResponseCommand(input); + * const response = await client.send(command); + * // { // IgnoreQueryParamsInResponseOutput + * // baz: "STRING_VALUE", + * // }; + * + * ``` + * + * @param IgnoreQueryParamsInResponseCommandInput - {@link IgnoreQueryParamsInResponseCommandInput} + * @returns {@link IgnoreQueryParamsInResponseCommandOutput} + * @see {@link IgnoreQueryParamsInResponseCommandInput} for command's `input` shape. + * @see {@link IgnoreQueryParamsInResponseCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class IgnoreQueryParamsInResponseCommand extends $Command + .classBuilder< + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "IgnoreQueryParamsInResponse", {}) + .n("RestXmlProtocolClient", "IgnoreQueryParamsInResponseCommand") + .f(void 0, void 0) + .sc(IgnoreQueryParamsInResponse) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: IgnoreQueryParamsInResponseOutput; + }; + sdk: { + input: IgnoreQueryParamsInResponseCommandInput; + output: IgnoreQueryParamsInResponseCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/InputAndOutputWithHeadersCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/InputAndOutputWithHeadersCommand.ts new file mode 100644 index 0000000000000..854e9de97cf79 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/InputAndOutputWithHeadersCommand.ts @@ -0,0 +1,143 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { InputAndOutputWithHeadersIO } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { InputAndOutputWithHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InputAndOutputWithHeadersCommand}. + */ +export interface InputAndOutputWithHeadersCommandInput extends InputAndOutputWithHeadersIO {} +/** + * @public + * + * The output of {@link InputAndOutputWithHeadersCommand}. + */ +export interface InputAndOutputWithHeadersCommandOutput extends InputAndOutputWithHeadersIO, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there is + * no input or output payload but there are HTTP header bindings. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, InputAndOutputWithHeadersCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, InputAndOutputWithHeadersCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // InputAndOutputWithHeadersIO + * headerString: "STRING_VALUE", + * headerByte: 0, // BYTE_VALUE + * headerShort: Number("short"), + * headerInteger: Number("int"), + * headerLong: Number("long"), + * headerFloat: Number("float"), + * headerDouble: Number("double"), + * headerTrueBool: true || false, + * headerFalseBool: true || false, + * headerStringList: [ // StringList + * "STRING_VALUE", + * ], + * headerStringSet: [ // StringSet + * "STRING_VALUE", + * ], + * headerIntegerList: [ // IntegerList + * Number("int"), + * ], + * headerBooleanList: [ // BooleanList + * true || false, + * ], + * headerTimestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * headerEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * headerEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * }; + * const command = new InputAndOutputWithHeadersCommand(input); + * const response = await client.send(command); + * // { // InputAndOutputWithHeadersIO + * // headerString: "STRING_VALUE", + * // headerByte: 0, // BYTE_VALUE + * // headerShort: Number("short"), + * // headerInteger: Number("int"), + * // headerLong: Number("long"), + * // headerFloat: Number("float"), + * // headerDouble: Number("double"), + * // headerTrueBool: true || false, + * // headerFalseBool: true || false, + * // headerStringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // headerStringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // headerIntegerList: [ // IntegerList + * // Number("int"), + * // ], + * // headerBooleanList: [ // BooleanList + * // true || false, + * // ], + * // headerTimestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // headerEnum: "Foo" || "Baz" || "Bar" || "1" || "0", + * // headerEnumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // }; + * + * ``` + * + * @param InputAndOutputWithHeadersCommandInput - {@link InputAndOutputWithHeadersCommandInput} + * @returns {@link InputAndOutputWithHeadersCommandOutput} + * @see {@link InputAndOutputWithHeadersCommandInput} for command's `input` shape. + * @see {@link InputAndOutputWithHeadersCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class InputAndOutputWithHeadersCommand extends $Command + .classBuilder< + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "InputAndOutputWithHeaders", {}) + .n("RestXmlProtocolClient", "InputAndOutputWithHeadersCommand") + .f(void 0, void 0) + .sc(InputAndOutputWithHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: InputAndOutputWithHeadersIO; + output: InputAndOutputWithHeadersIO; + }; + sdk: { + input: InputAndOutputWithHeadersCommandInput; + output: InputAndOutputWithHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/NestedXmlMapWithXmlNameCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/NestedXmlMapWithXmlNameCommand.ts new file mode 100644 index 0000000000000..dd04571d8c486 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/NestedXmlMapWithXmlNameCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NestedXmlMapWithXmlNameRequest, NestedXmlMapWithXmlNameResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { NestedXmlMapWithXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NestedXmlMapWithXmlNameCommand}. + */ +export interface NestedXmlMapWithXmlNameCommandInput extends NestedXmlMapWithXmlNameRequest {} +/** + * @public + * + * The output of {@link NestedXmlMapWithXmlNameCommand}. + */ +export interface NestedXmlMapWithXmlNameCommandOutput extends NestedXmlMapWithXmlNameResponse, __MetadataBearer {} + +/** + * Nested Xml Maps with key/values with @xmlName + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, NestedXmlMapWithXmlNameCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, NestedXmlMapWithXmlNameCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // NestedXmlMapWithXmlNameRequest + * nestedXmlMapWithXmlNameMap: { // NestedXmlMapWithXmlNameMap + * "": { // NestedXmlMapWithXmlNameInnerMap + * "": "STRING_VALUE", + * }, + * }, + * }; + * const command = new NestedXmlMapWithXmlNameCommand(input); + * const response = await client.send(command); + * // { // NestedXmlMapWithXmlNameResponse + * // nestedXmlMapWithXmlNameMap: { // NestedXmlMapWithXmlNameMap + * // "": { // NestedXmlMapWithXmlNameInnerMap + * // "": "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param NestedXmlMapWithXmlNameCommandInput - {@link NestedXmlMapWithXmlNameCommandInput} + * @returns {@link NestedXmlMapWithXmlNameCommandOutput} + * @see {@link NestedXmlMapWithXmlNameCommandInput} for command's `input` shape. + * @see {@link NestedXmlMapWithXmlNameCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class NestedXmlMapWithXmlNameCommand extends $Command + .classBuilder< + NestedXmlMapWithXmlNameCommandInput, + NestedXmlMapWithXmlNameCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "NestedXmlMapWithXmlName", {}) + .n("RestXmlProtocolClient", "NestedXmlMapWithXmlNameCommand") + .f(void 0, void 0) + .sc(NestedXmlMapWithXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NestedXmlMapWithXmlNameRequest; + output: NestedXmlMapWithXmlNameResponse; + }; + sdk: { + input: NestedXmlMapWithXmlNameCommandInput; + output: NestedXmlMapWithXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/NestedXmlMapsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/NestedXmlMapsCommand.ts new file mode 100644 index 0000000000000..bf489857075ab --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/NestedXmlMapsCommand.ts @@ -0,0 +1,106 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NestedXmlMapsRequest, NestedXmlMapsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { NestedXmlMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NestedXmlMapsCommand}. + */ +export interface NestedXmlMapsCommandInput extends NestedXmlMapsRequest {} +/** + * @public + * + * The output of {@link NestedXmlMapsCommand}. + */ +export interface NestedXmlMapsCommandOutput extends NestedXmlMapsResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, NestedXmlMapsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, NestedXmlMapsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // NestedXmlMapsRequest + * nestedMap: { // NestedMap + * "": { // FooEnumMap + * "": "Foo" || "Baz" || "Bar" || "1" || "0", + * }, + * }, + * flatNestedMap: { + * "": { + * "": "Foo" || "Baz" || "Bar" || "1" || "0", + * }, + * }, + * }; + * const command = new NestedXmlMapsCommand(input); + * const response = await client.send(command); + * // { // NestedXmlMapsResponse + * // nestedMap: { // NestedMap + * // "": { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }, + * // flatNestedMap: { + * // "": { + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }, + * // }; + * + * ``` + * + * @param NestedXmlMapsCommandInput - {@link NestedXmlMapsCommandInput} + * @returns {@link NestedXmlMapsCommandOutput} + * @see {@link NestedXmlMapsCommandInput} for command's `input` shape. + * @see {@link NestedXmlMapsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class NestedXmlMapsCommand extends $Command + .classBuilder< + NestedXmlMapsCommandInput, + NestedXmlMapsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "NestedXmlMaps", {}) + .n("RestXmlProtocolClient", "NestedXmlMapsCommand") + .f(void 0, void 0) + .sc(NestedXmlMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NestedXmlMapsRequest; + output: NestedXmlMapsResponse; + }; + sdk: { + input: NestedXmlMapsCommandInput; + output: NestedXmlMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/NoInputAndNoOutputCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/NoInputAndNoOutputCommand.ts new file mode 100644 index 0000000000000..a27aa6a9193c7 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/NoInputAndNoOutputCommand.ts @@ -0,0 +1,85 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { NoInputAndNoOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndNoOutputCommand}. + */ +export interface NoInputAndNoOutputCommandOutput extends __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has no input or output. + * While this should be rare, code generators must support this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, NoInputAndNoOutputCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, NoInputAndNoOutputCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new NoInputAndNoOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndNoOutputCommandInput - {@link NoInputAndNoOutputCommandInput} + * @returns {@link NoInputAndNoOutputCommandOutput} + * @see {@link NoInputAndNoOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndNoOutputCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class NoInputAndNoOutputCommand extends $Command + .classBuilder< + NoInputAndNoOutputCommandInput, + NoInputAndNoOutputCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "NoInputAndNoOutput", {}) + .n("RestXmlProtocolClient", "NoInputAndNoOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndNoOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndNoOutputCommandInput; + output: NoInputAndNoOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/NoInputAndOutputCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/NoInputAndOutputCommand.ts new file mode 100644 index 0000000000000..938b4f92d1b78 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/NoInputAndOutputCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NoInputAndOutputOutput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { NoInputAndOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputAndOutputCommand}. + */ +export interface NoInputAndOutputCommandOutput extends NoInputAndOutputOutput, __MetadataBearer {} + +/** + * The example tests how requests and responses are serialized when there's + * no request or response payload because the operation has no input and the + * output is empty. While this should be rare, code generators must support + * this. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, NoInputAndOutputCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, NoInputAndOutputCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = {}; + * const command = new NoInputAndOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputAndOutputCommandInput - {@link NoInputAndOutputCommandInput} + * @returns {@link NoInputAndOutputCommandOutput} + * @see {@link NoInputAndOutputCommandInput} for command's `input` shape. + * @see {@link NoInputAndOutputCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class NoInputAndOutputCommand extends $Command + .classBuilder< + NoInputAndOutputCommandInput, + NoInputAndOutputCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "NoInputAndOutput", {}) + .n("RestXmlProtocolClient", "NoInputAndOutputCommand") + .f(void 0, void 0) + .sc(NoInputAndOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputAndOutputCommandInput; + output: NoInputAndOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/NullAndEmptyHeadersClientCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/NullAndEmptyHeadersClientCommand.ts new file mode 100644 index 0000000000000..31513a77f8d1f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/NullAndEmptyHeadersClientCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NullAndEmptyHeadersIO } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { NullAndEmptyHeadersClient } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NullAndEmptyHeadersClientCommand}. + */ +export interface NullAndEmptyHeadersClientCommandInput extends NullAndEmptyHeadersIO {} +/** + * @public + * + * The output of {@link NullAndEmptyHeadersClientCommand}. + */ +export interface NullAndEmptyHeadersClientCommandOutput extends NullAndEmptyHeadersIO, __MetadataBearer {} + +/** + * Null headers are not sent over the wire, empty headers are serialized to "" + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, NullAndEmptyHeadersClientCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, NullAndEmptyHeadersClientCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // NullAndEmptyHeadersIO + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * c: [ // StringList + * "STRING_VALUE", + * ], + * }; + * const command = new NullAndEmptyHeadersClientCommand(input); + * const response = await client.send(command); + * // { // NullAndEmptyHeadersIO + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // c: [ // StringList + * // "STRING_VALUE", + * // ], + * // }; + * + * ``` + * + * @param NullAndEmptyHeadersClientCommandInput - {@link NullAndEmptyHeadersClientCommandInput} + * @returns {@link NullAndEmptyHeadersClientCommandOutput} + * @see {@link NullAndEmptyHeadersClientCommandInput} for command's `input` shape. + * @see {@link NullAndEmptyHeadersClientCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class NullAndEmptyHeadersClientCommand extends $Command + .classBuilder< + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "NullAndEmptyHeadersClient", {}) + .n("RestXmlProtocolClient", "NullAndEmptyHeadersClientCommand") + .f(void 0, void 0) + .sc(NullAndEmptyHeadersClient) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NullAndEmptyHeadersIO; + output: NullAndEmptyHeadersIO; + }; + sdk: { + input: NullAndEmptyHeadersClientCommandInput; + output: NullAndEmptyHeadersClientCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/NullAndEmptyHeadersServerCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/NullAndEmptyHeadersServerCommand.ts new file mode 100644 index 0000000000000..9f5e7f78b7e86 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/NullAndEmptyHeadersServerCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { NullAndEmptyHeadersIO } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { NullAndEmptyHeadersServer } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NullAndEmptyHeadersServerCommand}. + */ +export interface NullAndEmptyHeadersServerCommandInput extends NullAndEmptyHeadersIO {} +/** + * @public + * + * The output of {@link NullAndEmptyHeadersServerCommand}. + */ +export interface NullAndEmptyHeadersServerCommandOutput extends NullAndEmptyHeadersIO, __MetadataBearer {} + +/** + * Null headers are not sent over the wire, empty headers are serialized to "" + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, NullAndEmptyHeadersServerCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, NullAndEmptyHeadersServerCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // NullAndEmptyHeadersIO + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * c: [ // StringList + * "STRING_VALUE", + * ], + * }; + * const command = new NullAndEmptyHeadersServerCommand(input); + * const response = await client.send(command); + * // { // NullAndEmptyHeadersIO + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // c: [ // StringList + * // "STRING_VALUE", + * // ], + * // }; + * + * ``` + * + * @param NullAndEmptyHeadersServerCommandInput - {@link NullAndEmptyHeadersServerCommandInput} + * @returns {@link NullAndEmptyHeadersServerCommandOutput} + * @see {@link NullAndEmptyHeadersServerCommandInput} for command's `input` shape. + * @see {@link NullAndEmptyHeadersServerCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class NullAndEmptyHeadersServerCommand extends $Command + .classBuilder< + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "NullAndEmptyHeadersServer", {}) + .n("RestXmlProtocolClient", "NullAndEmptyHeadersServerCommand") + .f(void 0, void 0) + .sc(NullAndEmptyHeadersServer) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: NullAndEmptyHeadersIO; + output: NullAndEmptyHeadersIO; + }; + sdk: { + input: NullAndEmptyHeadersServerCommandInput; + output: NullAndEmptyHeadersServerCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/OmitsNullSerializesEmptyStringCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/OmitsNullSerializesEmptyStringCommand.ts new file mode 100644 index 0000000000000..bd183d469fc14 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/OmitsNullSerializesEmptyStringCommand.ts @@ -0,0 +1,87 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { OmitsNullSerializesEmptyStringInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { OmitsNullSerializesEmptyString } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OmitsNullSerializesEmptyStringCommand}. + */ +export interface OmitsNullSerializesEmptyStringCommandInput extends OmitsNullSerializesEmptyStringInput {} +/** + * @public + * + * The output of {@link OmitsNullSerializesEmptyStringCommand}. + */ +export interface OmitsNullSerializesEmptyStringCommandOutput extends __MetadataBearer {} + +/** + * Omits null, but serializes empty string value. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, OmitsNullSerializesEmptyStringCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, OmitsNullSerializesEmptyStringCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // OmitsNullSerializesEmptyStringInput + * nullValue: "STRING_VALUE", + * emptyString: "STRING_VALUE", + * }; + * const command = new OmitsNullSerializesEmptyStringCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param OmitsNullSerializesEmptyStringCommandInput - {@link OmitsNullSerializesEmptyStringCommandInput} + * @returns {@link OmitsNullSerializesEmptyStringCommandOutput} + * @see {@link OmitsNullSerializesEmptyStringCommandInput} for command's `input` shape. + * @see {@link OmitsNullSerializesEmptyStringCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class OmitsNullSerializesEmptyStringCommand extends $Command + .classBuilder< + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "OmitsNullSerializesEmptyString", {}) + .n("RestXmlProtocolClient", "OmitsNullSerializesEmptyStringCommand") + .f(void 0, void 0) + .sc(OmitsNullSerializesEmptyString) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OmitsNullSerializesEmptyStringInput; + output: {}; + }; + sdk: { + input: OmitsNullSerializesEmptyStringCommandInput; + output: OmitsNullSerializesEmptyStringCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/PutWithContentEncodingCommand.ts new file mode 100644 index 0000000000000..13173afc741af --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/PutWithContentEncodingCommand.ts @@ -0,0 +1,93 @@ +// smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { PutWithContentEncodingInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { PutWithContentEncoding } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandInput extends PutWithContentEncodingInput {} +/** + * @public + * + * The output of {@link PutWithContentEncodingCommand}. + */ +export interface PutWithContentEncodingCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, PutWithContentEncodingCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, PutWithContentEncodingCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // PutWithContentEncodingInput + * encoding: "STRING_VALUE", + * data: "STRING_VALUE", + * }; + * const command = new PutWithContentEncodingCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param PutWithContentEncodingCommandInput - {@link PutWithContentEncodingCommandInput} + * @returns {@link PutWithContentEncodingCommandOutput} + * @see {@link PutWithContentEncodingCommandInput} for command's `input` shape. + * @see {@link PutWithContentEncodingCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class PutWithContentEncodingCommand extends $Command + .classBuilder< + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [ + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getCompressionPlugin(config, { + encodings: ["gzip"], + }), + ]; + }) + .s("RestXml", "PutWithContentEncoding", {}) + .n("RestXmlProtocolClient", "PutWithContentEncodingCommand") + .f(void 0, void 0) + .sc(PutWithContentEncoding) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: PutWithContentEncodingInput; + output: {}; + }; + sdk: { + input: PutWithContentEncodingCommandInput; + output: PutWithContentEncodingCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts new file mode 100644 index 0000000000000..e2d7d6d3ba45d --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/QueryIdempotencyTokenAutoFillCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryIdempotencyTokenAutoFillInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { QueryIdempotencyTokenAutoFill } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandInput extends QueryIdempotencyTokenAutoFillInput {} +/** + * @public + * + * The output of {@link QueryIdempotencyTokenAutoFillCommand}. + */ +export interface QueryIdempotencyTokenAutoFillCommandOutput extends __MetadataBearer {} + +/** + * Automatically adds idempotency tokens. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, QueryIdempotencyTokenAutoFillCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, QueryIdempotencyTokenAutoFillCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // QueryIdempotencyTokenAutoFillInput + * token: "STRING_VALUE", + * }; + * const command = new QueryIdempotencyTokenAutoFillCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryIdempotencyTokenAutoFillCommandInput - {@link QueryIdempotencyTokenAutoFillCommandInput} + * @returns {@link QueryIdempotencyTokenAutoFillCommandOutput} + * @see {@link QueryIdempotencyTokenAutoFillCommandInput} for command's `input` shape. + * @see {@link QueryIdempotencyTokenAutoFillCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class QueryIdempotencyTokenAutoFillCommand extends $Command + .classBuilder< + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "QueryIdempotencyTokenAutoFill", {}) + .n("RestXmlProtocolClient", "QueryIdempotencyTokenAutoFillCommand") + .f(void 0, void 0) + .sc(QueryIdempotencyTokenAutoFill) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryIdempotencyTokenAutoFillInput; + output: {}; + }; + sdk: { + input: QueryIdempotencyTokenAutoFillCommandInput; + output: QueryIdempotencyTokenAutoFillCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/QueryParamsAsStringListMapCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/QueryParamsAsStringListMapCommand.ts new file mode 100644 index 0000000000000..3682546dd5c15 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/QueryParamsAsStringListMapCommand.ts @@ -0,0 +1,91 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryParamsAsStringListMapInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { QueryParamsAsStringListMap } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryParamsAsStringListMapCommand}. + */ +export interface QueryParamsAsStringListMapCommandInput extends QueryParamsAsStringListMapInput {} +/** + * @public + * + * The output of {@link QueryParamsAsStringListMapCommand}. + */ +export interface QueryParamsAsStringListMapCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, QueryParamsAsStringListMapCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, QueryParamsAsStringListMapCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // QueryParamsAsStringListMapInput + * qux: "STRING_VALUE", + * foo: { // StringListMap + * "": [ // StringList + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new QueryParamsAsStringListMapCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryParamsAsStringListMapCommandInput - {@link QueryParamsAsStringListMapCommandInput} + * @returns {@link QueryParamsAsStringListMapCommandOutput} + * @see {@link QueryParamsAsStringListMapCommandInput} for command's `input` shape. + * @see {@link QueryParamsAsStringListMapCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class QueryParamsAsStringListMapCommand extends $Command + .classBuilder< + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "QueryParamsAsStringListMap", {}) + .n("RestXmlProtocolClient", "QueryParamsAsStringListMapCommand") + .f(void 0, void 0) + .sc(QueryParamsAsStringListMap) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryParamsAsStringListMapInput; + output: {}; + }; + sdk: { + input: QueryParamsAsStringListMapCommandInput; + output: QueryParamsAsStringListMapCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/QueryPrecedenceCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/QueryPrecedenceCommand.ts new file mode 100644 index 0000000000000..7d06332a8e34c --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/QueryPrecedenceCommand.ts @@ -0,0 +1,89 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { QueryPrecedenceInput } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { QueryPrecedence } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link QueryPrecedenceCommand}. + */ +export interface QueryPrecedenceCommandInput extends QueryPrecedenceInput {} +/** + * @public + * + * The output of {@link QueryPrecedenceCommand}. + */ +export interface QueryPrecedenceCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, QueryPrecedenceCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, QueryPrecedenceCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // QueryPrecedenceInput + * foo: "STRING_VALUE", + * baz: { // StringMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new QueryPrecedenceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param QueryPrecedenceCommandInput - {@link QueryPrecedenceCommandInput} + * @returns {@link QueryPrecedenceCommandOutput} + * @see {@link QueryPrecedenceCommandInput} for command's `input` shape. + * @see {@link QueryPrecedenceCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class QueryPrecedenceCommand extends $Command + .classBuilder< + QueryPrecedenceCommandInput, + QueryPrecedenceCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "QueryPrecedence", {}) + .n("RestXmlProtocolClient", "QueryPrecedenceCommand") + .f(void 0, void 0) + .sc(QueryPrecedence) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: QueryPrecedenceInput; + output: {}; + }; + sdk: { + input: QueryPrecedenceCommandInput; + output: QueryPrecedenceCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/RecursiveShapesCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/RecursiveShapesCommand.ts new file mode 100644 index 0000000000000..5e712956225b5 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/RecursiveShapesCommand.ts @@ -0,0 +1,112 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RecursiveShapesRequest, RecursiveShapesResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { RecursiveShapes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RecursiveShapesCommand}. + */ +export interface RecursiveShapesCommandInput extends RecursiveShapesRequest {} +/** + * @public + * + * The output of {@link RecursiveShapesCommand}. + */ +export interface RecursiveShapesCommandOutput extends RecursiveShapesResponse, __MetadataBearer {} + +/** + * Recursive shapes + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, RecursiveShapesCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, RecursiveShapesCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // RecursiveShapesRequest + * nested: { // RecursiveShapesInputOutputNested1 + * foo: "STRING_VALUE", + * nested: { // RecursiveShapesInputOutputNested2 + * bar: "STRING_VALUE", + * recursiveMember: { + * foo: "STRING_VALUE", + * nested: { + * bar: "STRING_VALUE", + * recursiveMember: "", + * }, + * }, + * }, + * }, + * }; + * const command = new RecursiveShapesCommand(input); + * const response = await client.send(command); + * // { // RecursiveShapesResponse + * // nested: { // RecursiveShapesInputOutputNested1 + * // foo: "STRING_VALUE", + * // nested: { // RecursiveShapesInputOutputNested2 + * // bar: "STRING_VALUE", + * // recursiveMember: { + * // foo: "STRING_VALUE", + * // nested: { + * // bar: "STRING_VALUE", + * // recursiveMember: "", + * // }, + * // }, + * // }, + * // }, + * // }; + * + * ``` + * + * @param RecursiveShapesCommandInput - {@link RecursiveShapesCommandInput} + * @returns {@link RecursiveShapesCommandOutput} + * @see {@link RecursiveShapesCommandInput} for command's `input` shape. + * @see {@link RecursiveShapesCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class RecursiveShapesCommand extends $Command + .classBuilder< + RecursiveShapesCommandInput, + RecursiveShapesCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "RecursiveShapes", {}) + .n("RestXmlProtocolClient", "RecursiveShapesCommand") + .f(void 0, void 0) + .sc(RecursiveShapes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: RecursiveShapesRequest; + output: RecursiveShapesResponse; + }; + sdk: { + input: RecursiveShapesCommandInput; + output: RecursiveShapesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/SimpleScalarPropertiesCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/SimpleScalarPropertiesCommand.ts new file mode 100644 index 0000000000000..c01d00c847bf4 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/SimpleScalarPropertiesCommand.ts @@ -0,0 +1,106 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleScalarPropertiesRequest, SimpleScalarPropertiesResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { SimpleScalarProperties } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandInput extends SimpleScalarPropertiesRequest {} +/** + * @public + * + * The output of {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandOutput extends SimpleScalarPropertiesResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, SimpleScalarPropertiesCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, SimpleScalarPropertiesCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // SimpleScalarPropertiesRequest + * foo: "STRING_VALUE", + * stringValue: "STRING_VALUE", + * trueBooleanValue: true || false, + * falseBooleanValue: true || false, + * byteValue: 0, // BYTE_VALUE + * shortValue: Number("short"), + * integerValue: Number("int"), + * longValue: Number("long"), + * floatValue: Number("float"), + * doubleValue: Number("double"), + * }; + * const command = new SimpleScalarPropertiesCommand(input); + * const response = await client.send(command); + * // { // SimpleScalarPropertiesResponse + * // foo: "STRING_VALUE", + * // stringValue: "STRING_VALUE", + * // trueBooleanValue: true || false, + * // falseBooleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }; + * + * ``` + * + * @param SimpleScalarPropertiesCommandInput - {@link SimpleScalarPropertiesCommandInput} + * @returns {@link SimpleScalarPropertiesCommandOutput} + * @see {@link SimpleScalarPropertiesCommandInput} for command's `input` shape. + * @see {@link SimpleScalarPropertiesCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class SimpleScalarPropertiesCommand extends $Command + .classBuilder< + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "SimpleScalarProperties", {}) + .n("RestXmlProtocolClient", "SimpleScalarPropertiesCommand") + .f(void 0, void 0) + .sc(SimpleScalarProperties) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleScalarPropertiesRequest; + output: SimpleScalarPropertiesResponse; + }; + sdk: { + input: SimpleScalarPropertiesCommandInput; + output: SimpleScalarPropertiesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/TimestampFormatHeadersCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/TimestampFormatHeadersCommand.ts new file mode 100644 index 0000000000000..1df230c08be3f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/TimestampFormatHeadersCommand.ts @@ -0,0 +1,100 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { TimestampFormatHeadersIO } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { TimestampFormatHeaders } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TimestampFormatHeadersCommand}. + */ +export interface TimestampFormatHeadersCommandInput extends TimestampFormatHeadersIO {} +/** + * @public + * + * The output of {@link TimestampFormatHeadersCommand}. + */ +export interface TimestampFormatHeadersCommandOutput extends TimestampFormatHeadersIO, __MetadataBearer {} + +/** + * The example tests how timestamp request and response headers are serialized. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, TimestampFormatHeadersCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, TimestampFormatHeadersCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // TimestampFormatHeadersIO + * memberEpochSeconds: new Date("TIMESTAMP"), + * memberHttpDate: new Date("TIMESTAMP"), + * memberDateTime: new Date("TIMESTAMP"), + * defaultFormat: new Date("TIMESTAMP"), + * targetEpochSeconds: new Date("TIMESTAMP"), + * targetHttpDate: new Date("TIMESTAMP"), + * targetDateTime: new Date("TIMESTAMP"), + * }; + * const command = new TimestampFormatHeadersCommand(input); + * const response = await client.send(command); + * // { // TimestampFormatHeadersIO + * // memberEpochSeconds: new Date("TIMESTAMP"), + * // memberHttpDate: new Date("TIMESTAMP"), + * // memberDateTime: new Date("TIMESTAMP"), + * // defaultFormat: new Date("TIMESTAMP"), + * // targetEpochSeconds: new Date("TIMESTAMP"), + * // targetHttpDate: new Date("TIMESTAMP"), + * // targetDateTime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param TimestampFormatHeadersCommandInput - {@link TimestampFormatHeadersCommandInput} + * @returns {@link TimestampFormatHeadersCommandOutput} + * @see {@link TimestampFormatHeadersCommandInput} for command's `input` shape. + * @see {@link TimestampFormatHeadersCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class TimestampFormatHeadersCommand extends $Command + .classBuilder< + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "TimestampFormatHeaders", {}) + .n("RestXmlProtocolClient", "TimestampFormatHeadersCommand") + .f(void 0, void 0) + .sc(TimestampFormatHeaders) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TimestampFormatHeadersIO; + output: TimestampFormatHeadersIO; + }; + sdk: { + input: TimestampFormatHeadersCommandInput; + output: TimestampFormatHeadersCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlAttributesCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlAttributesCommand.ts new file mode 100644 index 0000000000000..b19f8c86b7e45 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlAttributesCommand.ts @@ -0,0 +1,90 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlAttributesRequest, XmlAttributesResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlAttributes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlAttributesCommand}. + */ +export interface XmlAttributesCommandInput extends XmlAttributesRequest {} +/** + * @public + * + * The output of {@link XmlAttributesCommand}. + */ +export interface XmlAttributesCommandOutput extends XmlAttributesResponse, __MetadataBearer {} + +/** + * This example serializes an XML attributes on synthesized document. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlAttributesCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlAttributesCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlAttributesRequest + * foo: "STRING_VALUE", + * attr: "STRING_VALUE", + * }; + * const command = new XmlAttributesCommand(input); + * const response = await client.send(command); + * // { // XmlAttributesResponse + * // foo: "STRING_VALUE", + * // attr: "STRING_VALUE", + * // }; + * + * ``` + * + * @param XmlAttributesCommandInput - {@link XmlAttributesCommandInput} + * @returns {@link XmlAttributesCommandOutput} + * @see {@link XmlAttributesCommandInput} for command's `input` shape. + * @see {@link XmlAttributesCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlAttributesCommand extends $Command + .classBuilder< + XmlAttributesCommandInput, + XmlAttributesCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlAttributes", {}) + .n("RestXmlProtocolClient", "XmlAttributesCommand") + .f(void 0, void 0) + .sc(XmlAttributes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlAttributesRequest; + output: XmlAttributesResponse; + }; + sdk: { + input: XmlAttributesCommandInput; + output: XmlAttributesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlAttributesOnPayloadCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlAttributesOnPayloadCommand.ts new file mode 100644 index 0000000000000..f3b4c2c2a1294 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlAttributesOnPayloadCommand.ts @@ -0,0 +1,94 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlAttributesOnPayloadRequest, XmlAttributesOnPayloadResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlAttributesOnPayload } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlAttributesOnPayloadCommand}. + */ +export interface XmlAttributesOnPayloadCommandInput extends XmlAttributesOnPayloadRequest {} +/** + * @public + * + * The output of {@link XmlAttributesOnPayloadCommand}. + */ +export interface XmlAttributesOnPayloadCommandOutput extends XmlAttributesOnPayloadResponse, __MetadataBearer {} + +/** + * This example serializes an XML attributes on a document targeted by httpPayload. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlAttributesOnPayloadCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlAttributesOnPayloadCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlAttributesOnPayloadRequest + * payload: { // XmlAttributesPayloadRequest + * foo: "STRING_VALUE", + * attr: "STRING_VALUE", + * }, + * }; + * const command = new XmlAttributesOnPayloadCommand(input); + * const response = await client.send(command); + * // { // XmlAttributesOnPayloadResponse + * // payload: { // XmlAttributesPayloadResponse + * // foo: "STRING_VALUE", + * // attr: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param XmlAttributesOnPayloadCommandInput - {@link XmlAttributesOnPayloadCommandInput} + * @returns {@link XmlAttributesOnPayloadCommandOutput} + * @see {@link XmlAttributesOnPayloadCommandInput} for command's `input` shape. + * @see {@link XmlAttributesOnPayloadCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlAttributesOnPayloadCommand extends $Command + .classBuilder< + XmlAttributesOnPayloadCommandInput, + XmlAttributesOnPayloadCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlAttributesOnPayload", {}) + .n("RestXmlProtocolClient", "XmlAttributesOnPayloadCommand") + .f(void 0, void 0) + .sc(XmlAttributesOnPayload) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlAttributesOnPayloadRequest; + output: XmlAttributesOnPayloadResponse; + }; + sdk: { + input: XmlAttributesOnPayloadCommandInput; + output: XmlAttributesOnPayloadCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlBlobsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlBlobsCommand.ts new file mode 100644 index 0000000000000..d53bb4d3b4757 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlBlobsCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlBlobsRequest, XmlBlobsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlBlobs } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlBlobsCommand}. + */ +export interface XmlBlobsCommandInput extends XmlBlobsRequest {} +/** + * @public + * + * The output of {@link XmlBlobsCommand}. + */ +export interface XmlBlobsCommandOutput extends XmlBlobsResponse, __MetadataBearer {} + +/** + * Blobs are base64 encoded + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlBlobsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlBlobsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlBlobsRequest + * data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new XmlBlobsCommand(input); + * const response = await client.send(command); + * // { // XmlBlobsResponse + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param XmlBlobsCommandInput - {@link XmlBlobsCommandInput} + * @returns {@link XmlBlobsCommandOutput} + * @see {@link XmlBlobsCommandInput} for command's `input` shape. + * @see {@link XmlBlobsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlBlobsCommand extends $Command + .classBuilder< + XmlBlobsCommandInput, + XmlBlobsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlBlobs", {}) + .n("RestXmlProtocolClient", "XmlBlobsCommand") + .f(void 0, void 0) + .sc(XmlBlobs) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlBlobsRequest; + output: XmlBlobsResponse; + }; + sdk: { + input: XmlBlobsCommandInput; + output: XmlBlobsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyBlobsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyBlobsCommand.ts new file mode 100644 index 0000000000000..8557ef5b7edfc --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyBlobsCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlEmptyBlobsRequest, XmlEmptyBlobsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlEmptyBlobs } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyBlobsCommand}. + */ +export interface XmlEmptyBlobsCommandInput extends XmlEmptyBlobsRequest {} +/** + * @public + * + * The output of {@link XmlEmptyBlobsCommand}. + */ +export interface XmlEmptyBlobsCommandOutput extends XmlEmptyBlobsResponse, __MetadataBearer {} + +/** + * Blobs are base64 encoded + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlEmptyBlobsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlEmptyBlobsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlEmptyBlobsRequest + * data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new XmlEmptyBlobsCommand(input); + * const response = await client.send(command); + * // { // XmlEmptyBlobsResponse + * // data: new Uint8Array(), + * // }; + * + * ``` + * + * @param XmlEmptyBlobsCommandInput - {@link XmlEmptyBlobsCommandInput} + * @returns {@link XmlEmptyBlobsCommandOutput} + * @see {@link XmlEmptyBlobsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyBlobsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlEmptyBlobsCommand extends $Command + .classBuilder< + XmlEmptyBlobsCommandInput, + XmlEmptyBlobsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlEmptyBlobs", {}) + .n("RestXmlProtocolClient", "XmlEmptyBlobsCommand") + .f(void 0, void 0) + .sc(XmlEmptyBlobs) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlEmptyBlobsRequest; + output: XmlEmptyBlobsResponse; + }; + sdk: { + input: XmlEmptyBlobsCommandInput; + output: XmlEmptyBlobsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyListsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyListsCommand.ts new file mode 100644 index 0000000000000..ec7dadde9174f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyListsCommand.ts @@ -0,0 +1,192 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlEmptyListsRequest, XmlEmptyListsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlEmptyLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyListsCommand}. + */ +export interface XmlEmptyListsCommandInput extends XmlEmptyListsRequest {} +/** + * @public + * + * The output of {@link XmlEmptyListsCommand}. + */ +export interface XmlEmptyListsCommandOutput extends XmlEmptyListsResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlEmptyListsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlEmptyListsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlEmptyListsRequest + * stringList: [ // StringList + * "STRING_VALUE", + * ], + * stringSet: [ // StringSet + * "STRING_VALUE", + * ], + * integerList: [ // IntegerList + * Number("int"), + * ], + * booleanList: [ // BooleanList + * true || false, + * ], + * timestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * enumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * intEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * nestedStringList: [ // NestedStringList + * [ + * "STRING_VALUE", + * ], + * ], + * renamedListMembers: [ // RenamedListMembers + * "STRING_VALUE", + * ], + * flattenedList: [ + * "STRING_VALUE", + * ], + * flattenedList2: [ + * "STRING_VALUE", + * ], + * flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * "STRING_VALUE", + * ], + * flattenedListWithNamespace: [ // ListWithNamespace + * "STRING_VALUE", + * ], + * structureList: [ // StructureList + * { // StructureListMember + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * }, + * ], + * flattenedStructureList: [ + * { + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * }, + * ], + * }; + * const command = new XmlEmptyListsCommand(input); + * const response = await client.send(command); + * // { // XmlEmptyListsResponse + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // renamedListMembers: [ // RenamedListMembers + * // "STRING_VALUE", + * // ], + * // flattenedList: [ + * // "STRING_VALUE", + * // ], + * // flattenedList2: [ + * // "STRING_VALUE", + * // ], + * // flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * // "STRING_VALUE", + * // ], + * // flattenedListWithNamespace: [ // ListWithNamespace + * // "STRING_VALUE", + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // flattenedStructureList: [ + * // { + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param XmlEmptyListsCommandInput - {@link XmlEmptyListsCommandInput} + * @returns {@link XmlEmptyListsCommandOutput} + * @see {@link XmlEmptyListsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyListsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class XmlEmptyListsCommand extends $Command + .classBuilder< + XmlEmptyListsCommandInput, + XmlEmptyListsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlEmptyLists", {}) + .n("RestXmlProtocolClient", "XmlEmptyListsCommand") + .f(void 0, void 0) + .sc(XmlEmptyLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlEmptyListsRequest; + output: XmlEmptyListsResponse; + }; + sdk: { + input: XmlEmptyListsCommandInput; + output: XmlEmptyListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyMapsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyMapsCommand.ts new file mode 100644 index 0000000000000..ac20919268666 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyMapsCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlEmptyMapsRequest, XmlEmptyMapsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlEmptyMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyMapsCommand}. + */ +export interface XmlEmptyMapsCommandInput extends XmlEmptyMapsRequest {} +/** + * @public + * + * The output of {@link XmlEmptyMapsCommand}. + */ +export interface XmlEmptyMapsCommandOutput extends XmlEmptyMapsResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlEmptyMapsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlEmptyMapsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlEmptyMapsRequest + * myMap: { // XmlMapsInputOutputMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * }; + * const command = new XmlEmptyMapsCommand(input); + * const response = await client.send(command); + * // { // XmlEmptyMapsResponse + * // myMap: { // XmlMapsInputOutputMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param XmlEmptyMapsCommandInput - {@link XmlEmptyMapsCommandInput} + * @returns {@link XmlEmptyMapsCommandOutput} + * @see {@link XmlEmptyMapsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyMapsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class XmlEmptyMapsCommand extends $Command + .classBuilder< + XmlEmptyMapsCommandInput, + XmlEmptyMapsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlEmptyMaps", {}) + .n("RestXmlProtocolClient", "XmlEmptyMapsCommand") + .f(void 0, void 0) + .sc(XmlEmptyMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlEmptyMapsRequest; + output: XmlEmptyMapsResponse; + }; + sdk: { + input: XmlEmptyMapsCommandInput; + output: XmlEmptyMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyStringsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyStringsCommand.ts new file mode 100644 index 0000000000000..5de72b5ff1e8f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlEmptyStringsCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlEmptyStringsRequest, XmlEmptyStringsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlEmptyStrings } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEmptyStringsCommand}. + */ +export interface XmlEmptyStringsCommandInput extends XmlEmptyStringsRequest {} +/** + * @public + * + * The output of {@link XmlEmptyStringsCommand}. + */ +export interface XmlEmptyStringsCommandOutput extends XmlEmptyStringsResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlEmptyStringsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlEmptyStringsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlEmptyStringsRequest + * emptyString: "STRING_VALUE", + * }; + * const command = new XmlEmptyStringsCommand(input); + * const response = await client.send(command); + * // { // XmlEmptyStringsResponse + * // emptyString: "STRING_VALUE", + * // }; + * + * ``` + * + * @param XmlEmptyStringsCommandInput - {@link XmlEmptyStringsCommandInput} + * @returns {@link XmlEmptyStringsCommandOutput} + * @see {@link XmlEmptyStringsCommandInput} for command's `input` shape. + * @see {@link XmlEmptyStringsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class XmlEmptyStringsCommand extends $Command + .classBuilder< + XmlEmptyStringsCommandInput, + XmlEmptyStringsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlEmptyStrings", {}) + .n("RestXmlProtocolClient", "XmlEmptyStringsCommand") + .f(void 0, void 0) + .sc(XmlEmptyStrings) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlEmptyStringsRequest; + output: XmlEmptyStringsResponse; + }; + sdk: { + input: XmlEmptyStringsCommandInput; + output: XmlEmptyStringsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlEnumsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlEnumsCommand.ts new file mode 100644 index 0000000000000..5a00c14b44324 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlEnumsCommand.ts @@ -0,0 +1,110 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlEnumsRequest, XmlEnumsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlEnumsCommand}. + */ +export interface XmlEnumsCommandInput extends XmlEnumsRequest {} +/** + * @public + * + * The output of {@link XmlEnumsCommand}. + */ +export interface XmlEnumsCommandOutput extends XmlEnumsResponse, __MetadataBearer {} + +/** + * This example serializes enums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlEnumsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlEnumsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlEnumsRequest + * fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * fooEnumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * fooEnumSet: [ // FooEnumSet + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * fooEnumMap: { // FooEnumMap + * "": "Foo" || "Baz" || "Bar" || "1" || "0", + * }, + * }; + * const command = new XmlEnumsCommand(input); + * const response = await client.send(command); + * // { // XmlEnumsResponse + * // fooEnum1: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum2: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnum3: "Foo" || "Baz" || "Bar" || "1" || "0", + * // fooEnumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumSet: [ // FooEnumSet + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // fooEnumMap: { // FooEnumMap + * // "": "Foo" || "Baz" || "Bar" || "1" || "0", + * // }, + * // }; + * + * ``` + * + * @param XmlEnumsCommandInput - {@link XmlEnumsCommandInput} + * @returns {@link XmlEnumsCommandOutput} + * @see {@link XmlEnumsCommandInput} for command's `input` shape. + * @see {@link XmlEnumsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlEnumsCommand extends $Command + .classBuilder< + XmlEnumsCommandInput, + XmlEnumsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlEnums", {}) + .n("RestXmlProtocolClient", "XmlEnumsCommand") + .f(void 0, void 0) + .sc(XmlEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlEnumsRequest; + output: XmlEnumsResponse; + }; + sdk: { + input: XmlEnumsCommandInput; + output: XmlEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlIntEnumsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlIntEnumsCommand.ts new file mode 100644 index 0000000000000..d8255409ecead --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlIntEnumsCommand.ts @@ -0,0 +1,110 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlIntEnumsRequest, XmlIntEnumsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlIntEnums } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlIntEnumsCommand}. + */ +export interface XmlIntEnumsCommandInput extends XmlIntEnumsRequest {} +/** + * @public + * + * The output of {@link XmlIntEnumsCommand}. + */ +export interface XmlIntEnumsCommandOutput extends XmlIntEnumsResponse, __MetadataBearer {} + +/** + * This example serializes enums as top level properties, in lists, sets, and maps. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlIntEnumsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlIntEnumsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlIntEnumsRequest + * intEnum1: 1 || 2 || 3, + * intEnum2: 1 || 2 || 3, + * intEnum3: 1 || 2 || 3, + * intEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * intEnumSet: [ // IntegerEnumSet + * 1 || 2 || 3, + * ], + * intEnumMap: { // IntegerEnumMap + * "": 1 || 2 || 3, + * }, + * }; + * const command = new XmlIntEnumsCommand(input); + * const response = await client.send(command); + * // { // XmlIntEnumsResponse + * // intEnum1: 1 || 2 || 3, + * // intEnum2: 1 || 2 || 3, + * // intEnum3: 1 || 2 || 3, + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // intEnumSet: [ // IntegerEnumSet + * // 1 || 2 || 3, + * // ], + * // intEnumMap: { // IntegerEnumMap + * // "": 1 || 2 || 3, + * // }, + * // }; + * + * ``` + * + * @param XmlIntEnumsCommandInput - {@link XmlIntEnumsCommandInput} + * @returns {@link XmlIntEnumsCommandOutput} + * @see {@link XmlIntEnumsCommandInput} for command's `input` shape. + * @see {@link XmlIntEnumsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlIntEnumsCommand extends $Command + .classBuilder< + XmlIntEnumsCommandInput, + XmlIntEnumsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlIntEnums", {}) + .n("RestXmlProtocolClient", "XmlIntEnumsCommand") + .f(void 0, void 0) + .sc(XmlIntEnums) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlIntEnumsRequest; + output: XmlIntEnumsResponse; + }; + sdk: { + input: XmlIntEnumsCommandInput; + output: XmlIntEnumsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlListsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlListsCommand.ts new file mode 100644 index 0000000000000..b6a79e9694536 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlListsCommand.ts @@ -0,0 +1,203 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlListsRequest, XmlListsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlListsCommand}. + */ +export interface XmlListsCommandInput extends XmlListsRequest {} +/** + * @public + * + * The output of {@link XmlListsCommand}. + */ +export interface XmlListsCommandOutput extends XmlListsResponse, __MetadataBearer {} + +/** + * This test case serializes XML lists for the following cases for both + * input and output: + * + * 1. Normal XML lists. + * 2. Normal XML sets. + * 3. XML lists of lists. + * 4. XML lists with @xmlName on its members + * 5. Flattened XML lists. + * 6. Flattened XML lists with @xmlName. + * 7. Flattened XML lists with @xmlNamespace. + * 8. Lists of structures. + * 9. Flattened XML list of structures + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlListsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlListsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlListsRequest + * stringList: [ // StringList + * "STRING_VALUE", + * ], + * stringSet: [ // StringSet + * "STRING_VALUE", + * ], + * integerList: [ // IntegerList + * Number("int"), + * ], + * booleanList: [ // BooleanList + * true || false, + * ], + * timestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * enumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * intEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * nestedStringList: [ // NestedStringList + * [ + * "STRING_VALUE", + * ], + * ], + * renamedListMembers: [ // RenamedListMembers + * "STRING_VALUE", + * ], + * flattenedList: [ + * "STRING_VALUE", + * ], + * flattenedList2: [ + * "STRING_VALUE", + * ], + * flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * "STRING_VALUE", + * ], + * flattenedListWithNamespace: [ // ListWithNamespace + * "STRING_VALUE", + * ], + * structureList: [ // StructureList + * { // StructureListMember + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * }, + * ], + * flattenedStructureList: [ + * { + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * }, + * ], + * }; + * const command = new XmlListsCommand(input); + * const response = await client.send(command); + * // { // XmlListsResponse + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // renamedListMembers: [ // RenamedListMembers + * // "STRING_VALUE", + * // ], + * // flattenedList: [ + * // "STRING_VALUE", + * // ], + * // flattenedList2: [ + * // "STRING_VALUE", + * // ], + * // flattenedListWithMemberNamespace: [ // ListWithMemberNamespace + * // "STRING_VALUE", + * // ], + * // flattenedListWithNamespace: [ // ListWithNamespace + * // "STRING_VALUE", + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // flattenedStructureList: [ + * // { + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param XmlListsCommandInput - {@link XmlListsCommandInput} + * @returns {@link XmlListsCommandOutput} + * @see {@link XmlListsCommandInput} for command's `input` shape. + * @see {@link XmlListsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlListsCommand extends $Command + .classBuilder< + XmlListsCommandInput, + XmlListsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlLists", {}) + .n("RestXmlProtocolClient", "XmlListsCommand") + .f(void 0, void 0) + .sc(XmlLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlListsRequest; + output: XmlListsResponse; + }; + sdk: { + input: XmlListsCommandInput; + output: XmlListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlMapWithXmlNamespaceCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlMapWithXmlNamespaceCommand.ts new file mode 100644 index 0000000000000..81fedc80353d8 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlMapWithXmlNamespaceCommand.ts @@ -0,0 +1,92 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlMapWithXmlNamespaceRequest, XmlMapWithXmlNamespaceResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlMapWithXmlNamespace } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlMapWithXmlNamespaceCommand}. + */ +export interface XmlMapWithXmlNamespaceCommandInput extends XmlMapWithXmlNamespaceRequest {} +/** + * @public + * + * The output of {@link XmlMapWithXmlNamespaceCommand}. + */ +export interface XmlMapWithXmlNamespaceCommandOutput extends XmlMapWithXmlNamespaceResponse, __MetadataBearer {} + +/** + * Maps with @xmlNamespace and @xmlName + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlMapWithXmlNamespaceCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlMapWithXmlNamespaceCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlMapWithXmlNamespaceRequest + * myMap: { // XmlMapWithXmlNamespaceInputOutputMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new XmlMapWithXmlNamespaceCommand(input); + * const response = await client.send(command); + * // { // XmlMapWithXmlNamespaceResponse + * // myMap: { // XmlMapWithXmlNamespaceInputOutputMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param XmlMapWithXmlNamespaceCommandInput - {@link XmlMapWithXmlNamespaceCommandInput} + * @returns {@link XmlMapWithXmlNamespaceCommandOutput} + * @see {@link XmlMapWithXmlNamespaceCommandInput} for command's `input` shape. + * @see {@link XmlMapWithXmlNamespaceCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlMapWithXmlNamespaceCommand extends $Command + .classBuilder< + XmlMapWithXmlNamespaceCommandInput, + XmlMapWithXmlNamespaceCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlMapWithXmlNamespace", {}) + .n("RestXmlProtocolClient", "XmlMapWithXmlNamespaceCommand") + .f(void 0, void 0) + .sc(XmlMapWithXmlNamespace) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlMapWithXmlNamespaceRequest; + output: XmlMapWithXmlNamespaceResponse; + }; + sdk: { + input: XmlMapWithXmlNamespaceCommandInput; + output: XmlMapWithXmlNamespaceCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlMapsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlMapsCommand.ts new file mode 100644 index 0000000000000..3d0ad5a5e7c60 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlMapsCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlMapsRequest, XmlMapsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlMapsCommand}. + */ +export interface XmlMapsCommandInput extends XmlMapsRequest {} +/** + * @public + * + * The output of {@link XmlMapsCommand}. + */ +export interface XmlMapsCommandOutput extends XmlMapsResponse, __MetadataBearer {} + +/** + * The example tests basic map serialization. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlMapsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlMapsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlMapsRequest + * myMap: { // XmlMapsInputOutputMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * }; + * const command = new XmlMapsCommand(input); + * const response = await client.send(command); + * // { // XmlMapsResponse + * // myMap: { // XmlMapsInputOutputMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param XmlMapsCommandInput - {@link XmlMapsCommandInput} + * @returns {@link XmlMapsCommandOutput} + * @see {@link XmlMapsCommandInput} for command's `input` shape. + * @see {@link XmlMapsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlMapsCommand extends $Command + .classBuilder< + XmlMapsCommandInput, + XmlMapsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlMaps", {}) + .n("RestXmlProtocolClient", "XmlMapsCommand") + .f(void 0, void 0) + .sc(XmlMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlMapsRequest; + output: XmlMapsResponse; + }; + sdk: { + input: XmlMapsCommandInput; + output: XmlMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlMapsXmlNameCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlMapsXmlNameCommand.ts new file mode 100644 index 0000000000000..77cb50d2953f1 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlMapsXmlNameCommand.ts @@ -0,0 +1,96 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlMapsXmlNameRequest, XmlMapsXmlNameResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlMapsXmlName } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlMapsXmlNameCommand}. + */ +export interface XmlMapsXmlNameCommandInput extends XmlMapsXmlNameRequest {} +/** + * @public + * + * The output of {@link XmlMapsXmlNameCommand}. + */ +export interface XmlMapsXmlNameCommandOutput extends XmlMapsXmlNameResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlMapsXmlNameCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlMapsXmlNameCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlMapsXmlNameRequest + * myMap: { // XmlMapsXmlNameInputOutputMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * }; + * const command = new XmlMapsXmlNameCommand(input); + * const response = await client.send(command); + * // { // XmlMapsXmlNameResponse + * // myMap: { // XmlMapsXmlNameInputOutputMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param XmlMapsXmlNameCommandInput - {@link XmlMapsXmlNameCommandInput} + * @returns {@link XmlMapsXmlNameCommandOutput} + * @see {@link XmlMapsXmlNameCommandInput} for command's `input` shape. + * @see {@link XmlMapsXmlNameCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class XmlMapsXmlNameCommand extends $Command + .classBuilder< + XmlMapsXmlNameCommandInput, + XmlMapsXmlNameCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlMapsXmlName", {}) + .n("RestXmlProtocolClient", "XmlMapsXmlNameCommand") + .f(void 0, void 0) + .sc(XmlMapsXmlName) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlMapsXmlNameRequest; + output: XmlMapsXmlNameResponse; + }; + sdk: { + input: XmlMapsXmlNameCommandInput; + output: XmlMapsXmlNameCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlNamespacesCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlNamespacesCommand.ts new file mode 100644 index 0000000000000..763c87bbb35c6 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlNamespacesCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlNamespacesRequest, XmlNamespacesResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlNamespaces } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlNamespacesCommand}. + */ +export interface XmlNamespacesCommandInput extends XmlNamespacesRequest {} +/** + * @public + * + * The output of {@link XmlNamespacesCommand}. + */ +export interface XmlNamespacesCommandOutput extends XmlNamespacesResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlNamespacesCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlNamespacesCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlNamespacesRequest + * nested: { // XmlNamespaceNested + * foo: "STRING_VALUE", + * values: [ // XmlNamespacedList + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new XmlNamespacesCommand(input); + * const response = await client.send(command); + * // { // XmlNamespacesResponse + * // nested: { // XmlNamespaceNested + * // foo: "STRING_VALUE", + * // values: [ // XmlNamespacedList + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param XmlNamespacesCommandInput - {@link XmlNamespacesCommandInput} + * @returns {@link XmlNamespacesCommandOutput} + * @see {@link XmlNamespacesCommandInput} for command's `input` shape. + * @see {@link XmlNamespacesCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class XmlNamespacesCommand extends $Command + .classBuilder< + XmlNamespacesCommandInput, + XmlNamespacesCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlNamespaces", {}) + .n("RestXmlProtocolClient", "XmlNamespacesCommand") + .f(void 0, void 0) + .sc(XmlNamespaces) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlNamespacesRequest; + output: XmlNamespacesResponse; + }; + sdk: { + input: XmlNamespacesCommandInput; + output: XmlNamespacesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlTimestampsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlTimestampsCommand.ts new file mode 100644 index 0000000000000..b2df5d04c518f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlTimestampsCommand.ts @@ -0,0 +1,102 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlTimestampsRequest, XmlTimestampsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlTimestamps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlTimestampsCommand}. + */ +export interface XmlTimestampsCommandInput extends XmlTimestampsRequest {} +/** + * @public + * + * The output of {@link XmlTimestampsCommand}. + */ +export interface XmlTimestampsCommandOutput extends XmlTimestampsResponse, __MetadataBearer {} + +/** + * This tests how timestamps are serialized, including using the + * default format of date-time and various @timestampFormat trait + * values. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlTimestampsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlTimestampsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlTimestampsRequest + * normal: new Date("TIMESTAMP"), + * dateTime: new Date("TIMESTAMP"), + * dateTimeOnTarget: new Date("TIMESTAMP"), + * epochSeconds: new Date("TIMESTAMP"), + * epochSecondsOnTarget: new Date("TIMESTAMP"), + * httpDate: new Date("TIMESTAMP"), + * httpDateOnTarget: new Date("TIMESTAMP"), + * }; + * const command = new XmlTimestampsCommand(input); + * const response = await client.send(command); + * // { // XmlTimestampsResponse + * // normal: new Date("TIMESTAMP"), + * // dateTime: new Date("TIMESTAMP"), + * // dateTimeOnTarget: new Date("TIMESTAMP"), + * // epochSeconds: new Date("TIMESTAMP"), + * // epochSecondsOnTarget: new Date("TIMESTAMP"), + * // httpDate: new Date("TIMESTAMP"), + * // httpDateOnTarget: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param XmlTimestampsCommandInput - {@link XmlTimestampsCommandInput} + * @returns {@link XmlTimestampsCommandOutput} + * @see {@link XmlTimestampsCommandInput} for command's `input` shape. + * @see {@link XmlTimestampsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + * @public + */ +export class XmlTimestampsCommand extends $Command + .classBuilder< + XmlTimestampsCommandInput, + XmlTimestampsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlTimestamps", {}) + .n("RestXmlProtocolClient", "XmlTimestampsCommand") + .f(void 0, void 0) + .sc(XmlTimestamps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlTimestampsRequest; + output: XmlTimestampsResponse; + }; + sdk: { + input: XmlTimestampsCommandInput; + output: XmlTimestampsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/XmlUnionsCommand.ts b/private/aws-protocoltests-restxml-schema/src/commands/XmlUnionsCommand.ts new file mode 100644 index 0000000000000..99acf0832de87 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/XmlUnionsCommand.ts @@ -0,0 +1,168 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { XmlUnionsRequest, XmlUnionsResponse } from "../models/models_0"; +import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestXmlProtocolClient"; +import { XmlUnions } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link XmlUnionsCommand}. + */ +export interface XmlUnionsCommandInput extends XmlUnionsRequest {} +/** + * @public + * + * The output of {@link XmlUnionsCommand}. + */ +export interface XmlUnionsCommandOutput extends XmlUnionsResponse, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestXmlProtocolClient, XmlUnionsCommand } from "@aws-sdk/aws-protocoltests-restxml-schema"; // ES Modules import + * // const { RestXmlProtocolClient, XmlUnionsCommand } = require("@aws-sdk/aws-protocoltests-restxml-schema"); // CommonJS import + * const client = new RestXmlProtocolClient(config); + * const input = { // XmlUnionsRequest + * unionValue: { // XmlUnionShape Union: only one key present + * stringValue: "STRING_VALUE", + * booleanValue: true || false, + * byteValue: 0, // BYTE_VALUE + * shortValue: Number("short"), + * integerValue: Number("int"), + * longValue: Number("long"), + * floatValue: Number("float"), + * doubleValue: Number("double"), + * unionValue: {// Union: only one key present + * stringValue: "STRING_VALUE", + * booleanValue: true || false, + * byteValue: 0, // BYTE_VALUE + * shortValue: Number("short"), + * integerValue: Number("int"), + * longValue: Number("long"), + * floatValue: Number("float"), + * doubleValue: Number("double"), + * unionValue: "", + * structValue: { // XmlNestedUnionStruct + * stringValue: "STRING_VALUE", + * booleanValue: true || false, + * byteValue: 0, // BYTE_VALUE + * shortValue: Number("short"), + * integerValue: Number("int"), + * longValue: Number("long"), + * floatValue: Number("float"), + * doubleValue: Number("double"), + * }, + * }, + * structValue: { + * stringValue: "STRING_VALUE", + * booleanValue: true || false, + * byteValue: 0, // BYTE_VALUE + * shortValue: Number("short"), + * integerValue: Number("int"), + * longValue: Number("long"), + * floatValue: Number("float"), + * doubleValue: Number("double"), + * }, + * }, + * }; + * const command = new XmlUnionsCommand(input); + * const response = await client.send(command); + * // { // XmlUnionsResponse + * // unionValue: { // XmlUnionShape Union: only one key present + * // stringValue: "STRING_VALUE", + * // booleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // unionValue: {// Union: only one key present + * // stringValue: "STRING_VALUE", + * // booleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // unionValue: "", + * // structValue: { // XmlNestedUnionStruct + * // stringValue: "STRING_VALUE", + * // booleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }, + * // }, + * // structValue: { + * // stringValue: "STRING_VALUE", + * // booleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // shortValue: Number("short"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // floatValue: Number("float"), + * // doubleValue: Number("double"), + * // }, + * // }, + * // }; + * + * ``` + * + * @param XmlUnionsCommandInput - {@link XmlUnionsCommandInput} + * @returns {@link XmlUnionsCommandOutput} + * @see {@link XmlUnionsCommandInput} for command's `input` shape. + * @see {@link XmlUnionsCommandOutput} for command's `response` shape. + * @see {@link RestXmlProtocolClientResolvedConfig | config} for RestXmlProtocolClient's `config` shape. + * + * @throws {@link RestXmlProtocolServiceException} + *

Base exception class for all service exceptions from RestXmlProtocol service.

+ * + * + */ +export class XmlUnionsCommand extends $Command + .classBuilder< + XmlUnionsCommandInput, + XmlUnionsCommandOutput, + RestXmlProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestXml", "XmlUnions", {}) + .n("RestXmlProtocolClient", "XmlUnionsCommand") + .f(void 0, void 0) + .sc(XmlUnions) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: XmlUnionsRequest; + output: XmlUnionsResponse; + }; + sdk: { + input: XmlUnionsCommandInput; + output: XmlUnionsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restxml-schema/src/commands/index.ts b/private/aws-protocoltests-restxml-schema/src/commands/index.ts new file mode 100644 index 0000000000000..50121935c4279 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/commands/index.ts @@ -0,0 +1,65 @@ +// smithy-typescript generated code +export * from "./AllQueryStringTypesCommand"; +export * from "./BodyWithXmlNameCommand"; +export * from "./ConstantAndVariableQueryStringCommand"; +export * from "./ConstantQueryStringCommand"; +export * from "./ContentTypeParametersCommand"; +export * from "./DatetimeOffsetsCommand"; +export * from "./EmptyInputAndEmptyOutputCommand"; +export * from "./EndpointOperationCommand"; +export * from "./EndpointWithHostLabelHeaderOperationCommand"; +export * from "./EndpointWithHostLabelOperationCommand"; +export * from "./FlattenedXmlMapCommand"; +export * from "./FlattenedXmlMapWithXmlNameCommand"; +export * from "./FlattenedXmlMapWithXmlNamespaceCommand"; +export * from "./FractionalSecondsCommand"; +export * from "./GreetingWithErrorsCommand"; +export * from "./HttpEmptyPrefixHeadersCommand"; +export * from "./HttpEnumPayloadCommand"; +export * from "./HttpPayloadTraitsCommand"; +export * from "./HttpPayloadTraitsWithMediaTypeCommand"; +export * from "./HttpPayloadWithMemberXmlNameCommand"; +export * from "./HttpPayloadWithStructureCommand"; +export * from "./HttpPayloadWithUnionCommand"; +export * from "./HttpPayloadWithXmlNameCommand"; +export * from "./HttpPayloadWithXmlNamespaceAndPrefixCommand"; +export * from "./HttpPayloadWithXmlNamespaceCommand"; +export * from "./HttpPrefixHeadersCommand"; +export * from "./HttpRequestWithFloatLabelsCommand"; +export * from "./HttpRequestWithGreedyLabelInPathCommand"; +export * from "./HttpRequestWithLabelsAndTimestampFormatCommand"; +export * from "./HttpRequestWithLabelsCommand"; +export * from "./HttpResponseCodeCommand"; +export * from "./HttpStringPayloadCommand"; +export * from "./IgnoreQueryParamsInResponseCommand"; +export * from "./InputAndOutputWithHeadersCommand"; +export * from "./NestedXmlMapWithXmlNameCommand"; +export * from "./NestedXmlMapsCommand"; +export * from "./NoInputAndNoOutputCommand"; +export * from "./NoInputAndOutputCommand"; +export * from "./NullAndEmptyHeadersClientCommand"; +export * from "./NullAndEmptyHeadersServerCommand"; +export * from "./OmitsNullSerializesEmptyStringCommand"; +export * from "./PutWithContentEncodingCommand"; +export * from "./QueryIdempotencyTokenAutoFillCommand"; +export * from "./QueryParamsAsStringListMapCommand"; +export * from "./QueryPrecedenceCommand"; +export * from "./RecursiveShapesCommand"; +export * from "./SimpleScalarPropertiesCommand"; +export * from "./TimestampFormatHeadersCommand"; +export * from "./XmlAttributesCommand"; +export * from "./XmlAttributesOnPayloadCommand"; +export * from "./XmlBlobsCommand"; +export * from "./XmlEmptyBlobsCommand"; +export * from "./XmlEmptyListsCommand"; +export * from "./XmlEmptyMapsCommand"; +export * from "./XmlEmptyStringsCommand"; +export * from "./XmlEnumsCommand"; +export * from "./XmlIntEnumsCommand"; +export * from "./XmlListsCommand"; +export * from "./XmlMapWithXmlNamespaceCommand"; +export * from "./XmlMapsCommand"; +export * from "./XmlMapsXmlNameCommand"; +export * from "./XmlNamespacesCommand"; +export * from "./XmlTimestampsCommand"; +export * from "./XmlUnionsCommand"; diff --git a/private/aws-protocoltests-restxml-schema/src/endpoint/EndpointParameters.ts b/private/aws-protocoltests-restxml-schema/src/endpoint/EndpointParameters.ts new file mode 100644 index 0000000000000..6f5e60bb5e06e --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/endpoint/EndpointParameters.ts @@ -0,0 +1,29 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return Object.assign(options, { + defaultSigningName: "restxml", + }); +}; + +export const commonParams = { + endpoint: { type: "builtInParams", name: "endpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + endpoint?: string; +} diff --git a/private/aws-protocoltests-restxml-schema/src/endpoint/endpointResolver.ts b/private/aws-protocoltests-restxml-schema/src/endpoint/endpointResolver.ts new file mode 100644 index 0000000000000..8bb222967df85 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/endpoint/endpointResolver.ts @@ -0,0 +1,26 @@ +// smithy-typescript generated code +import { awsEndpointFunctions } from "@aws-sdk/util-endpoints"; +import { EndpointV2, Logger } from "@smithy/types"; +import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["endpoint"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; + +customEndpointFunctions.aws = awsEndpointFunctions; diff --git a/private/aws-protocoltests-restxml-schema/src/endpoint/ruleset.ts b/private/aws-protocoltests-restxml-schema/src/endpoint/ruleset.ts new file mode 100644 index 0000000000000..14416a50b2697 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/endpoint/ruleset.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { RuleSetObject } from "@smithy/types"; + +export const ruleSet: RuleSetObject = { + version: "1.0", + parameters: { + endpoint: { + type: "string", + builtIn: "SDK::Endpoint", + documentation: "Endpoint used for making requests. Should be formatted as a URI.", + }, + }, + rules: [ + { + conditions: [ + { + fn: "isSet", + argv: [ + { + ref: "endpoint", + }, + ], + }, + ], + endpoint: { + url: { + ref: "endpoint", + }, + }, + type: "endpoint", + }, + { + conditions: [], + error: "(default endpointRuleSet) endpoint is not set - you must configure an endpoint.", + type: "error", + }, + ], +}; diff --git a/private/aws-protocoltests-restxml-schema/src/extensionConfiguration.ts b/private/aws-protocoltests-restxml-schema/src/extensionConfiguration.ts new file mode 100644 index 0000000000000..7fe618ee55c1a --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/extensionConfiguration.ts @@ -0,0 +1,15 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface RestXmlProtocolExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/private/aws-protocoltests-restxml-schema/src/index.ts b/private/aws-protocoltests-restxml-schema/src/index.ts new file mode 100644 index 0000000000000..431b3758a498f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/index.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + * A REST XML service that sends XML requests and responses. + * + * @packageDocumentation + */ +export * from "./RestXmlProtocolClient"; +export * from "./RestXmlProtocol"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { RestXmlProtocolExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { RestXmlProtocolServiceException } from "./models/RestXmlProtocolServiceException"; diff --git a/private/aws-protocoltests-restxml-schema/src/models/RestXmlProtocolServiceException.ts b/private/aws-protocoltests-restxml-schema/src/models/RestXmlProtocolServiceException.ts new file mode 100644 index 0000000000000..75765a3d0eea5 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/models/RestXmlProtocolServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from RestXmlProtocol service. + */ +export class RestXmlProtocolServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, RestXmlProtocolServiceException.prototype); + } +} diff --git a/private/aws-protocoltests-restxml-schema/src/models/index.ts b/private/aws-protocoltests-restxml-schema/src/models/index.ts new file mode 100644 index 0000000000000..9eaceb12865f8 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/private/aws-protocoltests-restxml-schema/src/models/models_0.ts b/private/aws-protocoltests-restxml-schema/src/models/models_0.ts new file mode 100644 index 0000000000000..4f865e536ae7c --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/models/models_0.ts @@ -0,0 +1,1231 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +import { RestXmlProtocolServiceException as __BaseException } from "./RestXmlProtocolServiceException"; + +/** + * @public + */ +export interface GreetingStruct { + hi?: string | undefined; +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} + +/** + * @public + */ +export interface AllQueryStringTypesInput { + queryString?: string | undefined; + queryStringList?: string[] | undefined; + queryStringSet?: string[] | undefined; + queryByte?: number | undefined; + queryShort?: number | undefined; + queryInteger?: number | undefined; + queryIntegerList?: number[] | undefined; + queryIntegerSet?: number[] | undefined; + queryLong?: number | undefined; + queryFloat?: number | undefined; + queryDouble?: number | undefined; + queryDoubleList?: number[] | undefined; + queryBoolean?: boolean | undefined; + queryBooleanList?: boolean[] | undefined; + queryTimestamp?: Date | undefined; + queryTimestampList?: Date[] | undefined; + queryEnum?: FooEnum | undefined; + queryEnumList?: FooEnum[] | undefined; + queryIntegerEnum?: IntegerEnum | undefined; + queryIntegerEnumList?: IntegerEnum[] | undefined; + queryParamsMapOfStrings?: Record | undefined; +} + +/** + * @public + */ +export interface PayloadWithXmlName { + name?: string | undefined; +} + +/** + * @public + */ +export interface BodyWithXmlNameInputOutput { + nested?: PayloadWithXmlName | undefined; +} + +/** + * @public + */ +export interface ComplexNestedErrorData { + Foo?: string | undefined; +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name: "ComplexError" = "ComplexError"; + readonly $fault: "client" = "client"; + Header?: string | undefined; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.Header = opts.Header; + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * @public + */ +export interface ConstantAndVariableQueryStringInput { + baz?: string | undefined; + maybeSet?: string | undefined; +} + +/** + * @public + */ +export interface ConstantQueryStringInput { + hello: string | undefined; +} + +/** + * @public + */ +export interface ContentTypeParametersInput { + value?: number | undefined; +} + +/** + * @public + */ +export interface ContentTypeParametersOutput {} + +/** + * @public + */ +export interface DatetimeOffsetsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputInput {} + +/** + * @public + */ +export interface EmptyInputAndEmptyOutputOutput {} + +/** + * @public + */ +export interface HostLabelHeaderInput { + accountId: string | undefined; +} + +/** + * @public + */ +export interface EndpointWithHostLabelOperationRequest { + label: string | undefined; +} + +/** + * @public + * @enum + */ +export const StringEnum = { + V: "enumvalue", +} as const; +/** + * @public + */ +export type StringEnum = (typeof StringEnum)[keyof typeof StringEnum]; + +/** + * @public + */ +export interface EnumPayloadInput { + payload?: StringEnum | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapRequest { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapResponse { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapWithXmlNameRequest { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapWithXmlNameResponse { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FlattenedXmlMapWithXmlNamespaceOutput { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface FractionalSecondsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface GreetingWithErrorsOutput { + greeting?: string | undefined; +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name: "InvalidGreeting" = "InvalidGreeting"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface HttpEmptyPrefixHeadersInput { + prefixHeaders?: Record | undefined; + specificHeader?: string | undefined; +} + +/** + * @public + */ +export interface HttpEmptyPrefixHeadersOutput { + prefixHeaders?: Record | undefined; + specificHeader?: string | undefined; +} + +/** + * @public + */ +export interface HttpPayloadTraitsInputOutput { + foo?: string | undefined; + blob?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface HttpPayloadTraitsWithMediaTypeInputOutput { + foo?: string | undefined; + blob?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface HttpPayloadWithMemberXmlNameInputOutput { + nested?: PayloadWithXmlName | undefined; +} + +/** + * @public + */ +export interface NestedPayload { + greeting?: string | undefined; + name?: string | undefined; +} + +/** + * @public + */ +export interface HttpPayloadWithStructureInputOutput { + nested?: NestedPayload | undefined; +} + +/** + * @public + */ +export type UnionPayload = UnionPayload.GreetingMember | UnionPayload.$UnknownMember; + +/** + * @public + */ +export namespace UnionPayload { + export interface GreetingMember { + greeting: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + greeting?: never; + $unknown: [string, any]; + } + + export interface Visitor { + greeting: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: UnionPayload, visitor: Visitor): T => { + if (value.greeting !== undefined) return visitor.greeting(value.greeting); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface HttpPayloadWithUnionInputOutput { + nested?: UnionPayload | undefined; +} + +/** + * @public + */ +export interface HttpPayloadWithXmlNameInputOutput { + nested?: PayloadWithXmlName | undefined; +} + +/** + * @public + */ +export interface PayloadWithXmlNamespace { + name?: string | undefined; +} + +/** + * @public + */ +export interface HttpPayloadWithXmlNamespaceInputOutput { + nested?: PayloadWithXmlNamespace | undefined; +} + +/** + * @public + */ +export interface PayloadWithXmlNamespaceAndPrefix { + name?: string | undefined; +} + +/** + * @public + */ +export interface HttpPayloadWithXmlNamespaceAndPrefixInputOutput { + nested?: PayloadWithXmlNamespaceAndPrefix | undefined; +} + +/** + * @public + */ +export interface HttpPrefixHeadersInputOutput { + foo?: string | undefined; + fooMap?: Record | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithFloatLabelsInput { + float: number | undefined; + double: number | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithGreedyLabelInPathInput { + foo: string | undefined; + baz: string | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithLabelsInput { + string: string | undefined; + short: number | undefined; + integer: number | undefined; + long: number | undefined; + float: number | undefined; + double: number | undefined; + /** + * Serialized in the path as true or false. + * @public + */ + boolean: boolean | undefined; + + /** + * Note that this member has no format, so it's serialized as an RFC 3399 date-time. + * @public + */ + timestamp: Date | undefined; +} + +/** + * @public + */ +export interface HttpRequestWithLabelsAndTimestampFormatInput { + memberEpochSeconds: Date | undefined; + memberHttpDate: Date | undefined; + memberDateTime: Date | undefined; + defaultFormat: Date | undefined; + targetEpochSeconds: Date | undefined; + targetHttpDate: Date | undefined; + targetDateTime: Date | undefined; +} + +/** + * @public + */ +export interface HttpResponseCodeOutput { + Status?: number | undefined; +} + +/** + * @public + */ +export interface StringPayloadInput { + payload?: string | undefined; +} + +/** + * @public + */ +export interface IgnoreQueryParamsInResponseOutput { + baz?: string | undefined; +} + +/** + * @public + */ +export interface InputAndOutputWithHeadersIO { + headerString?: string | undefined; + headerByte?: number | undefined; + headerShort?: number | undefined; + headerInteger?: number | undefined; + headerLong?: number | undefined; + headerFloat?: number | undefined; + headerDouble?: number | undefined; + headerTrueBool?: boolean | undefined; + headerFalseBool?: boolean | undefined; + headerStringList?: string[] | undefined; + headerStringSet?: string[] | undefined; + headerIntegerList?: number[] | undefined; + headerBooleanList?: boolean[] | undefined; + headerTimestampList?: Date[] | undefined; + headerEnum?: FooEnum | undefined; + headerEnumList?: FooEnum[] | undefined; +} + +/** + * @public + */ +export interface NestedXmlMapsRequest { + nestedMap?: Record> | undefined; + flatNestedMap?: Record> | undefined; +} + +/** + * @public + */ +export interface NestedXmlMapsResponse { + nestedMap?: Record> | undefined; + flatNestedMap?: Record> | undefined; +} + +/** + * @public + */ +export interface NestedXmlMapWithXmlNameRequest { + nestedXmlMapWithXmlNameMap?: Record> | undefined; +} + +/** + * @public + */ +export interface NestedXmlMapWithXmlNameResponse { + nestedXmlMapWithXmlNameMap?: Record> | undefined; +} + +/** + * @public + */ +export interface NoInputAndOutputOutput {} + +/** + * @public + */ +export interface NullAndEmptyHeadersIO { + a?: string | undefined; + b?: string | undefined; + c?: string[] | undefined; +} + +/** + * @public + */ +export interface OmitsNullSerializesEmptyStringInput { + nullValue?: string | undefined; + emptyString?: string | undefined; +} + +/** + * @public + */ +export interface PutWithContentEncodingInput { + encoding?: string | undefined; + data?: string | undefined; +} + +/** + * @public + */ +export interface QueryIdempotencyTokenAutoFillInput { + token?: string | undefined; +} + +/** + * @public + */ +export interface QueryParamsAsStringListMapInput { + qux?: string | undefined; + foo?: Record | undefined; +} + +/** + * @public + */ +export interface QueryPrecedenceInput { + foo?: string | undefined; + baz?: Record | undefined; +} + +/** + * @public + */ +export interface SimpleScalarPropertiesRequest { + foo?: string | undefined; + stringValue?: string | undefined; + trueBooleanValue?: boolean | undefined; + falseBooleanValue?: boolean | undefined; + byteValue?: number | undefined; + shortValue?: number | undefined; + integerValue?: number | undefined; + longValue?: number | undefined; + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export interface SimpleScalarPropertiesResponse { + foo?: string | undefined; + stringValue?: string | undefined; + trueBooleanValue?: boolean | undefined; + falseBooleanValue?: boolean | undefined; + byteValue?: number | undefined; + shortValue?: number | undefined; + integerValue?: number | undefined; + longValue?: number | undefined; + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export interface TimestampFormatHeadersIO { + memberEpochSeconds?: Date | undefined; + memberHttpDate?: Date | undefined; + memberDateTime?: Date | undefined; + defaultFormat?: Date | undefined; + targetEpochSeconds?: Date | undefined; + targetHttpDate?: Date | undefined; + targetDateTime?: Date | undefined; +} + +/** + * @public + */ +export interface XmlAttributesRequest { + foo?: string | undefined; + attr?: string | undefined; +} + +/** + * @public + */ +export interface XmlAttributesResponse { + foo?: string | undefined; + attr?: string | undefined; +} + +/** + * @public + */ +export interface XmlAttributesPayloadRequest { + foo?: string | undefined; + attr?: string | undefined; +} + +/** + * @public + */ +export interface XmlAttributesOnPayloadRequest { + payload?: XmlAttributesPayloadRequest | undefined; +} + +/** + * @public + */ +export interface XmlAttributesPayloadResponse { + foo?: string | undefined; + attr?: string | undefined; +} + +/** + * @public + */ +export interface XmlAttributesOnPayloadResponse { + payload?: XmlAttributesPayloadResponse | undefined; +} + +/** + * @public + */ +export interface XmlBlobsRequest { + data?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface XmlBlobsResponse { + data?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface XmlEmptyBlobsRequest { + data?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface XmlEmptyBlobsResponse { + data?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface StructureListMember { + a?: string | undefined; + b?: string | undefined; +} + +/** + * @public + */ +export interface XmlEmptyListsRequest { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + renamedListMembers?: string[] | undefined; + flattenedList?: string[] | undefined; + flattenedList2?: string[] | undefined; + flattenedListWithMemberNamespace?: string[] | undefined; + flattenedListWithNamespace?: string[] | undefined; + structureList?: StructureListMember[] | undefined; + flattenedStructureList?: StructureListMember[] | undefined; +} + +/** + * @public + */ +export interface XmlEmptyListsResponse { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + renamedListMembers?: string[] | undefined; + flattenedList?: string[] | undefined; + flattenedList2?: string[] | undefined; + flattenedListWithMemberNamespace?: string[] | undefined; + flattenedListWithNamespace?: string[] | undefined; + structureList?: StructureListMember[] | undefined; + flattenedStructureList?: StructureListMember[] | undefined; +} + +/** + * @public + */ +export interface XmlEmptyMapsRequest { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlEmptyMapsResponse { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlEmptyStringsRequest { + emptyString?: string | undefined; +} + +/** + * @public + */ +export interface XmlEmptyStringsResponse { + emptyString?: string | undefined; +} + +/** + * @public + */ +export interface XmlEnumsRequest { + fooEnum1?: FooEnum | undefined; + fooEnum2?: FooEnum | undefined; + fooEnum3?: FooEnum | undefined; + fooEnumList?: FooEnum[] | undefined; + fooEnumSet?: FooEnum[] | undefined; + fooEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlEnumsResponse { + fooEnum1?: FooEnum | undefined; + fooEnum2?: FooEnum | undefined; + fooEnum3?: FooEnum | undefined; + fooEnumList?: FooEnum[] | undefined; + fooEnumSet?: FooEnum[] | undefined; + fooEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlIntEnumsRequest { + intEnum1?: IntegerEnum | undefined; + intEnum2?: IntegerEnum | undefined; + intEnum3?: IntegerEnum | undefined; + intEnumList?: IntegerEnum[] | undefined; + intEnumSet?: IntegerEnum[] | undefined; + intEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlIntEnumsResponse { + intEnum1?: IntegerEnum | undefined; + intEnum2?: IntegerEnum | undefined; + intEnum3?: IntegerEnum | undefined; + intEnumList?: IntegerEnum[] | undefined; + intEnumSet?: IntegerEnum[] | undefined; + intEnumMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlListsRequest { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + renamedListMembers?: string[] | undefined; + flattenedList?: string[] | undefined; + flattenedList2?: string[] | undefined; + flattenedListWithMemberNamespace?: string[] | undefined; + flattenedListWithNamespace?: string[] | undefined; + structureList?: StructureListMember[] | undefined; + flattenedStructureList?: StructureListMember[] | undefined; +} + +/** + * @public + */ +export interface XmlListsResponse { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + renamedListMembers?: string[] | undefined; + flattenedList?: string[] | undefined; + flattenedList2?: string[] | undefined; + flattenedListWithMemberNamespace?: string[] | undefined; + flattenedListWithNamespace?: string[] | undefined; + structureList?: StructureListMember[] | undefined; + flattenedStructureList?: StructureListMember[] | undefined; +} + +/** + * @public + */ +export interface XmlMapsRequest { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlMapsResponse { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlMapsXmlNameRequest { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlMapsXmlNameResponse { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlMapWithXmlNamespaceRequest { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlMapWithXmlNamespaceResponse { + myMap?: Record | undefined; +} + +/** + * @public + */ +export interface XmlNamespaceNested { + foo?: string | undefined; + values?: string[] | undefined; +} + +/** + * @public + */ +export interface XmlNamespacesRequest { + nested?: XmlNamespaceNested | undefined; +} + +/** + * @public + */ +export interface XmlNamespacesResponse { + nested?: XmlNamespaceNested | undefined; +} + +/** + * @public + */ +export interface XmlTimestampsRequest { + normal?: Date | undefined; + dateTime?: Date | undefined; + dateTimeOnTarget?: Date | undefined; + epochSeconds?: Date | undefined; + epochSecondsOnTarget?: Date | undefined; + httpDate?: Date | undefined; + httpDateOnTarget?: Date | undefined; +} + +/** + * @public + */ +export interface XmlTimestampsResponse { + normal?: Date | undefined; + dateTime?: Date | undefined; + dateTimeOnTarget?: Date | undefined; + epochSeconds?: Date | undefined; + epochSecondsOnTarget?: Date | undefined; + httpDate?: Date | undefined; + httpDateOnTarget?: Date | undefined; +} + +/** + * @public + */ +export interface XmlNestedUnionStruct { + stringValue?: string | undefined; + booleanValue?: boolean | undefined; + byteValue?: number | undefined; + shortValue?: number | undefined; + integerValue?: number | undefined; + longValue?: number | undefined; + floatValue?: number | undefined; + doubleValue?: number | undefined; +} + +/** + * @public + */ +export type XmlUnionShape = + | XmlUnionShape.BooleanValueMember + | XmlUnionShape.ByteValueMember + | XmlUnionShape.DoubleValueMember + | XmlUnionShape.FloatValueMember + | XmlUnionShape.IntegerValueMember + | XmlUnionShape.LongValueMember + | XmlUnionShape.ShortValueMember + | XmlUnionShape.StringValueMember + | XmlUnionShape.StructValueMember + | XmlUnionShape.UnionValueMember + | XmlUnionShape.$UnknownMember; + +/** + * @public + */ +export namespace XmlUnionShape { + export interface StringValueMember { + stringValue: string; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface BooleanValueMember { + stringValue?: never; + booleanValue: boolean; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface ByteValueMember { + stringValue?: never; + booleanValue?: never; + byteValue: number; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface ShortValueMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue: number; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface IntegerValueMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue: number; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface LongValueMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue: number; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface FloatValueMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue: number; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface DoubleValueMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue: number; + unionValue?: never; + structValue?: never; + $unknown?: never; + } + + export interface UnionValueMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue: XmlUnionShape; + structValue?: never; + $unknown?: never; + } + + export interface StructValueMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue: XmlNestedUnionStruct; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + stringValue?: never; + booleanValue?: never; + byteValue?: never; + shortValue?: never; + integerValue?: never; + longValue?: never; + floatValue?: never; + doubleValue?: never; + unionValue?: never; + structValue?: never; + $unknown: [string, any]; + } + + export interface Visitor { + stringValue: (value: string) => T; + booleanValue: (value: boolean) => T; + byteValue: (value: number) => T; + shortValue: (value: number) => T; + integerValue: (value: number) => T; + longValue: (value: number) => T; + floatValue: (value: number) => T; + doubleValue: (value: number) => T; + unionValue: (value: XmlUnionShape) => T; + structValue: (value: XmlNestedUnionStruct) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: XmlUnionShape, visitor: Visitor): T => { + if (value.stringValue !== undefined) return visitor.stringValue(value.stringValue); + if (value.booleanValue !== undefined) return visitor.booleanValue(value.booleanValue); + if (value.byteValue !== undefined) return visitor.byteValue(value.byteValue); + if (value.shortValue !== undefined) return visitor.shortValue(value.shortValue); + if (value.integerValue !== undefined) return visitor.integerValue(value.integerValue); + if (value.longValue !== undefined) return visitor.longValue(value.longValue); + if (value.floatValue !== undefined) return visitor.floatValue(value.floatValue); + if (value.doubleValue !== undefined) return visitor.doubleValue(value.doubleValue); + if (value.unionValue !== undefined) return visitor.unionValue(value.unionValue); + if (value.structValue !== undefined) return visitor.structValue(value.structValue); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutputNested1 { + foo?: string | undefined; + nested?: RecursiveShapesInputOutputNested2 | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutputNested2 { + bar?: string | undefined; + recursiveMember?: RecursiveShapesInputOutputNested1 | undefined; +} + +/** + * @public + */ +export interface XmlUnionsRequest { + unionValue?: XmlUnionShape | undefined; +} + +/** + * @public + */ +export interface XmlUnionsResponse { + unionValue?: XmlUnionShape | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesRequest { + nested?: RecursiveShapesInputOutputNested1 | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesResponse { + nested?: RecursiveShapesInputOutputNested1 | undefined; +} diff --git a/private/aws-protocoltests-restxml-schema/src/protocols/Aws_restXml.ts b/private/aws-protocoltests-restxml-schema/src/protocols/Aws_restXml.ts new file mode 100644 index 0000000000000..8262a7d9d7e44 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/protocols/Aws_restXml.ts @@ -0,0 +1,4771 @@ +// smithy-typescript generated code +import { loadRestXmlErrorCode, parseXmlBody as parseBody, parseXmlErrorBody as parseErrorBody } from "@aws-sdk/core"; +import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; +import { requestBuilder as rb } from "@smithy/core"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, + isValidHostname as __isValidHostname, +} from "@smithy/protocol-http"; +import { + collectBody, + convertMap, + dateToUtcString as __dateToUtcString, + decorateServiceException as __decorateServiceException, + expectNonNull as __expectNonNull, + expectObject as __expectObject, + expectString as __expectString, + expectUnion as __expectUnion, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + getArrayIfSingleItem as __getArrayIfSingleItem, + isSerializableHeaderValue, + map, + parseBoolean as __parseBoolean, + parseEpochTimestamp as __parseEpochTimestamp, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime as __parseRfc7231DateTime, + quoteHeader as __quoteHeader, + resolvedPath as __resolvedPath, + serializeDateTime as __serializeDateTime, + splitEvery as __splitEvery, + splitHeader as __splitHeader, + strictParseByte as __strictParseByte, + strictParseDouble as __strictParseDouble, + strictParseFloat as __strictParseFloat, + strictParseInt32 as __strictParseInt32, + strictParseLong as __strictParseLong, + strictParseShort as __strictParseShort, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { + AllQueryStringTypesCommandInput, + AllQueryStringTypesCommandOutput, +} from "../commands/AllQueryStringTypesCommand"; +import { BodyWithXmlNameCommandInput, BodyWithXmlNameCommandOutput } from "../commands/BodyWithXmlNameCommand"; +import { + ConstantAndVariableQueryStringCommandInput, + ConstantAndVariableQueryStringCommandOutput, +} from "../commands/ConstantAndVariableQueryStringCommand"; +import { + ConstantQueryStringCommandInput, + ConstantQueryStringCommandOutput, +} from "../commands/ConstantQueryStringCommand"; +import { + ContentTypeParametersCommandInput, + ContentTypeParametersCommandOutput, +} from "../commands/ContentTypeParametersCommand"; +import { DatetimeOffsetsCommandInput, DatetimeOffsetsCommandOutput } from "../commands/DatetimeOffsetsCommand"; +import { + EmptyInputAndEmptyOutputCommandInput, + EmptyInputAndEmptyOutputCommandOutput, +} from "../commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommandInput, EndpointOperationCommandOutput } from "../commands/EndpointOperationCommand"; +import { + EndpointWithHostLabelHeaderOperationCommandInput, + EndpointWithHostLabelHeaderOperationCommandOutput, +} from "../commands/EndpointWithHostLabelHeaderOperationCommand"; +import { + EndpointWithHostLabelOperationCommandInput, + EndpointWithHostLabelOperationCommandOutput, +} from "../commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommandInput, FlattenedXmlMapCommandOutput } from "../commands/FlattenedXmlMapCommand"; +import { + FlattenedXmlMapWithXmlNameCommandInput, + FlattenedXmlMapWithXmlNameCommandOutput, +} from "../commands/FlattenedXmlMapWithXmlNameCommand"; +import { + FlattenedXmlMapWithXmlNamespaceCommandInput, + FlattenedXmlMapWithXmlNamespaceCommandOutput, +} from "../commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "../commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "../commands/GreetingWithErrorsCommand"; +import { + HttpEmptyPrefixHeadersCommandInput, + HttpEmptyPrefixHeadersCommandOutput, +} from "../commands/HttpEmptyPrefixHeadersCommand"; +import { HttpEnumPayloadCommandInput, HttpEnumPayloadCommandOutput } from "../commands/HttpEnumPayloadCommand"; +import { HttpPayloadTraitsCommandInput, HttpPayloadTraitsCommandOutput } from "../commands/HttpPayloadTraitsCommand"; +import { + HttpPayloadTraitsWithMediaTypeCommandInput, + HttpPayloadTraitsWithMediaTypeCommandOutput, +} from "../commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { + HttpPayloadWithMemberXmlNameCommandInput, + HttpPayloadWithMemberXmlNameCommandOutput, +} from "../commands/HttpPayloadWithMemberXmlNameCommand"; +import { + HttpPayloadWithStructureCommandInput, + HttpPayloadWithStructureCommandOutput, +} from "../commands/HttpPayloadWithStructureCommand"; +import { + HttpPayloadWithUnionCommandInput, + HttpPayloadWithUnionCommandOutput, +} from "../commands/HttpPayloadWithUnionCommand"; +import { + HttpPayloadWithXmlNameCommandInput, + HttpPayloadWithXmlNameCommandOutput, +} from "../commands/HttpPayloadWithXmlNameCommand"; +import { + HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + HttpPayloadWithXmlNamespaceAndPrefixCommandOutput, +} from "../commands/HttpPayloadWithXmlNamespaceAndPrefixCommand"; +import { + HttpPayloadWithXmlNamespaceCommandInput, + HttpPayloadWithXmlNamespaceCommandOutput, +} from "../commands/HttpPayloadWithXmlNamespaceCommand"; +import { HttpPrefixHeadersCommandInput, HttpPrefixHeadersCommandOutput } from "../commands/HttpPrefixHeadersCommand"; +import { + HttpRequestWithFloatLabelsCommandInput, + HttpRequestWithFloatLabelsCommandOutput, +} from "../commands/HttpRequestWithFloatLabelsCommand"; +import { + HttpRequestWithGreedyLabelInPathCommandInput, + HttpRequestWithGreedyLabelInPathCommandOutput, +} from "../commands/HttpRequestWithGreedyLabelInPathCommand"; +import { + HttpRequestWithLabelsAndTimestampFormatCommandInput, + HttpRequestWithLabelsAndTimestampFormatCommandOutput, +} from "../commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { + HttpRequestWithLabelsCommandInput, + HttpRequestWithLabelsCommandOutput, +} from "../commands/HttpRequestWithLabelsCommand"; +import { HttpResponseCodeCommandInput, HttpResponseCodeCommandOutput } from "../commands/HttpResponseCodeCommand"; +import { HttpStringPayloadCommandInput, HttpStringPayloadCommandOutput } from "../commands/HttpStringPayloadCommand"; +import { + IgnoreQueryParamsInResponseCommandInput, + IgnoreQueryParamsInResponseCommandOutput, +} from "../commands/IgnoreQueryParamsInResponseCommand"; +import { + InputAndOutputWithHeadersCommandInput, + InputAndOutputWithHeadersCommandOutput, +} from "../commands/InputAndOutputWithHeadersCommand"; +import { NestedXmlMapsCommandInput, NestedXmlMapsCommandOutput } from "../commands/NestedXmlMapsCommand"; +import { + NestedXmlMapWithXmlNameCommandInput, + NestedXmlMapWithXmlNameCommandOutput, +} from "../commands/NestedXmlMapWithXmlNameCommand"; +import { NoInputAndNoOutputCommandInput, NoInputAndNoOutputCommandOutput } from "../commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommandInput, NoInputAndOutputCommandOutput } from "../commands/NoInputAndOutputCommand"; +import { + NullAndEmptyHeadersClientCommandInput, + NullAndEmptyHeadersClientCommandOutput, +} from "../commands/NullAndEmptyHeadersClientCommand"; +import { + NullAndEmptyHeadersServerCommandInput, + NullAndEmptyHeadersServerCommandOutput, +} from "../commands/NullAndEmptyHeadersServerCommand"; +import { + OmitsNullSerializesEmptyStringCommandInput, + OmitsNullSerializesEmptyStringCommandOutput, +} from "../commands/OmitsNullSerializesEmptyStringCommand"; +import { + PutWithContentEncodingCommandInput, + PutWithContentEncodingCommandOutput, +} from "../commands/PutWithContentEncodingCommand"; +import { + QueryIdempotencyTokenAutoFillCommandInput, + QueryIdempotencyTokenAutoFillCommandOutput, +} from "../commands/QueryIdempotencyTokenAutoFillCommand"; +import { + QueryParamsAsStringListMapCommandInput, + QueryParamsAsStringListMapCommandOutput, +} from "../commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommandInput, QueryPrecedenceCommandOutput } from "../commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from "../commands/RecursiveShapesCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "../commands/SimpleScalarPropertiesCommand"; +import { + TimestampFormatHeadersCommandInput, + TimestampFormatHeadersCommandOutput, +} from "../commands/TimestampFormatHeadersCommand"; +import { XmlAttributesCommandInput, XmlAttributesCommandOutput } from "../commands/XmlAttributesCommand"; +import { + XmlAttributesOnPayloadCommandInput, + XmlAttributesOnPayloadCommandOutput, +} from "../commands/XmlAttributesOnPayloadCommand"; +import { XmlBlobsCommandInput, XmlBlobsCommandOutput } from "../commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommandInput, XmlEmptyBlobsCommandOutput } from "../commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommandInput, XmlEmptyListsCommandOutput } from "../commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommandInput, XmlEmptyMapsCommandOutput } from "../commands/XmlEmptyMapsCommand"; +import { XmlEmptyStringsCommandInput, XmlEmptyStringsCommandOutput } from "../commands/XmlEmptyStringsCommand"; +import { XmlEnumsCommandInput, XmlEnumsCommandOutput } from "../commands/XmlEnumsCommand"; +import { XmlIntEnumsCommandInput, XmlIntEnumsCommandOutput } from "../commands/XmlIntEnumsCommand"; +import { XmlListsCommandInput, XmlListsCommandOutput } from "../commands/XmlListsCommand"; +import { XmlMapsCommandInput, XmlMapsCommandOutput } from "../commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommandInput, XmlMapsXmlNameCommandOutput } from "../commands/XmlMapsXmlNameCommand"; +import { + XmlMapWithXmlNamespaceCommandInput, + XmlMapWithXmlNamespaceCommandOutput, +} from "../commands/XmlMapWithXmlNamespaceCommand"; +import { XmlNamespacesCommandInput, XmlNamespacesCommandOutput } from "../commands/XmlNamespacesCommand"; +import { XmlTimestampsCommandInput, XmlTimestampsCommandOutput } from "../commands/XmlTimestampsCommand"; +import { XmlUnionsCommandInput, XmlUnionsCommandOutput } from "../commands/XmlUnionsCommand"; +import { + ComplexError, + ComplexNestedErrorData, + FooEnum, + GreetingStruct, + IntegerEnum, + InvalidGreeting, + NestedPayload, + PayloadWithXmlName, + PayloadWithXmlNamespace, + PayloadWithXmlNamespaceAndPrefix, + RecursiveShapesInputOutputNested1, + RecursiveShapesInputOutputNested2, + StructureListMember, + UnionPayload, + XmlAttributesPayloadRequest, + XmlAttributesPayloadResponse, + XmlNamespaceNested, + XmlNestedUnionStruct, + XmlUnionShape, +} from "../models/models_0"; +import { RestXmlProtocolServiceException as __BaseException } from "../models/RestXmlProtocolServiceException"; + +/** + * serializeAws_restXmlAllQueryStringTypesCommand + */ +export const se_AllQueryStringTypesCommand = async ( + input: AllQueryStringTypesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/AllQueryStringTypesInput"); + const query: any = map({ + ...convertMap(input.queryParamsMapOfStrings), + [_S]: [, input[_qS]!], + [_SL]: [() => input.queryStringList !== void 0, () => input[_qSL]! || []], + [_SS]: [() => input.queryStringSet !== void 0, () => input[_qSS]! || []], + [_B]: [() => input.queryByte !== void 0, () => input[_qB]!.toString()], + [_Sh]: [() => input.queryShort !== void 0, () => input[_qSu]!.toString()], + [_I]: [() => input.queryInteger !== void 0, () => input[_qI]!.toString()], + [_IL]: [ + () => input.queryIntegerList !== void 0, + () => (input[_qIL]! || []).map((_entry) => _entry.toString() as any), + ], + [_IS]: [ + () => input.queryIntegerSet !== void 0, + () => (input[_qIS]! || []).map((_entry) => _entry.toString() as any), + ], + [_L]: [() => input.queryLong !== void 0, () => input[_qL]!.toString()], + [_F]: [ + () => input.queryFloat !== void 0, + () => (input[_qF]! % 1 == 0 ? input[_qF]! + ".0" : input[_qF]!.toString()), + ], + [_D]: [ + () => input.queryDouble !== void 0, + () => (input[_qD]! % 1 == 0 ? input[_qD]! + ".0" : input[_qD]!.toString()), + ], + [_DL]: [ + () => input.queryDoubleList !== void 0, + () => (input[_qDL]! || []).map((_entry) => (_entry % 1 == 0 ? _entry + ".0" : _entry.toString()) as any), + ], + [_Bo]: [() => input.queryBoolean !== void 0, () => input[_qBu]!.toString()], + [_BL]: [ + () => input.queryBooleanList !== void 0, + () => (input[_qBL]! || []).map((_entry) => _entry.toString() as any), + ], + [_T]: [() => input.queryTimestamp !== void 0, () => __serializeDateTime(input[_qT]!).toString()], + [_TL]: [ + () => input.queryTimestampList !== void 0, + () => (input[_qTL]! || []).map((_entry) => __serializeDateTime(_entry).toString() as any), + ], + [_E]: [, input[_qE]!], + [_EL]: [() => input.queryEnumList !== void 0, () => input[_qEL]! || []], + [_IE]: [() => input.queryIntegerEnum !== void 0, () => input[_qIE]!.toString()], + [_IEL]: [ + () => input.queryIntegerEnumList !== void 0, + () => (input[_qIEL]! || []).map((_entry) => _entry.toString() as any), + ], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlBodyWithXmlNameCommand + */ +export const se_BodyWithXmlNameCommand = async ( + input: BodyWithXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/BodyWithXmlName"); + let body: any; + body = _ve; + const bn = new __XmlNode(_A); + if (input[_n] != null) { + bn.c(se_PayloadWithXmlName(input[_n], context).n(_n)); + } + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlConstantAndVariableQueryStringCommand + */ +export const se_ConstantAndVariableQueryStringCommand = async ( + input: ConstantAndVariableQueryStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/ConstantAndVariableQueryString"); + const query: any = map({ + [_f]: [, "bar"], + [_b]: [, input[_b]!], + [_mS]: [, input[_mS]!], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlConstantQueryStringCommand + */ +export const se_ConstantQueryStringCommand = async ( + input: ConstantQueryStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/ConstantQueryString/{hello}"); + b.p("hello", () => input.hello!, "{hello}", false); + const query: any = map({ + [_f]: [, "bar"], + [_h]: [, ""], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlContentTypeParametersCommand + */ +export const se_ContentTypeParametersCommand = async ( + input: ContentTypeParametersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/ContentTypeParameters"); + let body: any; + body = _ve; + const bn = new __XmlNode(_CTPI); + if (input[_v] != null) { + bn.c(__XmlNode.of(_I, String(input[_v])).n(_v)); + } + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlDatetimeOffsetsCommand + */ +export const se_DatetimeOffsetsCommand = async ( + input: DatetimeOffsetsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/DatetimeOffsets"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlEmptyInputAndEmptyOutputCommand + */ +export const se_EmptyInputAndEmptyOutputCommand = async ( + input: EmptyInputAndEmptyOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/EmptyInputAndEmptyOutput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlEndpointOperationCommand + */ +export const se_EndpointOperationCommand = async ( + input: EndpointOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/EndpointOperation"); + let body: any; + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo." + resolvedHostname; + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + b.hn(resolvedHostname); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlEndpointWithHostLabelHeaderOperationCommand + */ +export const se_EndpointWithHostLabelHeaderOperationCommand = async ( + input: EndpointWithHostLabelHeaderOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xaai]: input[_aI]!, + }); + b.bp("/EndpointWithHostLabelHeaderOperation"); + let body: any; + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "{accountId}." + resolvedHostname; + if (input.accountId === undefined) { + throw new Error("Empty value provided for input host prefix: accountId."); + } + resolvedHostname = resolvedHostname.replace("{accountId}", input.accountId!); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + b.hn(resolvedHostname); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlEndpointWithHostLabelOperationCommand + */ +export const se_EndpointWithHostLabelOperationCommand = async ( + input: EndpointWithHostLabelOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/EndpointWithHostLabelOperation"); + let body: any; + body = _ve; + const bn = new __XmlNode(_EWHLOR); + if (input[_l] != null) { + bn.c(__XmlNode.of(_S, input[_l]).n(_l)); + } + body += bn.toString(); + let { hostname: resolvedHostname } = await context.endpoint(); + if (context.disableHostPrefix !== true) { + resolvedHostname = "foo.{label}." + resolvedHostname; + if (input.label === undefined) { + throw new Error("Empty value provided for input host prefix: label."); + } + resolvedHostname = resolvedHostname.replace("{label}", input.label!); + if (!__isValidHostname(resolvedHostname)) { + throw new Error("ValidationError: prefixed hostname must be hostname compatible."); + } + } + b.hn(resolvedHostname); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlFlattenedXmlMapCommand + */ +export const se_FlattenedXmlMapCommand = async ( + input: FlattenedXmlMapCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/FlattenedXmlMap"); + let body: any; + body = _ve; + const bn = new __XmlNode(_FXMR); + bn.l(input, "myMap", "myMap", () => se_FooEnumMap(input[_mM]!, context)); + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlFlattenedXmlMapWithXmlNameCommand + */ +export const se_FlattenedXmlMapWithXmlNameCommand = async ( + input: FlattenedXmlMapWithXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/FlattenedXmlMapWithXmlName"); + let body: any; + body = _ve; + const bn = new __XmlNode(_FXMWXNR); + bn.l(input, "myMap", "KVP", () => se_FlattenedXmlMapWithXmlNameInputOutputMap(input[_mM]!, context)); + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlFlattenedXmlMapWithXmlNamespaceCommand + */ +export const se_FlattenedXmlMapWithXmlNamespaceCommand = async ( + input: FlattenedXmlMapWithXmlNamespaceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/FlattenedXmlMapWithXmlNamespace"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlFractionalSecondsCommand + */ +export const se_FractionalSecondsCommand = async ( + input: FractionalSecondsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/FractionalSeconds"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlGreetingWithErrorsCommand + */ +export const se_GreetingWithErrorsCommand = async ( + input: GreetingWithErrorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/GreetingWithErrors"); + let body: any; + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpEmptyPrefixHeadersCommand + */ +export const se_HttpEmptyPrefixHeadersCommand = async ( + input: HttpEmptyPrefixHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + ...(input.prefixHeaders !== undefined && + Object.keys(input.prefixHeaders).reduce((acc: any, suffix: string) => { + acc[`${suffix.toLowerCase()}`] = input.prefixHeaders![suffix]; + return acc; + }, {})), + [_h]: input[_sH]!, + }); + b.bp("/HttpEmptyPrefixHeaders"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpEnumPayloadCommand + */ +export const se_HttpEnumPayloadCommand = async ( + input: HttpEnumPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "text/plain", + }; + b.bp("/EnumPayload"); + let body: any; + let contents: any; + if (input.payload !== undefined) { + contents = input.payload; + body = contents; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadTraitsCommand + */ +export const se_HttpPayloadTraitsCommand = async ( + input: HttpPayloadTraitsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/octet-stream", + [_xf]: input[_f]!, + }); + b.bp("/HttpPayloadTraits"); + let body: any; + let contents: any; + if (input.blob !== undefined) { + contents = input.blob; + body = contents; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadTraitsWithMediaTypeCommand + */ +export const se_HttpPayloadTraitsWithMediaTypeCommand = async ( + input: HttpPayloadTraitsWithMediaTypeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "text/plain", + [_xf]: input[_f]!, + }); + b.bp("/HttpPayloadTraitsWithMediaType"); + let body: any; + let contents: any; + if (input.blob !== undefined) { + contents = input.blob; + body = contents; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadWithMemberXmlNameCommand + */ +export const se_HttpPayloadWithMemberXmlNameCommand = async ( + input: HttpPayloadWithMemberXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/HttpPayloadWithMemberXmlName"); + let body: any; + let contents: any; + if (input.nested !== undefined) { + contents = se_PayloadWithXmlName(input.nested, context); + contents = contents.n("Hola"); + body = _ve; + body += contents.toString(); + } + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadWithStructureCommand + */ +export const se_HttpPayloadWithStructureCommand = async ( + input: HttpPayloadWithStructureCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/HttpPayloadWithStructure"); + let body: any; + let contents: any; + if (input.nested !== undefined) { + contents = se_NestedPayload(input.nested, context); + body = _ve; + body += contents.toString(); + } + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadWithUnionCommand + */ +export const se_HttpPayloadWithUnionCommand = async ( + input: HttpPayloadWithUnionCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/HttpPayloadWithUnion"); + let body: any; + let contents: any; + if (input.nested !== undefined) { + contents = se_UnionPayload(input.nested, context); + body = _ve; + body += contents.toString(); + } + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadWithXmlNameCommand + */ +export const se_HttpPayloadWithXmlNameCommand = async ( + input: HttpPayloadWithXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/HttpPayloadWithXmlName"); + let body: any; + let contents: any; + if (input.nested !== undefined) { + contents = se_PayloadWithXmlName(input.nested, context); + body = _ve; + body += contents.toString(); + } + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadWithXmlNamespaceCommand + */ +export const se_HttpPayloadWithXmlNamespaceCommand = async ( + input: HttpPayloadWithXmlNamespaceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/HttpPayloadWithXmlNamespace"); + let body: any; + let contents: any; + if (input.nested !== undefined) { + contents = se_PayloadWithXmlNamespace(input.nested, context); + body = _ve; + contents.a("xmlns", "http://foo.com"); + body += contents.toString(); + } + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPayloadWithXmlNamespaceAndPrefixCommand + */ +export const se_HttpPayloadWithXmlNamespaceAndPrefixCommand = async ( + input: HttpPayloadWithXmlNamespaceAndPrefixCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/HttpPayloadWithXmlNamespaceAndPrefix"); + let body: any; + let contents: any; + if (input.nested !== undefined) { + contents = se_PayloadWithXmlNamespaceAndPrefix(input.nested, context); + body = _ve; + contents.a("xmlns:baz", "http://foo.com"); + body += contents.toString(); + } + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpPrefixHeadersCommand + */ +export const se_HttpPrefixHeadersCommand = async ( + input: HttpPrefixHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + ...(input.fooMap !== undefined && + Object.keys(input.fooMap).reduce((acc: any, suffix: string) => { + acc[`x-foo-${suffix.toLowerCase()}`] = input.fooMap![suffix]; + return acc; + }, {})), + [_xf]: input[_f]!, + }); + b.bp("/HttpPrefixHeaders"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpRequestWithFloatLabelsCommand + */ +export const se_HttpRequestWithFloatLabelsCommand = async ( + input: HttpRequestWithFloatLabelsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/FloatHttpLabels/{float}/{double}"); + b.p("float", () => (input.float! % 1 == 0 ? input.float! + ".0" : input.float!.toString()), "{float}", false); + b.p("double", () => (input.double! % 1 == 0 ? input.double! + ".0" : input.double!.toString()), "{double}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpRequestWithGreedyLabelInPathCommand + */ +export const se_HttpRequestWithGreedyLabelInPathCommand = async ( + input: HttpRequestWithGreedyLabelInPathCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}"); + b.p("foo", () => input.foo!, "{foo}", false); + b.p("baz", () => input.baz!, "{baz+}", true); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpRequestWithLabelsCommand + */ +export const se_HttpRequestWithLabelsCommand = async ( + input: HttpRequestWithLabelsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}"); + b.p("string", () => input.string!, "{string}", false); + b.p("short", () => input.short!.toString(), "{short}", false); + b.p("integer", () => input.integer!.toString(), "{integer}", false); + b.p("long", () => input.long!.toString(), "{long}", false); + b.p("float", () => (input.float! % 1 == 0 ? input.float! + ".0" : input.float!.toString()), "{float}", false); + b.p("double", () => (input.double! % 1 == 0 ? input.double! + ".0" : input.double!.toString()), "{double}", false); + b.p("boolean", () => input.boolean!.toString(), "{boolean}", false); + b.p("timestamp", () => __serializeDateTime(input.timestamp!).toString(), "{timestamp}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpRequestWithLabelsAndTimestampFormatCommand + */ +export const se_HttpRequestWithLabelsAndTimestampFormatCommand = async ( + input: HttpRequestWithLabelsAndTimestampFormatCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp( + "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}" + ); + b.p( + "memberEpochSeconds", + () => (input.memberEpochSeconds!.getTime() / 1_000).toString(), + "{memberEpochSeconds}", + false + ); + b.p("memberHttpDate", () => __dateToUtcString(input.memberHttpDate!).toString(), "{memberHttpDate}", false); + b.p("memberDateTime", () => __serializeDateTime(input.memberDateTime!).toString(), "{memberDateTime}", false); + b.p("defaultFormat", () => __serializeDateTime(input.defaultFormat!).toString(), "{defaultFormat}", false); + b.p( + "targetEpochSeconds", + () => (input.targetEpochSeconds!.getTime() / 1_000).toString(), + "{targetEpochSeconds}", + false + ); + b.p("targetHttpDate", () => __dateToUtcString(input.targetHttpDate!).toString(), "{targetHttpDate}", false); + b.p("targetDateTime", () => __serializeDateTime(input.targetDateTime!).toString(), "{targetDateTime}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpResponseCodeCommand + */ +export const se_HttpResponseCodeCommand = async ( + input: HttpResponseCodeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/HttpResponseCode"); + let body: any; + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlHttpStringPayloadCommand + */ +export const se_HttpStringPayloadCommand = async ( + input: HttpStringPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "text/plain", + }; + b.bp("/StringPayload"); + let body: any; + let contents: any; + if (input.payload !== undefined) { + contents = input.payload; + body = contents; + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlIgnoreQueryParamsInResponseCommand + */ +export const se_IgnoreQueryParamsInResponseCommand = async ( + input: IgnoreQueryParamsInResponseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/IgnoreQueryParamsInResponse"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlInputAndOutputWithHeadersCommand + */ +export const se_InputAndOutputWithHeadersCommand = async ( + input: InputAndOutputWithHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xs]: input[_hS]!, + [_xb]: [() => isSerializableHeaderValue(input[_hB]), () => input[_hB]!.toString()], + [_xs_]: [() => isSerializableHeaderValue(input[_hSe]), () => input[_hSe]!.toString()], + [_xi]: [() => isSerializableHeaderValue(input[_hI]), () => input[_hI]!.toString()], + [_xl]: [() => isSerializableHeaderValue(input[_hL]), () => input[_hL]!.toString()], + [_xf_]: [ + () => isSerializableHeaderValue(input[_hF]), + () => (input[_hF]! % 1 == 0 ? input[_hF]! + ".0" : input[_hF]!.toString()), + ], + [_xd]: [ + () => isSerializableHeaderValue(input[_hD]), + () => (input[_hD]! % 1 == 0 ? input[_hD]! + ".0" : input[_hD]!.toString()), + ], + [_xb_]: [() => isSerializableHeaderValue(input[_hTB]), () => input[_hTB]!.toString()], + [_xb__]: [() => isSerializableHeaderValue(input[_hFB]), () => input[_hFB]!.toString()], + [_xs__]: [() => isSerializableHeaderValue(input[_hSL]), () => (input[_hSL]! || []).map(__quoteHeader).join(", ")], + [_xs___]: [() => isSerializableHeaderValue(input[_hSS]), () => (input[_hSS]! || []).map(__quoteHeader).join(", ")], + [_xi_]: [ + () => isSerializableHeaderValue(input[_hIL]), + () => (input[_hIL]! || []).map((_entry) => _entry.toString() as any).join(", "), + ], + [_xb___]: [ + () => isSerializableHeaderValue(input[_hBL]), + () => (input[_hBL]! || []).map((_entry) => _entry.toString() as any).join(", "), + ], + [_xt]: [ + () => isSerializableHeaderValue(input[_hTL]), + () => (input[_hTL]! || []).map((_entry) => __dateToUtcString(_entry).toString() as any).join(", "), + ], + [_xe]: input[_hE]!, + [_xe_]: [() => isSerializableHeaderValue(input[_hEL]), () => (input[_hEL]! || []).map(__quoteHeader).join(", ")], + }); + b.bp("/InputAndOutputWithHeaders"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlNestedXmlMapsCommand + */ +export const se_NestedXmlMapsCommand = async ( + input: NestedXmlMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/NestedXmlMaps"); + let body: any; + body = _ve; + const bn = new __XmlNode(_NXMR); + bn.l(input, "flatNestedMap", "flatNestedMap", () => se_NestedMap(input[_fNM]!, context)); + bn.lc(input, "nestedMap", "nestedMap", () => se_NestedMap(input[_nM]!, context)); + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlNestedXmlMapWithXmlNameCommand + */ +export const se_NestedXmlMapWithXmlNameCommand = async ( + input: NestedXmlMapWithXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/NestedXmlMapWithXmlName"); + let body: any; + body = _ve; + const bn = new __XmlNode(_NXMWXNR); + bn.lc(input, "nestedXmlMapWithXmlNameMap", "nestedXmlMapWithXmlNameMap", () => + se_NestedXmlMapWithXmlNameMap(input[_nXMWXNM]!, context) + ); + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlNoInputAndNoOutputCommand + */ +export const se_NoInputAndNoOutputCommand = async ( + input: NoInputAndNoOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/NoInputAndNoOutput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlNoInputAndOutputCommand + */ +export const se_NoInputAndOutputCommand = async ( + input: NoInputAndOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/NoInputAndOutputOutput"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlNullAndEmptyHeadersClientCommand + */ +export const se_NullAndEmptyHeadersClientCommand = async ( + input: NullAndEmptyHeadersClientCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xa]: input[_a]!, + [_xb____]: input[_b_]!, + [_xc]: [() => isSerializableHeaderValue(input[_c]), () => (input[_c]! || []).map(__quoteHeader).join(", ")], + }); + b.bp("/NullAndEmptyHeadersClient"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlNullAndEmptyHeadersServerCommand + */ +export const se_NullAndEmptyHeadersServerCommand = async ( + input: NullAndEmptyHeadersServerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xa]: input[_a]!, + [_xb____]: input[_b_]!, + [_xc]: [() => isSerializableHeaderValue(input[_c]), () => (input[_c]! || []).map(__quoteHeader).join(", ")], + }); + b.bp("/NullAndEmptyHeadersServer"); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlOmitsNullSerializesEmptyStringCommand + */ +export const se_OmitsNullSerializesEmptyStringCommand = async ( + input: OmitsNullSerializesEmptyStringCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/OmitsNullSerializesEmptyString"); + const query: any = map({ + [_N]: [, input[_nV]!], + [_Em]: [, input[_eS]!], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlPutWithContentEncodingCommand + */ +export const se_PutWithContentEncodingCommand = async ( + input: PutWithContentEncodingCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_ce]: input[_e]!, + }); + b.bp("/requestcompression/putcontentwithencoding"); + let body: any; + body = _ve; + const bn = new __XmlNode(_PWCEI); + if (input[_d] != null) { + bn.c(__XmlNode.of(_S, input[_d]).n(_d)); + } + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlQueryIdempotencyTokenAutoFillCommand + */ +export const se_QueryIdempotencyTokenAutoFillCommand = async ( + input: QueryIdempotencyTokenAutoFillCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/QueryIdempotencyTokenAutoFill"); + const query: any = map({ + [_t]: [, input[_t] ?? generateIdempotencyToken()], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlQueryParamsAsStringListMapCommand + */ +export const se_QueryParamsAsStringListMapCommand = async ( + input: QueryParamsAsStringListMapCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/StringListMap"); + const query: any = map({ + ...convertMap(input.foo), + [_co]: [, input[_q]!], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlQueryPrecedenceCommand + */ +export const se_QueryPrecedenceCommand = async ( + input: QueryPrecedenceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/Precedence"); + const query: any = map({ + ...convertMap(input.baz), + [_ba]: [, input[_f]!], + }); + let body: any; + b.m("POST").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlRecursiveShapesCommand + */ +export const se_RecursiveShapesCommand = async ( + input: RecursiveShapesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/RecursiveShapes"); + let body: any; + body = _ve; + const bn = new __XmlNode(_RSR); + if (input[_n] != null) { + bn.c(se_RecursiveShapesInputOutputNested1(input[_n], context).n(_n)); + } + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlSimpleScalarPropertiesCommand + */ +export const se_SimpleScalarPropertiesCommand = async ( + input: SimpleScalarPropertiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/xml", + [_xf]: input[_f]!, + }); + b.bp("/SimpleScalarProperties"); + let body: any; + body = _ve; + const bn = new __XmlNode(_SSPR); + if (input[_bV] != null) { + bn.c(__XmlNode.of(_B, String(input[_bV])).n(_bV)); + } + if (input[_dV] != null) { + bn.c(__XmlNode.of(_D, String(input[_dV])).n(_DD)); + } + if (input[_fBV] != null) { + bn.c(__XmlNode.of(_Bo, String(input[_fBV])).n(_fBV)); + } + if (input[_fV] != null) { + bn.c(__XmlNode.of(_F, String(input[_fV])).n(_fV)); + } + if (input[_iV] != null) { + bn.c(__XmlNode.of(_I, String(input[_iV])).n(_iV)); + } + if (input[_lV] != null) { + bn.c(__XmlNode.of(_L, String(input[_lV])).n(_lV)); + } + if (input[_sV] != null) { + bn.c(__XmlNode.of(_Sh, String(input[_sV])).n(_sV)); + } + if (input[_sVt] != null) { + bn.c(__XmlNode.of(_S, input[_sVt]).n(_sVt)); + } + if (input[_tBV] != null) { + bn.c(__XmlNode.of(_Bo, String(input[_tBV])).n(_tBV)); + } + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlTimestampFormatHeadersCommand + */ +export const se_TimestampFormatHeadersCommand = async ( + input: TimestampFormatHeadersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + [_xm]: [() => isSerializableHeaderValue(input[_mES]), () => (input[_mES]!.getTime() / 1_000).toString()], + [_xm_]: [() => isSerializableHeaderValue(input[_mHD]), () => __dateToUtcString(input[_mHD]!).toString()], + [_xm__]: [() => isSerializableHeaderValue(input[_mDT]), () => __serializeDateTime(input[_mDT]!).toString()], + [_xd_]: [() => isSerializableHeaderValue(input[_dF]), () => __dateToUtcString(input[_dF]!).toString()], + [_xt_]: [() => isSerializableHeaderValue(input[_tES]), () => (input[_tES]!.getTime() / 1_000).toString()], + [_xt__]: [() => isSerializableHeaderValue(input[_tHD]), () => __dateToUtcString(input[_tHD]!).toString()], + [_xt___]: [() => isSerializableHeaderValue(input[_tDT]), () => __serializeDateTime(input[_tDT]!).toString()], + }); + b.bp("/TimestampFormatHeaders"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlAttributesCommand + */ +export const se_XmlAttributesCommand = async ( + input: XmlAttributesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlAttributes"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XAR); + bn.a("test", input[_at]); + if (input[_f] != null) { + bn.c(__XmlNode.of(_S, input[_f]).n(_f)); + } + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlAttributesOnPayloadCommand + */ +export const se_XmlAttributesOnPayloadCommand = async ( + input: XmlAttributesOnPayloadCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlAttributesOnPayload"); + let body: any; + let contents: any; + if (input.payload !== undefined) { + contents = se_XmlAttributesPayloadRequest(input.payload, context); + body = _ve; + body += contents.toString(); + } + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlBlobsCommand + */ +export const se_XmlBlobsCommand = async ( + input: XmlBlobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlBlobs"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XBR); + if (input[_d] != null) { + bn.c(__XmlNode.of(_Bl, context.base64Encoder(input[_d])).n(_d)); + } + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlEmptyBlobsCommand + */ +export const se_XmlEmptyBlobsCommand = async ( + input: XmlEmptyBlobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlEmptyBlobs"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XEBR); + if (input[_d] != null) { + bn.c(__XmlNode.of(_Bl, context.base64Encoder(input[_d])).n(_d)); + } + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlEmptyListsCommand + */ +export const se_XmlEmptyListsCommand = async ( + input: XmlEmptyListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlEmptyLists"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XELR); + bn.lc(input, "booleanList", "booleanList", () => se_BooleanList(input[_bL]!, context)); + bn.lc(input, "enumList", "enumList", () => se_FooEnumList(input[_eL]!, context)); + bn.l(input, "flattenedList", "flattenedList", () => se_RenamedListMembers(input[_fL]!, context)); + bn.l(input, "flattenedList2", "customName", () => se_RenamedListMembers(input[_fLl]!, context)); + bn.l(input, "flattenedListWithMemberNamespace", "flattenedListWithMemberNamespace", () => + se_ListWithMemberNamespace(input[_fLWMN]!, context) + ); + bn.l(input, "flattenedListWithNamespace", "flattenedListWithNamespace", () => + se_ListWithNamespace(input[_fLWN]!, context) + ); + bn.l(input, "flattenedStructureList", "flattenedStructureList", () => se_StructureList(input[_fSL]!, context)); + bn.lc(input, "intEnumList", "intEnumList", () => se_IntegerEnumList(input[_iEL]!, context)); + bn.lc(input, "integerList", "integerList", () => se_IntegerList(input[_iL]!, context)); + bn.lc(input, "nestedStringList", "nestedStringList", () => se_NestedStringList(input[_nSL]!, context)); + bn.lc(input, "renamedListMembers", "renamed", () => se_RenamedListMembers(input[_rLM]!, context)); + bn.lc(input, "stringList", "stringList", () => se_StringList(input[_sL]!, context)); + bn.lc(input, "stringSet", "stringSet", () => se_StringSet(input[_sS]!, context)); + bn.lc(input, "structureList", "myStructureList", () => se_StructureList(input[_sLt]!, context)); + bn.lc(input, "timestampList", "timestampList", () => se_TimestampList(input[_tL]!, context)); + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlEmptyMapsCommand + */ +export const se_XmlEmptyMapsCommand = async ( + input: XmlEmptyMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlEmptyMaps"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XEMR); + bn.lc(input, "myMap", "myMap", () => se_XmlMapsInputOutputMap(input[_mM]!, context)); + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlEmptyStringsCommand + */ +export const se_XmlEmptyStringsCommand = async ( + input: XmlEmptyStringsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlEmptyStrings"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XESR); + if (input[_eS] != null) { + bn.c(__XmlNode.of(_S, input[_eS]).n(_eS)); + } + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlEnumsCommand + */ +export const se_XmlEnumsCommand = async ( + input: XmlEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlEnums"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XER); + if (input[_fE] != null) { + bn.c(__XmlNode.of(_FE, input[_fE]).n(_fE)); + } + if (input[_fEo] != null) { + bn.c(__XmlNode.of(_FE, input[_fEo]).n(_fEo)); + } + if (input[_fEoo] != null) { + bn.c(__XmlNode.of(_FE, input[_fEoo]).n(_fEoo)); + } + bn.lc(input, "fooEnumList", "fooEnumList", () => se_FooEnumList(input[_fEL]!, context)); + bn.lc(input, "fooEnumMap", "fooEnumMap", () => se_FooEnumMap(input[_fEM]!, context)); + bn.lc(input, "fooEnumSet", "fooEnumSet", () => se_FooEnumSet(input[_fES]!, context)); + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlIntEnumsCommand + */ +export const se_XmlIntEnumsCommand = async ( + input: XmlIntEnumsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlIntEnums"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XIER); + if (input[_iE] != null) { + bn.c(__XmlNode.of(_IE, String(input[_iE])).n(_iE)); + } + if (input[_iEn] != null) { + bn.c(__XmlNode.of(_IE, String(input[_iEn])).n(_iEn)); + } + if (input[_iEnt] != null) { + bn.c(__XmlNode.of(_IE, String(input[_iEnt])).n(_iEnt)); + } + bn.lc(input, "intEnumList", "intEnumList", () => se_IntegerEnumList(input[_iEL]!, context)); + bn.lc(input, "intEnumMap", "intEnumMap", () => se_IntegerEnumMap(input[_iEM]!, context)); + bn.lc(input, "intEnumSet", "intEnumSet", () => se_IntegerEnumSet(input[_iES]!, context)); + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlListsCommand + */ +export const se_XmlListsCommand = async ( + input: XmlListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlLists"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XLR); + bn.lc(input, "booleanList", "booleanList", () => se_BooleanList(input[_bL]!, context)); + bn.lc(input, "enumList", "enumList", () => se_FooEnumList(input[_eL]!, context)); + bn.l(input, "flattenedList", "flattenedList", () => se_RenamedListMembers(input[_fL]!, context)); + bn.l(input, "flattenedList2", "customName", () => se_RenamedListMembers(input[_fLl]!, context)); + bn.l(input, "flattenedListWithMemberNamespace", "flattenedListWithMemberNamespace", () => + se_ListWithMemberNamespace(input[_fLWMN]!, context) + ); + bn.l(input, "flattenedListWithNamespace", "flattenedListWithNamespace", () => + se_ListWithNamespace(input[_fLWN]!, context) + ); + bn.l(input, "flattenedStructureList", "flattenedStructureList", () => se_StructureList(input[_fSL]!, context)); + bn.lc(input, "intEnumList", "intEnumList", () => se_IntegerEnumList(input[_iEL]!, context)); + bn.lc(input, "integerList", "integerList", () => se_IntegerList(input[_iL]!, context)); + bn.lc(input, "nestedStringList", "nestedStringList", () => se_NestedStringList(input[_nSL]!, context)); + bn.lc(input, "renamedListMembers", "renamed", () => se_RenamedListMembers(input[_rLM]!, context)); + bn.lc(input, "stringList", "stringList", () => se_StringList(input[_sL]!, context)); + bn.lc(input, "stringSet", "stringSet", () => se_StringSet(input[_sS]!, context)); + bn.lc(input, "structureList", "myStructureList", () => se_StructureList(input[_sLt]!, context)); + bn.lc(input, "timestampList", "timestampList", () => se_TimestampList(input[_tL]!, context)); + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlMapsCommand + */ +export const se_XmlMapsCommand = async ( + input: XmlMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlMaps"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XMR); + bn.lc(input, "myMap", "myMap", () => se_XmlMapsInputOutputMap(input[_mM]!, context)); + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlMapsXmlNameCommand + */ +export const se_XmlMapsXmlNameCommand = async ( + input: XmlMapsXmlNameCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlMapsXmlName"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XMXNR); + bn.lc(input, "myMap", "myMap", () => se_XmlMapsXmlNameInputOutputMap(input[_mM]!, context)); + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlMapWithXmlNamespaceCommand + */ +export const se_XmlMapWithXmlNamespaceCommand = async ( + input: XmlMapWithXmlNamespaceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlMapWithXmlNamespace"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XMWXNR); + if (input[_mM] != null) { + const ns = se_XmlMapWithXmlNamespaceInputOutputMap(input[_mM], context); + const containerNode = new __XmlNode(_KVP); + containerNode.a("xmlns", "https://the-member.example.com"); + ns.map((n: any) => { + containerNode.c(n); + }); + bn.c(containerNode); + } + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlNamespacesCommand + */ +export const se_XmlNamespacesCommand = async ( + input: XmlNamespacesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlNamespaces"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XNR); + bn.a("xmlns", "http://foo.com"); + if (input[_n] != null) { + bn.c(se_XmlNamespaceNested(input[_n], context).n(_n)); + } + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlTimestampsCommand + */ +export const se_XmlTimestampsCommand = async ( + input: XmlTimestampsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlTimestamps"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XTR); + if (input[_dT] != null) { + bn.c(__XmlNode.of(_T, __serializeDateTime(input[_dT]).toString()).n(_dT)); + } + if (input[_dTOT] != null) { + bn.c(__XmlNode.of(_DT, __serializeDateTime(input[_dTOT]).toString()).n(_dTOT)); + } + if (input[_eSp] != null) { + bn.c(__XmlNode.of(_T, (input[_eSp].getTime() / 1_000).toString()).n(_eSp)); + } + if (input[_eSOT] != null) { + bn.c(__XmlNode.of(_ES, (input[_eSOT].getTime() / 1_000).toString()).n(_eSOT)); + } + if (input[_hDt] != null) { + bn.c(__XmlNode.of(_T, __dateToUtcString(input[_hDt]).toString()).n(_hDt)); + } + if (input[_hDOT] != null) { + bn.c(__XmlNode.of(_HD, __dateToUtcString(input[_hDOT]).toString()).n(_hDOT)); + } + if (input[_no] != null) { + bn.c(__XmlNode.of(_T, __serializeDateTime(input[_no])).n(_no)); + } + body += bn.toString(); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restXmlXmlUnionsCommand + */ +export const se_XmlUnionsCommand = async ( + input: XmlUnionsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/xml", + }; + b.bp("/XmlUnions"); + let body: any; + body = _ve; + const bn = new __XmlNode(_XUR); + if (input[_uV] != null) { + bn.c(se_XmlUnionShape(input[_uV], context).n(_uV)); + } + body += bn.toString(); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + +/** + * deserializeAws_restXmlAllQueryStringTypesCommand + */ +export const de_AllQueryStringTypesCommand = 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_restXmlBodyWithXmlNameCommand + */ +export const de_BodyWithXmlNameCommand = 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"); + if (data[_n] != null) { + contents[_n] = de_PayloadWithXmlName(data[_n], context); + } + return contents; +}; + +/** + * deserializeAws_restXmlConstantAndVariableQueryStringCommand + */ +export const de_ConstantAndVariableQueryStringCommand = 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_restXmlConstantQueryStringCommand + */ +export const de_ConstantQueryStringCommand = 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_restXmlContentTypeParametersCommand + */ +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_restXmlDatetimeOffsetsCommand + */ +export const de_DatetimeOffsetsCommand = 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"); + if (data[_da] != null) { + contents[_da] = __expectNonNull(__parseRfc3339DateTimeWithOffset(data[_da])); + } + return contents; +}; + +/** + * deserializeAws_restXmlEmptyInputAndEmptyOutputCommand + */ +export const de_EmptyInputAndEmptyOutputCommand = 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_restXmlEndpointOperationCommand + */ +export const de_EndpointOperationCommand = 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_restXmlEndpointWithHostLabelHeaderOperationCommand + */ +export const de_EndpointWithHostLabelHeaderOperationCommand = 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_restXmlEndpointWithHostLabelOperationCommand + */ +export const de_EndpointWithHostLabelOperationCommand = 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_restXmlFlattenedXmlMapCommand + */ +export const de_FlattenedXmlMapCommand = 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"); + if (data.myMap === "") { + contents[_mM] = {}; + } else if (data[_mM] != null) { + contents[_mM] = de_FooEnumMap(__getArrayIfSingleItem(data[_mM]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlFlattenedXmlMapWithXmlNameCommand + */ +export const de_FlattenedXmlMapWithXmlNameCommand = 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"); + if (data.KVP === "") { + contents[_mM] = {}; + } else if (data[_KVP] != null) { + contents[_mM] = de_FlattenedXmlMapWithXmlNameInputOutputMap(__getArrayIfSingleItem(data[_KVP]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlFlattenedXmlMapWithXmlNamespaceCommand + */ +export const de_FlattenedXmlMapWithXmlNamespaceCommand = 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"); + if (data.KVP === "") { + contents[_mM] = {}; + } else if (data[_KVP] != null) { + contents[_mM] = de_FlattenedXmlMapWithXmlNamespaceOutputMap(__getArrayIfSingleItem(data[_KVP]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlFractionalSecondsCommand + */ +export const de_FractionalSecondsCommand = 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"); + if (data[_da] != null) { + contents[_da] = __expectNonNull(__parseRfc3339DateTimeWithOffset(data[_da])); + } + return contents; +}; + +/** + * deserializeAws_restXmlGreetingWithErrorsCommand + */ +export const de_GreetingWithErrorsCommand = 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), + [_g]: [, output.headers[_xg]], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpEmptyPrefixHeadersCommand + */ +export const de_HttpEmptyPrefixHeadersCommand = 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), + [_sH]: [, output.headers[_h]], + prefixHeaders: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("")) + .reduce((acc, header) => { + acc[header.substring(0)] = output.headers[header]; + return acc; + }, {} as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpEnumPayloadCommand + */ +export const de_HttpEnumPayloadCommand = 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: any = await collectBodyString(output.body, context); + contents.payload = __expectString(data); + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadTraitsCommand + */ +export const de_HttpPayloadTraitsCommand = 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), + [_f]: [, output.headers[_xf]], + }); + const data: any = await collectBody(output.body, context); + contents.blob = data; + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadTraitsWithMediaTypeCommand + */ +export const de_HttpPayloadTraitsWithMediaTypeCommand = 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), + [_f]: [, output.headers[_xf]], + }); + const data: any = await collectBody(output.body, context); + contents.blob = data; + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadWithMemberXmlNameCommand + */ +export const de_HttpPayloadWithMemberXmlNameCommand = 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 | undefined = __expectObject(await parseBody(output.body, context)); + contents.nested = de_PayloadWithXmlName(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadWithStructureCommand + */ +export const de_HttpPayloadWithStructureCommand = 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 | undefined = __expectObject(await parseBody(output.body, context)); + contents.nested = de_NestedPayload(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadWithUnionCommand + */ +export const de_HttpPayloadWithUnionCommand = 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 | undefined = await parseBody(output.body, context); + if (Object.keys(data ?? {}).length) { + contents.nested = __expectUnion(de_UnionPayload(data, context)); + } + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadWithXmlNameCommand + */ +export const de_HttpPayloadWithXmlNameCommand = 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 | undefined = __expectObject(await parseBody(output.body, context)); + contents.nested = de_PayloadWithXmlName(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadWithXmlNamespaceCommand + */ +export const de_HttpPayloadWithXmlNamespaceCommand = 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 | undefined = __expectObject(await parseBody(output.body, context)); + contents.nested = de_PayloadWithXmlNamespace(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpPayloadWithXmlNamespaceAndPrefixCommand + */ +export const de_HttpPayloadWithXmlNamespaceAndPrefixCommand = 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 | undefined = __expectObject(await parseBody(output.body, context)); + contents.nested = de_PayloadWithXmlNamespaceAndPrefix(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpPrefixHeadersCommand + */ +export const de_HttpPrefixHeadersCommand = 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), + [_f]: [, output.headers[_xf]], + fooMap: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("x-foo-")) + .reduce((acc, header) => { + acc[header.substring(6)] = output.headers[header]; + return acc; + }, {} as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpRequestWithFloatLabelsCommand + */ +export const de_HttpRequestWithFloatLabelsCommand = 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_restXmlHttpRequestWithGreedyLabelInPathCommand + */ +export const de_HttpRequestWithGreedyLabelInPathCommand = 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_restXmlHttpRequestWithLabelsCommand + */ +export const de_HttpRequestWithLabelsCommand = 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_restXmlHttpRequestWithLabelsAndTimestampFormatCommand + */ +export const de_HttpRequestWithLabelsAndTimestampFormatCommand = 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_restXmlHttpResponseCodeCommand + */ +export const de_HttpResponseCodeCommand = 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), + }); + map(contents, { + Status: [, output.statusCode], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlHttpStringPayloadCommand + */ +export const de_HttpStringPayloadCommand = 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: any = await collectBodyString(output.body, context); + contents.payload = __expectString(data); + return contents; +}; + +/** + * deserializeAws_restXmlIgnoreQueryParamsInResponseCommand + */ +export const de_IgnoreQueryParamsInResponseCommand = 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"); + if (data[_b] != null) { + contents[_b] = __expectString(data[_b]); + } + return contents; +}; + +/** + * deserializeAws_restXmlInputAndOutputWithHeadersCommand + */ +export const de_InputAndOutputWithHeadersCommand = 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), + [_hS]: [, output.headers[_xs]], + [_hB]: [() => void 0 !== output.headers[_xb], () => __strictParseByte(output.headers[_xb])], + [_hSe]: [() => void 0 !== output.headers[_xs_], () => __strictParseShort(output.headers[_xs_])], + [_hI]: [() => void 0 !== output.headers[_xi], () => __strictParseInt32(output.headers[_xi])], + [_hL]: [() => void 0 !== output.headers[_xl], () => __strictParseLong(output.headers[_xl])], + [_hF]: [() => void 0 !== output.headers[_xf_], () => __strictParseFloat(output.headers[_xf_])], + [_hD]: [() => void 0 !== output.headers[_xd], () => __strictParseDouble(output.headers[_xd])], + [_hTB]: [() => void 0 !== output.headers[_xb_], () => __parseBoolean(output.headers[_xb_])], + [_hFB]: [() => void 0 !== output.headers[_xb__], () => __parseBoolean(output.headers[_xb__])], + [_hSL]: [ + () => void 0 !== output.headers[_xs__], + () => __splitHeader(output.headers[_xs__] || "").map((_entry) => _entry.trim() as any), + ], + [_hSS]: [ + () => void 0 !== output.headers[_xs___], + () => __splitHeader(output.headers[_xs___] || "").map((_entry) => _entry.trim() as any), + ], + [_hIL]: [ + () => void 0 !== output.headers[_xi_], + () => __splitHeader(output.headers[_xi_] || "").map((_entry) => __strictParseInt32(_entry.trim()) as any), + ], + [_hBL]: [ + () => void 0 !== output.headers[_xb___], + () => __splitHeader(output.headers[_xb___] || "").map((_entry) => __parseBoolean(_entry.trim()) as any), + ], + [_hTL]: [ + () => void 0 !== output.headers[_xt], + () => + __splitEvery(output.headers[_xt] || "", ",", 2).map( + (_entry) => __expectNonNull(__parseRfc7231DateTime(_entry.trim())) as any + ), + ], + [_hE]: [, output.headers[_xe]], + [_hEL]: [ + () => void 0 !== output.headers[_xe_], + () => __splitHeader(output.headers[_xe_] || "").map((_entry) => _entry.trim() as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlNestedXmlMapsCommand + */ +export const de_NestedXmlMapsCommand = 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"); + if (data.flatNestedMap === "") { + contents[_fNM] = {}; + } else if (data[_fNM] != null) { + contents[_fNM] = de_NestedMap(__getArrayIfSingleItem(data[_fNM]), context); + } + if (data.nestedMap === "") { + contents[_nM] = {}; + } else if (data[_nM] != null && data[_nM][_en] != null) { + contents[_nM] = de_NestedMap(__getArrayIfSingleItem(data[_nM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlNestedXmlMapWithXmlNameCommand + */ +export const de_NestedXmlMapWithXmlNameCommand = 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"); + if (data.nestedXmlMapWithXmlNameMap === "") { + contents[_nXMWXNM] = {}; + } else if (data[_nXMWXNM] != null && data[_nXMWXNM][_en] != null) { + contents[_nXMWXNM] = de_NestedXmlMapWithXmlNameMap(__getArrayIfSingleItem(data[_nXMWXNM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlNoInputAndNoOutputCommand + */ +export const de_NoInputAndNoOutputCommand = 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_restXmlNoInputAndOutputCommand + */ +export const de_NoInputAndOutputCommand = 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_restXmlNullAndEmptyHeadersClientCommand + */ +export const de_NullAndEmptyHeadersClientCommand = 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), + [_a]: [, output.headers[_xa]], + [_b_]: [, output.headers[_xb____]], + [_c]: [ + () => void 0 !== output.headers[_xc], + () => __splitHeader(output.headers[_xc] || "").map((_entry) => _entry.trim() as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlNullAndEmptyHeadersServerCommand + */ +export const de_NullAndEmptyHeadersServerCommand = 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), + [_a]: [, output.headers[_xa]], + [_b_]: [, output.headers[_xb____]], + [_c]: [ + () => void 0 !== output.headers[_xc], + () => __splitHeader(output.headers[_xc] || "").map((_entry) => _entry.trim() as any), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlOmitsNullSerializesEmptyStringCommand + */ +export const de_OmitsNullSerializesEmptyStringCommand = 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_restXmlPutWithContentEncodingCommand + */ +export const de_PutWithContentEncodingCommand = 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_restXmlQueryIdempotencyTokenAutoFillCommand + */ +export const de_QueryIdempotencyTokenAutoFillCommand = 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_restXmlQueryParamsAsStringListMapCommand + */ +export const de_QueryParamsAsStringListMapCommand = 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_restXmlQueryPrecedenceCommand + */ +export const de_QueryPrecedenceCommand = 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_restXmlRecursiveShapesCommand + */ +export const de_RecursiveShapesCommand = 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"); + if (data[_n] != null) { + contents[_n] = de_RecursiveShapesInputOutputNested1(data[_n], context); + } + return contents; +}; + +/** + * deserializeAws_restXmlSimpleScalarPropertiesCommand + */ +export const de_SimpleScalarPropertiesCommand = 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), + [_f]: [, output.headers[_xf]], + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_bV] != null) { + contents[_bV] = __strictParseByte(data[_bV]) as number; + } + if (data[_DD] != null) { + contents[_dV] = __strictParseFloat(data[_DD]) as number; + } + if (data[_fBV] != null) { + contents[_fBV] = __parseBoolean(data[_fBV]); + } + if (data[_fV] != null) { + contents[_fV] = __strictParseFloat(data[_fV]) as number; + } + if (data[_iV] != null) { + contents[_iV] = __strictParseInt32(data[_iV]) as number; + } + if (data[_lV] != null) { + contents[_lV] = __strictParseLong(data[_lV]) as number; + } + if (data[_sV] != null) { + contents[_sV] = __strictParseShort(data[_sV]) as number; + } + if (data[_sVt] != null) { + contents[_sVt] = __expectString(data[_sVt]); + } + if (data[_tBV] != null) { + contents[_tBV] = __parseBoolean(data[_tBV]); + } + return contents; +}; + +/** + * deserializeAws_restXmlTimestampFormatHeadersCommand + */ +export const de_TimestampFormatHeadersCommand = 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), + [_mES]: [() => void 0 !== output.headers[_xm], () => __expectNonNull(__parseEpochTimestamp(output.headers[_xm]))], + [_mHD]: [ + () => void 0 !== output.headers[_xm_], + () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xm_])), + ], + [_mDT]: [ + () => void 0 !== output.headers[_xm__], + () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xm__])), + ], + [_dF]: [() => void 0 !== output.headers[_xd_], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xd_]))], + [_tES]: [() => void 0 !== output.headers[_xt_], () => __expectNonNull(__parseEpochTimestamp(output.headers[_xt_]))], + [_tHD]: [ + () => void 0 !== output.headers[_xt__], + () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xt__])), + ], + [_tDT]: [ + () => void 0 !== output.headers[_xt___], + () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xt___])), + ], + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restXmlXmlAttributesCommand + */ +export const de_XmlAttributesCommand = 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"); + if (data[_te] != null) { + contents[_at] = __expectString(data[_te]); + } + if (data[_f] != null) { + contents[_f] = __expectString(data[_f]); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlAttributesOnPayloadCommand + */ +export const de_XmlAttributesOnPayloadCommand = 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 | undefined = __expectObject(await parseBody(output.body, context)); + contents.payload = de_XmlAttributesPayloadResponse(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlXmlBlobsCommand + */ +export const de_XmlBlobsCommand = 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"); + if (data[_d] != null) { + contents[_d] = context.base64Decoder(data[_d]); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlEmptyBlobsCommand + */ +export const de_XmlEmptyBlobsCommand = 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"); + if (data[_d] != null) { + contents[_d] = context.base64Decoder(data[_d]); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlEmptyListsCommand + */ +export const de_XmlEmptyListsCommand = 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"); + if (data.booleanList === "") { + contents[_bL] = []; + } else if (data[_bL] != null && data[_bL][_m] != null) { + contents[_bL] = de_BooleanList(__getArrayIfSingleItem(data[_bL][_m]), context); + } + if (data.enumList === "") { + contents[_eL] = []; + } else if (data[_eL] != null && data[_eL][_m] != null) { + contents[_eL] = de_FooEnumList(__getArrayIfSingleItem(data[_eL][_m]), context); + } + if (data.flattenedList === "") { + contents[_fL] = []; + } else if (data[_fL] != null) { + contents[_fL] = de_RenamedListMembers(__getArrayIfSingleItem(data[_fL]), context); + } + if (data.customName === "") { + contents[_fLl] = []; + } else if (data[_cN] != null) { + contents[_fLl] = de_RenamedListMembers(__getArrayIfSingleItem(data[_cN]), context); + } + if (data.flattenedListWithMemberNamespace === "") { + contents[_fLWMN] = []; + } else if (data[_fLWMN] != null) { + contents[_fLWMN] = de_ListWithMemberNamespace(__getArrayIfSingleItem(data[_fLWMN]), context); + } + if (data.flattenedListWithNamespace === "") { + contents[_fLWN] = []; + } else if (data[_fLWN] != null) { + contents[_fLWN] = de_ListWithNamespace(__getArrayIfSingleItem(data[_fLWN]), context); + } + if (data.flattenedStructureList === "") { + contents[_fSL] = []; + } else if (data[_fSL] != null) { + contents[_fSL] = de_StructureList(__getArrayIfSingleItem(data[_fSL]), context); + } + if (data.intEnumList === "") { + contents[_iEL] = []; + } else if (data[_iEL] != null && data[_iEL][_m] != null) { + contents[_iEL] = de_IntegerEnumList(__getArrayIfSingleItem(data[_iEL][_m]), context); + } + if (data.integerList === "") { + contents[_iL] = []; + } else if (data[_iL] != null && data[_iL][_m] != null) { + contents[_iL] = de_IntegerList(__getArrayIfSingleItem(data[_iL][_m]), context); + } + if (data.nestedStringList === "") { + contents[_nSL] = []; + } else if (data[_nSL] != null && data[_nSL][_m] != null) { + contents[_nSL] = de_NestedStringList(__getArrayIfSingleItem(data[_nSL][_m]), context); + } + if (data.renamed === "") { + contents[_rLM] = []; + } else if (data[_r] != null && data[_r][_i] != null) { + contents[_rLM] = de_RenamedListMembers(__getArrayIfSingleItem(data[_r][_i]), context); + } + if (data.stringList === "") { + contents[_sL] = []; + } else if (data[_sL] != null && data[_sL][_m] != null) { + contents[_sL] = de_StringList(__getArrayIfSingleItem(data[_sL][_m]), context); + } + if (data.stringSet === "") { + contents[_sS] = []; + } else if (data[_sS] != null && data[_sS][_m] != null) { + contents[_sS] = de_StringSet(__getArrayIfSingleItem(data[_sS][_m]), context); + } + if (data.myStructureList === "") { + contents[_sLt] = []; + } else if (data[_mSL] != null && data[_mSL][_i] != null) { + contents[_sLt] = de_StructureList(__getArrayIfSingleItem(data[_mSL][_i]), context); + } + if (data.timestampList === "") { + contents[_tL] = []; + } else if (data[_tL] != null && data[_tL][_m] != null) { + contents[_tL] = de_TimestampList(__getArrayIfSingleItem(data[_tL][_m]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlEmptyMapsCommand + */ +export const de_XmlEmptyMapsCommand = 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"); + if (data.myMap === "") { + contents[_mM] = {}; + } else if (data[_mM] != null && data[_mM][_en] != null) { + contents[_mM] = de_XmlMapsInputOutputMap(__getArrayIfSingleItem(data[_mM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlEmptyStringsCommand + */ +export const de_XmlEmptyStringsCommand = 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"); + if (data[_eS] != null) { + contents[_eS] = __expectString(data[_eS]); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlEnumsCommand + */ +export const de_XmlEnumsCommand = 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"); + if (data[_fE] != null) { + contents[_fE] = __expectString(data[_fE]); + } + if (data[_fEo] != null) { + contents[_fEo] = __expectString(data[_fEo]); + } + if (data[_fEoo] != null) { + contents[_fEoo] = __expectString(data[_fEoo]); + } + if (data.fooEnumList === "") { + contents[_fEL] = []; + } else if (data[_fEL] != null && data[_fEL][_m] != null) { + contents[_fEL] = de_FooEnumList(__getArrayIfSingleItem(data[_fEL][_m]), context); + } + if (data.fooEnumMap === "") { + contents[_fEM] = {}; + } else if (data[_fEM] != null && data[_fEM][_en] != null) { + contents[_fEM] = de_FooEnumMap(__getArrayIfSingleItem(data[_fEM][_en]), context); + } + if (data.fooEnumSet === "") { + contents[_fES] = []; + } else if (data[_fES] != null && data[_fES][_m] != null) { + contents[_fES] = de_FooEnumSet(__getArrayIfSingleItem(data[_fES][_m]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlIntEnumsCommand + */ +export const de_XmlIntEnumsCommand = 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"); + if (data[_iE] != null) { + contents[_iE] = __strictParseInt32(data[_iE]) as number; + } + if (data[_iEn] != null) { + contents[_iEn] = __strictParseInt32(data[_iEn]) as number; + } + if (data[_iEnt] != null) { + contents[_iEnt] = __strictParseInt32(data[_iEnt]) as number; + } + if (data.intEnumList === "") { + contents[_iEL] = []; + } else if (data[_iEL] != null && data[_iEL][_m] != null) { + contents[_iEL] = de_IntegerEnumList(__getArrayIfSingleItem(data[_iEL][_m]), context); + } + if (data.intEnumMap === "") { + contents[_iEM] = {}; + } else if (data[_iEM] != null && data[_iEM][_en] != null) { + contents[_iEM] = de_IntegerEnumMap(__getArrayIfSingleItem(data[_iEM][_en]), context); + } + if (data.intEnumSet === "") { + contents[_iES] = []; + } else if (data[_iES] != null && data[_iES][_m] != null) { + contents[_iES] = de_IntegerEnumSet(__getArrayIfSingleItem(data[_iES][_m]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlListsCommand + */ +export const de_XmlListsCommand = 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"); + if (data.booleanList === "") { + contents[_bL] = []; + } else if (data[_bL] != null && data[_bL][_m] != null) { + contents[_bL] = de_BooleanList(__getArrayIfSingleItem(data[_bL][_m]), context); + } + if (data.enumList === "") { + contents[_eL] = []; + } else if (data[_eL] != null && data[_eL][_m] != null) { + contents[_eL] = de_FooEnumList(__getArrayIfSingleItem(data[_eL][_m]), context); + } + if (data.flattenedList === "") { + contents[_fL] = []; + } else if (data[_fL] != null) { + contents[_fL] = de_RenamedListMembers(__getArrayIfSingleItem(data[_fL]), context); + } + if (data.customName === "") { + contents[_fLl] = []; + } else if (data[_cN] != null) { + contents[_fLl] = de_RenamedListMembers(__getArrayIfSingleItem(data[_cN]), context); + } + if (data.flattenedListWithMemberNamespace === "") { + contents[_fLWMN] = []; + } else if (data[_fLWMN] != null) { + contents[_fLWMN] = de_ListWithMemberNamespace(__getArrayIfSingleItem(data[_fLWMN]), context); + } + if (data.flattenedListWithNamespace === "") { + contents[_fLWN] = []; + } else if (data[_fLWN] != null) { + contents[_fLWN] = de_ListWithNamespace(__getArrayIfSingleItem(data[_fLWN]), context); + } + if (data.flattenedStructureList === "") { + contents[_fSL] = []; + } else if (data[_fSL] != null) { + contents[_fSL] = de_StructureList(__getArrayIfSingleItem(data[_fSL]), context); + } + if (data.intEnumList === "") { + contents[_iEL] = []; + } else if (data[_iEL] != null && data[_iEL][_m] != null) { + contents[_iEL] = de_IntegerEnumList(__getArrayIfSingleItem(data[_iEL][_m]), context); + } + if (data.integerList === "") { + contents[_iL] = []; + } else if (data[_iL] != null && data[_iL][_m] != null) { + contents[_iL] = de_IntegerList(__getArrayIfSingleItem(data[_iL][_m]), context); + } + if (data.nestedStringList === "") { + contents[_nSL] = []; + } else if (data[_nSL] != null && data[_nSL][_m] != null) { + contents[_nSL] = de_NestedStringList(__getArrayIfSingleItem(data[_nSL][_m]), context); + } + if (data.renamed === "") { + contents[_rLM] = []; + } else if (data[_r] != null && data[_r][_i] != null) { + contents[_rLM] = de_RenamedListMembers(__getArrayIfSingleItem(data[_r][_i]), context); + } + if (data.stringList === "") { + contents[_sL] = []; + } else if (data[_sL] != null && data[_sL][_m] != null) { + contents[_sL] = de_StringList(__getArrayIfSingleItem(data[_sL][_m]), context); + } + if (data.stringSet === "") { + contents[_sS] = []; + } else if (data[_sS] != null && data[_sS][_m] != null) { + contents[_sS] = de_StringSet(__getArrayIfSingleItem(data[_sS][_m]), context); + } + if (data.myStructureList === "") { + contents[_sLt] = []; + } else if (data[_mSL] != null && data[_mSL][_i] != null) { + contents[_sLt] = de_StructureList(__getArrayIfSingleItem(data[_mSL][_i]), context); + } + if (data.timestampList === "") { + contents[_tL] = []; + } else if (data[_tL] != null && data[_tL][_m] != null) { + contents[_tL] = de_TimestampList(__getArrayIfSingleItem(data[_tL][_m]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlMapsCommand + */ +export const de_XmlMapsCommand = 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"); + if (data.myMap === "") { + contents[_mM] = {}; + } else if (data[_mM] != null && data[_mM][_en] != null) { + contents[_mM] = de_XmlMapsInputOutputMap(__getArrayIfSingleItem(data[_mM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlMapsXmlNameCommand + */ +export const de_XmlMapsXmlNameCommand = 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"); + if (data.myMap === "") { + contents[_mM] = {}; + } else if (data[_mM] != null && data[_mM][_en] != null) { + contents[_mM] = de_XmlMapsXmlNameInputOutputMap(__getArrayIfSingleItem(data[_mM][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlMapWithXmlNamespaceCommand + */ +export const de_XmlMapWithXmlNamespaceCommand = 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"); + if (data.KVP === "") { + contents[_mM] = {}; + } else if (data[_KVP] != null && data[_KVP][_en] != null) { + contents[_mM] = de_XmlMapWithXmlNamespaceInputOutputMap(__getArrayIfSingleItem(data[_KVP][_en]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlNamespacesCommand + */ +export const de_XmlNamespacesCommand = 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"); + if (data[_n] != null) { + contents[_n] = de_XmlNamespaceNested(data[_n], context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlTimestampsCommand + */ +export const de_XmlTimestampsCommand = 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"); + if (data[_dT] != null) { + contents[_dT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(data[_dT])); + } + if (data[_dTOT] != null) { + contents[_dTOT] = __expectNonNull(__parseRfc3339DateTimeWithOffset(data[_dTOT])); + } + if (data[_eSp] != null) { + contents[_eSp] = __expectNonNull(__parseEpochTimestamp(data[_eSp])); + } + if (data[_eSOT] != null) { + contents[_eSOT] = __expectNonNull(__parseEpochTimestamp(data[_eSOT])); + } + if (data[_hDt] != null) { + contents[_hDt] = __expectNonNull(__parseRfc7231DateTime(data[_hDt])); + } + if (data[_hDOT] != null) { + contents[_hDOT] = __expectNonNull(__parseRfc7231DateTime(data[_hDOT])); + } + if (data[_no] != null) { + contents[_no] = __expectNonNull(__parseRfc3339DateTimeWithOffset(data[_no])); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlUnionsCommand + */ +export const de_XmlUnionsCommand = 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"); + if (data.unionValue === "") { + // Pass empty tags. + } else if (data[_uV] != null) { + contents[_uV] = de_XmlUnionShape(__expectUnion(data[_uV]), context); + } + return contents; +}; + +/** + * deserialize_Aws_restXmlCommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.restxml#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.restxml#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Error, + errorCode, + }) as never; + } +}; + +const throwDefaultError = withBaseException(__BaseException); +/** + * deserializeAws_restXmlComplexErrorRes + */ +const de_ComplexErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({ + [_H]: [, parsedOutput.headers[_xh]], + }); + const data: any = parsedOutput.body.Error; + if (data[_Ne] != null) { + contents[_Ne] = de_ComplexNestedErrorData(data[_Ne], context); + } + if (data[_TLo] != null) { + contents[_TLo] = __expectString(data[_TLo]); + } + const exception = new ComplexError({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body.Error); +}; + +/** + * deserializeAws_restXmlInvalidGreetingRes + */ +const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body.Error; + if (data[_M] != null) { + contents[_M] = __expectString(data[_M]); + } + const exception = new InvalidGreeting({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body.Error); +}; + +/** + * serializeAws_restXmlFlattenedXmlMapWithXmlNameInputOutputMap + */ +const se_FlattenedXmlMapWithXmlNameInputOutputMap = (input: Record, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("K"); + entryNode.c(keyNode); + let n; + n = __XmlNode.of(_S, input[key as keyof typeof input]!); + entryNode.c(n.n(_V)); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlListWithMemberNamespace + */ +const se_ListWithMemberNamespace = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_S, entry); + n.a("xmlns", "https://xml-member.example.com"); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlListWithNamespace + */ +const se_ListWithNamespace = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_S, entry); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlNestedMap + */ +const se_NestedMap = (input: Record>, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("key"); + entryNode.c(keyNode); + let n; + n = se_FooEnumMap(input[key as keyof typeof input]!, context); + entryNode.c( + n.reduce((acc: __XmlNode, workingNode: any) => { + return acc.c(workingNode); + }, new __XmlNode(_v)) + ); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlNestedPayload + */ +const se_NestedPayload = (input: NestedPayload, context: __SerdeContext): any => { + const bn = new __XmlNode(_NP); + if (input[_g] != null) { + bn.c(__XmlNode.of(_S, input[_g]).n(_g)); + } + if (input[_na] != null) { + bn.c(__XmlNode.of(_S, input[_na]).n(_na)); + } + return bn; +}; + +/** + * serializeAws_restXmlNestedXmlMapWithXmlNameInnerMap + */ +const se_NestedXmlMapWithXmlNameInnerMap = (input: Record, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("InnerKey"); + entryNode.c(keyNode); + let n; + n = __XmlNode.of(_S, input[key as keyof typeof input]!); + entryNode.c(n.n(_IV)); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlNestedXmlMapWithXmlNameMap + */ +const se_NestedXmlMapWithXmlNameMap = (input: Record>, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("OuterKey"); + entryNode.c(keyNode); + let n; + n = se_NestedXmlMapWithXmlNameInnerMap(input[key as keyof typeof input]!, context); + entryNode.c( + n.reduce((acc: __XmlNode, workingNode: any) => { + return acc.c(workingNode); + }, new __XmlNode(_v)) + ); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlPayloadWithXmlName + */ +const se_PayloadWithXmlName = (input: PayloadWithXmlName, context: __SerdeContext): any => { + const bn = new __XmlNode(_He); + if (input[_na] != null) { + bn.c(__XmlNode.of(_S, input[_na]).n(_na)); + } + return bn; +}; + +/** + * serializeAws_restXmlPayloadWithXmlNamespace + */ +const se_PayloadWithXmlNamespace = (input: PayloadWithXmlNamespace, context: __SerdeContext): any => { + const bn = new __XmlNode(_PWXN); + if (input[_na] != null) { + bn.c(__XmlNode.of(_S, input[_na]).n(_na)); + } + return bn; +}; + +/** + * serializeAws_restXmlPayloadWithXmlNamespaceAndPrefix + */ +const se_PayloadWithXmlNamespaceAndPrefix = (input: PayloadWithXmlNamespaceAndPrefix, context: __SerdeContext): any => { + const bn = new __XmlNode(_PWXNAP); + if (input[_na] != null) { + bn.c(__XmlNode.of(_S, input[_na]).n(_na)); + } + return bn; +}; + +/** + * serializeAws_restXmlRecursiveShapesInputOutputNested1 + */ +const se_RecursiveShapesInputOutputNested1 = ( + input: RecursiveShapesInputOutputNested1, + context: __SerdeContext +): any => { + const bn = new __XmlNode(_RSION); + if (input[_f] != null) { + bn.c(__XmlNode.of(_S, input[_f]).n(_f)); + } + if (input[_n] != null) { + bn.c(se_RecursiveShapesInputOutputNested2(input[_n], context).n(_n)); + } + return bn; +}; + +/** + * serializeAws_restXmlRecursiveShapesInputOutputNested2 + */ +const se_RecursiveShapesInputOutputNested2 = ( + input: RecursiveShapesInputOutputNested2, + context: __SerdeContext +): any => { + const bn = new __XmlNode(_RSIONe); + if (input[_ba] != null) { + bn.c(__XmlNode.of(_S, input[_ba]).n(_ba)); + } + if (input[_rM] != null) { + bn.c(se_RecursiveShapesInputOutputNested1(input[_rM], context).n(_rM)); + } + return bn; +}; + +/** + * serializeAws_restXmlRenamedListMembers + */ +const se_RenamedListMembers = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_S, entry); + return n.n(_i); + }); +}; + +/** + * serializeAws_restXmlStructureList + */ +const se_StructureList = (input: StructureListMember[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = se_StructureListMember(entry, context); + return n.n(_i); + }); +}; + +/** + * serializeAws_restXmlStructureListMember + */ +const se_StructureListMember = (input: StructureListMember, context: __SerdeContext): any => { + const bn = new __XmlNode(_SLM); + if (input[_a] != null) { + bn.c(__XmlNode.of(_S, input[_a]).n(_v)); + } + if (input[_b_] != null) { + bn.c(__XmlNode.of(_S, input[_b_]).n(_o)); + } + return bn; +}; + +/** + * serializeAws_restXmlUnionPayload + */ +const se_UnionPayload = (input: UnionPayload, context: __SerdeContext): any => { + const bn = new __XmlNode(_UP); + UnionPayload.visit(input, { + greeting: (value) => { + if (input[_g] != null) { + bn.c(__XmlNode.of(_S, value).n(_g)); + } + }, + _: (name: string, value: any) => { + if (!(value instanceof __XmlNode || value instanceof __XmlText)) { + throw new Error("Unable to serialize unknown union members in XML."); + } + bn.c(new __XmlNode(name).c(value)); + }, + }); + return bn; +}; + +/** + * serializeAws_restXmlXmlAttributesPayloadRequest + */ +const se_XmlAttributesPayloadRequest = (input: XmlAttributesPayloadRequest, context: __SerdeContext): any => { + const bn = new __XmlNode(_XAPR); + if (input[_f] != null) { + bn.c(__XmlNode.of(_S, input[_f]).n(_f)); + } + bn.a("test", input[_at]); + return bn; +}; + +/** + * serializeAws_restXmlXmlMapsInputOutputMap + */ +const se_XmlMapsInputOutputMap = (input: Record, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("key"); + entryNode.c(keyNode); + let n; + n = se_GreetingStruct(input[key as keyof typeof input]!, context); + entryNode.c(n.n(_v)); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlXmlMapsXmlNameInputOutputMap + */ +const se_XmlMapsXmlNameInputOutputMap = (input: Record, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("Attribute"); + entryNode.c(keyNode); + let n; + n = se_GreetingStruct(input[key as keyof typeof input]!, context); + entryNode.c(n.n(_Se)); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlXmlMapWithXmlNamespaceInputOutputMap + */ +const se_XmlMapWithXmlNamespaceInputOutputMap = (input: Record, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("K"); + keyNode.a("xmlns", "https://the-key.example.com"); + entryNode.c(keyNode); + let n; + n = __XmlNode.of(_S, input[key as keyof typeof input]!); + n.a("xmlns", "https://the-value.example.com"); + entryNode.c(n.n(_V)); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlXmlNamespacedList + */ +const se_XmlNamespacedList = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_S, entry); + n.a("xmlns", "http://bux.com"); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlXmlNamespaceNested + */ +const se_XmlNamespaceNested = (input: XmlNamespaceNested, context: __SerdeContext): any => { + const bn = new __XmlNode(_XNN); + if (input[_f] != null) { + const n = __XmlNode.of(_S, input[_f]).n(_f); + n.a("xmlns:baz", "http://baz.com"); + bn.c(n); + } + if (input[_va] != null) { + const ns = se_XmlNamespacedList(input[_va], context); + const containerNode = new __XmlNode(_va); + containerNode.a("xmlns", "http://qux.com"); + ns.map((n: any) => { + containerNode.c(n); + }); + bn.c(containerNode); + } + return bn; +}; + +/** + * serializeAws_restXmlXmlNestedUnionStruct + */ +const se_XmlNestedUnionStruct = (input: XmlNestedUnionStruct, context: __SerdeContext): any => { + const bn = new __XmlNode(_XNUS); + if (input[_sVt] != null) { + bn.c(__XmlNode.of(_S, input[_sVt]).n(_sVt)); + } + if (input[_bVo] != null) { + bn.c(__XmlNode.of(_Bo, String(input[_bVo])).n(_bVo)); + } + if (input[_bV] != null) { + bn.c(__XmlNode.of(_B, String(input[_bV])).n(_bV)); + } + if (input[_sV] != null) { + bn.c(__XmlNode.of(_Sh, String(input[_sV])).n(_sV)); + } + if (input[_iV] != null) { + bn.c(__XmlNode.of(_I, String(input[_iV])).n(_iV)); + } + if (input[_lV] != null) { + bn.c(__XmlNode.of(_L, String(input[_lV])).n(_lV)); + } + if (input[_fV] != null) { + bn.c(__XmlNode.of(_F, String(input[_fV])).n(_fV)); + } + if (input[_dV] != null) { + bn.c(__XmlNode.of(_D, String(input[_dV])).n(_dV)); + } + return bn; +}; + +/** + * serializeAws_restXmlXmlUnionShape + */ +const se_XmlUnionShape = (input: XmlUnionShape, context: __SerdeContext): any => { + const bn = new __XmlNode(_XUS); + XmlUnionShape.visit(input, { + stringValue: (value) => { + if (input[_sVt] != null) { + bn.c(__XmlNode.of(_S, value).n(_sVt)); + } + }, + booleanValue: (value) => { + if (input[_bVo] != null) { + bn.c(__XmlNode.of(_Bo, String(value)).n(_bVo)); + } + }, + byteValue: (value) => { + if (input[_bV] != null) { + bn.c(__XmlNode.of(_B, String(value)).n(_bV)); + } + }, + shortValue: (value) => { + if (input[_sV] != null) { + bn.c(__XmlNode.of(_Sh, String(value)).n(_sV)); + } + }, + integerValue: (value) => { + if (input[_iV] != null) { + bn.c(__XmlNode.of(_I, String(value)).n(_iV)); + } + }, + longValue: (value) => { + if (input[_lV] != null) { + bn.c(__XmlNode.of(_L, String(value)).n(_lV)); + } + }, + floatValue: (value) => { + if (input[_fV] != null) { + bn.c(__XmlNode.of(_F, String(value)).n(_fV)); + } + }, + doubleValue: (value) => { + if (input[_dV] != null) { + bn.c(__XmlNode.of(_D, String(value)).n(_dV)); + } + }, + unionValue: (value) => { + if (input[_uV] != null) { + bn.c(se_XmlUnionShape(value, context).n(_uV)); + } + }, + structValue: (value) => { + if (input[_sVtr] != null) { + bn.c(se_XmlNestedUnionStruct(value, context).n(_sVtr)); + } + }, + _: (name: string, value: any) => { + if (!(value instanceof __XmlNode || value instanceof __XmlText)) { + throw new Error("Unable to serialize unknown union members in XML."); + } + bn.c(new __XmlNode(name).c(value)); + }, + }); + return bn; +}; + +/** + * serializeAws_restXmlBooleanList + */ +const se_BooleanList = (input: boolean[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_Bo, String(entry)); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlFooEnumList + */ +const se_FooEnumList = (input: FooEnum[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_FE, entry); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlFooEnumMap + */ +const se_FooEnumMap = (input: Record, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("key"); + entryNode.c(keyNode); + let n; + n = __XmlNode.of(_FE, input[key as keyof typeof input]!); + entryNode.c(n.n(_v)); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlFooEnumSet + */ +const se_FooEnumSet = (input: FooEnum[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_FE, entry); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlGreetingStruct + */ +const se_GreetingStruct = (input: GreetingStruct, context: __SerdeContext): any => { + const bn = new __XmlNode(_GS); + if (input[_hi] != null) { + bn.c(__XmlNode.of(_S, input[_hi]).n(_hi)); + } + return bn; +}; + +/** + * serializeAws_restXmlIntegerEnumList + */ +const se_IntegerEnumList = (input: IntegerEnum[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_IE, String(entry)); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlIntegerEnumMap + */ +const se_IntegerEnumMap = (input: Record, context: __SerdeContext): any => { + return Object.keys(input) + .filter((key) => input[key as keyof typeof input] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = __XmlNode.of(_S, key).n("key"); + entryNode.c(keyNode); + let n; + n = __XmlNode.of(_IE, String(input[key as keyof typeof input]!)); + entryNode.c(n.n(_v)); + return entryNode; + }); +}; + +/** + * serializeAws_restXmlIntegerEnumSet + */ +const se_IntegerEnumSet = (input: IntegerEnum[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_IE, String(entry)); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlIntegerList + */ +const se_IntegerList = (input: number[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_I, String(entry)); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlNestedStringList + */ +const se_NestedStringList = (input: string[][], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = se_StringList(entry, context); + return n.reduce((acc: __XmlNode, workingNode: any) => { + return acc.c(workingNode); + }, new __XmlNode(_m)); + }); +}; + +/** + * serializeAws_restXmlStringList + */ +const se_StringList = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_S, entry); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlStringSet + */ +const se_StringSet = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_S, entry); + return n.n(_m); + }); +}; + +/** + * serializeAws_restXmlTimestampList + */ +const se_TimestampList = (input: Date[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + const n = __XmlNode.of(_T, __serializeDateTime(entry)); + return n.n(_m); + }); +}; + +/** + * deserializeAws_restXmlComplexNestedErrorData + */ +const de_ComplexNestedErrorData = (output: any, context: __SerdeContext): ComplexNestedErrorData => { + const contents: any = {}; + if (output[_Fo] != null) { + contents[_Fo] = __expectString(output[_Fo]); + } + return contents; +}; + +/** + * deserializeAws_restXmlFlattenedXmlMapWithXmlNameInputOutputMap + */ +const de_FlattenedXmlMapWithXmlNameInputOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["V"] === null) { + return acc; + } + acc[pair["K"]] = __expectString(pair["V"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlFlattenedXmlMapWithXmlNamespaceOutputMap + */ +const de_FlattenedXmlMapWithXmlNamespaceOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["V"] === null) { + return acc; + } + acc[pair["K"]] = __expectString(pair["V"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlListWithMemberNamespace + */ +const de_ListWithMemberNamespace = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlListWithNamespace + */ +const de_ListWithNamespace = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlNestedMap + */ +const de_NestedMap = (output: any, context: __SerdeContext): Record> => { + return output.reduce((acc: any, pair: any) => { + if (__getArrayIfSingleItem(pair["value"]["entry"]) === null) { + return acc; + } + acc[pair["key"]] = de_FooEnumMap(__getArrayIfSingleItem(pair["value"]["entry"]), context); + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlNestedPayload + */ +const de_NestedPayload = (output: any, context: __SerdeContext): NestedPayload => { + const contents: any = {}; + if (output[_g] != null) { + contents[_g] = __expectString(output[_g]); + } + if (output[_na] != null) { + contents[_na] = __expectString(output[_na]); + } + return contents; +}; + +/** + * deserializeAws_restXmlNestedXmlMapWithXmlNameInnerMap + */ +const de_NestedXmlMapWithXmlNameInnerMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["InnerValue"] === null) { + return acc; + } + acc[pair["InnerKey"]] = __expectString(pair["InnerValue"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlNestedXmlMapWithXmlNameMap + */ +const de_NestedXmlMapWithXmlNameMap = ( + output: any, + context: __SerdeContext +): Record> => { + return output.reduce((acc: any, pair: any) => { + if (__getArrayIfSingleItem(pair["value"]["entry"]) === null) { + return acc; + } + acc[pair["OuterKey"]] = de_NestedXmlMapWithXmlNameInnerMap(__getArrayIfSingleItem(pair["value"]["entry"]), context); + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlPayloadWithXmlName + */ +const de_PayloadWithXmlName = (output: any, context: __SerdeContext): PayloadWithXmlName => { + const contents: any = {}; + if (output[_na] != null) { + contents[_na] = __expectString(output[_na]); + } + return contents; +}; + +/** + * deserializeAws_restXmlPayloadWithXmlNamespace + */ +const de_PayloadWithXmlNamespace = (output: any, context: __SerdeContext): PayloadWithXmlNamespace => { + const contents: any = {}; + if (output[_na] != null) { + contents[_na] = __expectString(output[_na]); + } + return contents; +}; + +/** + * deserializeAws_restXmlPayloadWithXmlNamespaceAndPrefix + */ +const de_PayloadWithXmlNamespaceAndPrefix = ( + output: any, + context: __SerdeContext +): PayloadWithXmlNamespaceAndPrefix => { + const contents: any = {}; + if (output[_na] != null) { + contents[_na] = __expectString(output[_na]); + } + return contents; +}; + +/** + * deserializeAws_restXmlRecursiveShapesInputOutputNested1 + */ +const de_RecursiveShapesInputOutputNested1 = ( + output: any, + context: __SerdeContext +): RecursiveShapesInputOutputNested1 => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + if (output[_n] != null) { + contents[_n] = de_RecursiveShapesInputOutputNested2(output[_n], context); + } + return contents; +}; + +/** + * deserializeAws_restXmlRecursiveShapesInputOutputNested2 + */ +const de_RecursiveShapesInputOutputNested2 = ( + output: any, + context: __SerdeContext +): RecursiveShapesInputOutputNested2 => { + const contents: any = {}; + if (output[_ba] != null) { + contents[_ba] = __expectString(output[_ba]); + } + if (output[_rM] != null) { + contents[_rM] = de_RecursiveShapesInputOutputNested1(output[_rM], context); + } + return contents; +}; + +/** + * deserializeAws_restXmlRenamedListMembers + */ +const de_RenamedListMembers = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlStructureList + */ +const de_StructureList = (output: any, context: __SerdeContext): StructureListMember[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StructureListMember(entry, context); + }); +}; + +/** + * deserializeAws_restXmlStructureListMember + */ +const de_StructureListMember = (output: any, context: __SerdeContext): StructureListMember => { + const contents: any = {}; + if (output[_v] != null) { + contents[_a] = __expectString(output[_v]); + } + if (output[_o] != null) { + contents[_b_] = __expectString(output[_o]); + } + return contents; +}; + +/** + * deserializeAws_restXmlUnionPayload + */ +const de_UnionPayload = (output: any, context: __SerdeContext): UnionPayload => { + if (output[_g] != null) { + return { + greeting: __expectString(output[_g]) as any, + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +/** + * deserializeAws_restXmlXmlAttributesPayloadResponse + */ +const de_XmlAttributesPayloadResponse = (output: any, context: __SerdeContext): XmlAttributesPayloadResponse => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + if (output[_te] != null) { + contents[_at] = __expectString(output[_te]); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlMapsInputOutputMap + */ +const de_XmlMapsInputOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = de_GreetingStruct(pair["value"], context); + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlXmlMapsXmlNameInputOutputMap + */ +const de_XmlMapsXmlNameInputOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["Setting"] === null) { + return acc; + } + acc[pair["Attribute"]] = de_GreetingStruct(pair["Setting"], context); + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlXmlMapWithXmlNamespaceInputOutputMap + */ +const de_XmlMapWithXmlNamespaceInputOutputMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["V"] === null) { + return acc; + } + acc[pair["K"]] = __expectString(pair["V"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlXmlNamespacedList + */ +const de_XmlNamespacedList = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlXmlNamespaceNested + */ +const de_XmlNamespaceNested = (output: any, context: __SerdeContext): XmlNamespaceNested => { + const contents: any = {}; + if (output[_f] != null) { + contents[_f] = __expectString(output[_f]); + } + if (output.values === "") { + contents[_va] = []; + } else if (output[_va] != null && output[_va][_m] != null) { + contents[_va] = de_XmlNamespacedList(__getArrayIfSingleItem(output[_va][_m]), context); + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlNestedUnionStruct + */ +const de_XmlNestedUnionStruct = (output: any, context: __SerdeContext): XmlNestedUnionStruct => { + const contents: any = {}; + if (output[_sVt] != null) { + contents[_sVt] = __expectString(output[_sVt]); + } + if (output[_bVo] != null) { + contents[_bVo] = __parseBoolean(output[_bVo]); + } + if (output[_bV] != null) { + contents[_bV] = __strictParseByte(output[_bV]) as number; + } + if (output[_sV] != null) { + contents[_sV] = __strictParseShort(output[_sV]) as number; + } + if (output[_iV] != null) { + contents[_iV] = __strictParseInt32(output[_iV]) as number; + } + if (output[_lV] != null) { + contents[_lV] = __strictParseLong(output[_lV]) as number; + } + if (output[_fV] != null) { + contents[_fV] = __strictParseFloat(output[_fV]) as number; + } + if (output[_dV] != null) { + contents[_dV] = __strictParseFloat(output[_dV]) as number; + } + return contents; +}; + +/** + * deserializeAws_restXmlXmlUnionShape + */ +const de_XmlUnionShape = (output: any, context: __SerdeContext): XmlUnionShape => { + if (output[_sVt] != null) { + return { + stringValue: __expectString(output[_sVt]) as any, + }; + } + if (output[_bVo] != null) { + return { + booleanValue: __parseBoolean(output[_bVo]), + }; + } + if (output[_bV] != null) { + return { + byteValue: __strictParseByte(output[_bV]) as number, + }; + } + if (output[_sV] != null) { + return { + shortValue: __strictParseShort(output[_sV]) as number, + }; + } + if (output[_iV] != null) { + return { + integerValue: __strictParseInt32(output[_iV]) as number, + }; + } + if (output[_lV] != null) { + return { + longValue: __strictParseLong(output[_lV]) as number, + }; + } + if (output[_fV] != null) { + return { + floatValue: __strictParseFloat(output[_fV]) as number, + }; + } + if (output[_dV] != null) { + return { + doubleValue: __strictParseFloat(output[_dV]) as number, + }; + } + if (output.unionValue === "") { + // Pass empty tags. + } else if (output[_uV] != null) { + return { + unionValue: de_XmlUnionShape(__expectUnion(output[_uV]), context), + }; + } + if (output[_sVtr] != null) { + return { + structValue: de_XmlNestedUnionStruct(output[_sVtr], context), + }; + } + return { $unknown: Object.entries(output)[0] }; +}; + +/** + * deserializeAws_restXmlBooleanList + */ +const de_BooleanList = (output: any, context: __SerdeContext): boolean[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __parseBoolean(entry); + }); +}; + +/** + * deserializeAws_restXmlFooEnumList + */ +const de_FooEnumList = (output: any, context: __SerdeContext): FooEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlFooEnumMap + */ +const de_FooEnumMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = __expectString(pair["value"]) as any; + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlFooEnumSet + */ +const de_FooEnumSet = (output: any, context: __SerdeContext): FooEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlGreetingStruct + */ +const de_GreetingStruct = (output: any, context: __SerdeContext): GreetingStruct => { + const contents: any = {}; + if (output[_hi] != null) { + contents[_hi] = __expectString(output[_hi]); + } + return contents; +}; + +/** + * deserializeAws_restXmlIntegerEnumList + */ +const de_IntegerEnumList = (output: any, context: __SerdeContext): IntegerEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_restXmlIntegerEnumMap + */ +const de_IntegerEnumMap = (output: any, context: __SerdeContext): Record => { + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + acc[pair["key"]] = __strictParseInt32(pair["value"]) as number; + return acc; + }, {}); +}; + +/** + * deserializeAws_restXmlIntegerEnumSet + */ +const de_IntegerEnumSet = (output: any, context: __SerdeContext): IntegerEnum[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_restXmlIntegerList + */ +const de_IntegerList = (output: any, context: __SerdeContext): number[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __strictParseInt32(entry) as number; + }); +}; + +/** + * deserializeAws_restXmlNestedStringList + */ +const de_NestedStringList = (output: any, context: __SerdeContext): string[][] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StringList(__getArrayIfSingleItem(entry["member"]), context); + }); +}; + +/** + * deserializeAws_restXmlStringList + */ +const de_StringList = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlStringSet + */ +const de_StringSet = (output: any, context: __SerdeContext): string[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectString(entry) as any; + }); +}; + +/** + * deserializeAws_restXmlTimestampList + */ +const de_TimestampList = (output: any, context: __SerdeContext): Date[] => { + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectNonNull(__parseRfc3339DateTimeWithOffset(entry)); + }); +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const _A = "Ahoy"; +const _B = "Byte"; +const _BL = "BooleanList"; +const _Bl = "Blob"; +const _Bo = "Boolean"; +const _CTPI = "ContentTypeParametersInput"; +const _D = "Double"; +const _DD = "DoubleDribble"; +const _DL = "DoubleList"; +const _DT = "DateTime"; +const _E = "Enum"; +const _EL = "EnumList"; +const _ES = "EpochSeconds"; +const _EWHLOR = "EndpointWithHostLabelOperationRequest"; +const _Em = "Empty"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FXMR = "FlattenedXmlMapRequest"; +const _FXMWXNR = "FlattenedXmlMapWithXmlNameRequest"; +const _Fo = "Foo"; +const _GS = "GreetingStruct"; +const _H = "Header"; +const _HD = "HttpDate"; +const _He = "Hello"; +const _I = "Integer"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IL = "IntegerList"; +const _IS = "IntegerSet"; +const _IV = "InnerValue"; +const _KVP = "KVP"; +const _L = "Long"; +const _M = "Message"; +const _N = "Null"; +const _NP = "NestedPayload"; +const _NXMR = "NestedXmlMapsRequest"; +const _NXMWXNR = "NestedXmlMapWithXmlNameRequest"; +const _Ne = "Nested"; +const _PWCEI = "PutWithContentEncodingInput"; +const _PWXN = "PayloadWithXmlNamespace"; +const _PWXNAP = "PayloadWithXmlNamespaceAndPrefix"; +const _RSION = "RecursiveShapesInputOutputNested1"; +const _RSIONe = "RecursiveShapesInputOutputNested2"; +const _RSR = "RecursiveShapesRequest"; +const _S = "String"; +const _SL = "StringList"; +const _SLM = "StructureListMember"; +const _SS = "StringSet"; +const _SSPR = "SimpleScalarPropertiesRequest"; +const _Se = "Setting"; +const _Sh = "Short"; +const _T = "Timestamp"; +const _TL = "TimestampList"; +const _TLo = "TopLevel"; +const _UP = "UnionPayload"; +const _V = "V"; +const _XAPR = "XmlAttributesPayloadRequest"; +const _XAR = "XmlAttributesRequest"; +const _XBR = "XmlBlobsRequest"; +const _XEBR = "XmlEmptyBlobsRequest"; +const _XELR = "XmlEmptyListsRequest"; +const _XEMR = "XmlEmptyMapsRequest"; +const _XER = "XmlEnumsRequest"; +const _XESR = "XmlEmptyStringsRequest"; +const _XIER = "XmlIntEnumsRequest"; +const _XLR = "XmlListsRequest"; +const _XMR = "XmlMapsRequest"; +const _XMWXNR = "XmlMapWithXmlNamespaceRequest"; +const _XMXNR = "XmlMapsXmlNameRequest"; +const _XNN = "XmlNamespaceNested"; +const _XNR = "XmlNamespacesRequest"; +const _XNUS = "XmlNestedUnionStruct"; +const _XTR = "XmlTimestampsRequest"; +const _XUR = "XmlUnionsRequest"; +const _XUS = "XmlUnionShape"; +const _a = "a"; +const _aI = "accountId"; +const _at = "attr"; +const _b = "baz"; +const _bL = "booleanList"; +const _bV = "byteValue"; +const _bVo = "booleanValue"; +const _b_ = "b"; +const _ba = "bar"; +const _c = "c"; +const _cN = "customName"; +const _ce = "content-encoding"; +const _co = "corge"; +const _d = "data"; +const _dF = "defaultFormat"; +const _dT = "dateTime"; +const _dTOT = "dateTimeOnTarget"; +const _dV = "doubleValue"; +const _da = "datetime"; +const _e = "encoding"; +const _eL = "enumList"; +const _eS = "emptyString"; +const _eSOT = "epochSecondsOnTarget"; +const _eSp = "epochSeconds"; +const _en = "entry"; +const _f = "foo"; +const _fBV = "falseBooleanValue"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fL = "flattenedList"; +const _fLWMN = "flattenedListWithMemberNamespace"; +const _fLWN = "flattenedListWithNamespace"; +const _fLl = "flattenedList2"; +const _fNM = "flatNestedMap"; +const _fSL = "flattenedStructureList"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "hello"; +const _hB = "headerByte"; +const _hBL = "headerBooleanList"; +const _hD = "headerDouble"; +const _hDOT = "httpDateOnTarget"; +const _hDt = "httpDate"; +const _hE = "headerEnum"; +const _hEL = "headerEnumList"; +const _hF = "headerFloat"; +const _hFB = "headerFalseBool"; +const _hI = "headerInteger"; +const _hIL = "headerIntegerList"; +const _hL = "headerLong"; +const _hS = "headerString"; +const _hSL = "headerStringList"; +const _hSS = "headerStringSet"; +const _hSe = "headerShort"; +const _hTB = "headerTrueBool"; +const _hTL = "headerTimestampList"; +const _hi = "hi"; +const _i = "item"; +const _iE = "intEnum1"; +const _iEL = "intEnumList"; +const _iEM = "intEnumMap"; +const _iES = "intEnumSet"; +const _iEn = "intEnum2"; +const _iEnt = "intEnum3"; +const _iL = "integerList"; +const _iV = "integerValue"; +const _l = "label"; +const _lV = "longValue"; +const _m = "member"; +const _mDT = "memberDateTime"; +const _mES = "memberEpochSeconds"; +const _mHD = "memberHttpDate"; +const _mM = "myMap"; +const _mS = "maybeSet"; +const _mSL = "myStructureList"; +const _n = "nested"; +const _nM = "nestedMap"; +const _nSL = "nestedStringList"; +const _nV = "nullValue"; +const _nXMWXNM = "nestedXmlMapWithXmlNameMap"; +const _na = "name"; +const _no = "normal"; +const _o = "other"; +const _q = "qux"; +const _qB = "queryByte"; +const _qBL = "queryBooleanList"; +const _qBu = "queryBoolean"; +const _qD = "queryDouble"; +const _qDL = "queryDoubleList"; +const _qE = "queryEnum"; +const _qEL = "queryEnumList"; +const _qF = "queryFloat"; +const _qI = "queryInteger"; +const _qIE = "queryIntegerEnum"; +const _qIEL = "queryIntegerEnumList"; +const _qIL = "queryIntegerList"; +const _qIS = "queryIntegerSet"; +const _qL = "queryLong"; +const _qS = "queryString"; +const _qSL = "queryStringList"; +const _qSS = "queryStringSet"; +const _qSu = "queryShort"; +const _qT = "queryTimestamp"; +const _qTL = "queryTimestampList"; +const _r = "renamed"; +const _rLM = "renamedListMembers"; +const _rM = "recursiveMember"; +const _sH = "specificHeader"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sS = "stringSet"; +const _sV = "shortValue"; +const _sVt = "stringValue"; +const _sVtr = "structValue"; +const _t = "token"; +const _tBV = "trueBooleanValue"; +const _tDT = "targetDateTime"; +const _tES = "targetEpochSeconds"; +const _tHD = "targetHttpDate"; +const _tL = "timestampList"; +const _te = "test"; +const _uV = "unionValue"; +const _v = "value"; +const _va = "values"; +const _ve = ''; +const _xa = "x-a"; +const _xaai = "x-amz-account-id"; +const _xb = "x-byte"; +const _xb_ = "x-boolean1"; +const _xb__ = "x-boolean2"; +const _xb___ = "x-booleanlist"; +const _xb____ = "x-b"; +const _xc = "x-c"; +const _xd = "x-double"; +const _xd_ = "x-defaultformat"; +const _xe = "x-enum"; +const _xe_ = "x-enumlist"; +const _xf = "x-foo"; +const _xf_ = "x-float"; +const _xg = "x-greeting"; +const _xh = "x-header"; +const _xi = "x-integer"; +const _xi_ = "x-integerlist"; +const _xl = "x-long"; +const _xm = "x-memberepochseconds"; +const _xm_ = "x-memberhttpdate"; +const _xm__ = "x-memberdatetime"; +const _xs = "x-string"; +const _xs_ = "x-short"; +const _xs__ = "x-stringlist"; +const _xs___ = "x-stringset"; +const _xt = "x-timestamplist"; +const _xt_ = "x-targetepochseconds"; +const _xt__ = "x-targethttpdate"; +const _xt___ = "x-targetdatetime"; diff --git a/private/aws-protocoltests-restxml-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.browser.ts new file mode 100644 index 0000000000000..9a54730b16866 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.browser.ts @@ -0,0 +1,51 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/private/aws-protocoltests-restxml-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.native.ts new file mode 100644 index 0000000000000..4402a7671aa1f --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/private/aws-protocoltests-restxml-schema/src/runtimeConfig.shared.ts b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.shared.ts new file mode 100644 index 0000000000000..dae3c4a8b4fdd --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.shared.ts @@ -0,0 +1,45 @@ +// smithy-typescript generated code +import { AwsSdkSigV4Signer } from "@aws-sdk/core"; +import { AwsRestXmlProtocol } from "@aws-sdk/core/protocols"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultRestXmlProtocolHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { + return { + apiVersion: "2019-12-16", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultRestXmlProtocolHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc: IdentityProviderConfig) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + protocol: + config?.protocol ?? + new AwsRestXmlProtocol({ + defaultNamespace: "aws.protocoltests.restxml", + xmlNamespace: "", + }), + serviceId: config?.serviceId ?? "Rest Xml Protocol", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/private/aws-protocoltests-restxml-schema/src/runtimeConfig.ts b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.ts new file mode 100644 index 0000000000000..9a249fa3055ea --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/runtimeConfig.ts @@ -0,0 +1,81 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: + config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), + retryMode: + config?.retryMode ?? + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; diff --git a/private/aws-protocoltests-restxml-schema/src/runtimeExtensions.ts b/private/aws-protocoltests-restxml-schema/src/runtimeExtensions.ts new file mode 100644 index 0000000000000..d79bf9dbd8bb9 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/runtimeExtensions.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { RestXmlProtocolExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: RestXmlProtocolExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: RestXmlProtocolExtensionConfiguration = Object.assign( + getAwsRegionExtensionConfiguration(runtimeConfig), + getDefaultExtensionConfiguration(runtimeConfig), + getHttpHandlerExtensionConfiguration(runtimeConfig), + getHttpAuthExtensionConfiguration(runtimeConfig) + ); + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return Object.assign( + runtimeConfig, + resolveAwsRegionExtensionConfiguration(extensionConfiguration), + resolveDefaultRuntimeConfig(extensionConfiguration), + resolveHttpHandlerRuntimeConfig(extensionConfiguration), + resolveHttpAuthRuntimeConfig(extensionConfiguration) + ); +}; diff --git a/private/aws-protocoltests-restxml-schema/src/schemas/schemas.ts b/private/aws-protocoltests-restxml-schema/src/schemas/schemas.ts new file mode 100644 index 0000000000000..0fe80c90c4719 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/src/schemas/schemas.ts @@ -0,0 +1,2616 @@ +const _ = ""; +const _A = "Ahoy"; +const _AQST = "AllQueryStringTypes"; +const _AQSTI = "AllQueryStringTypesInput"; +const _At = "Attribute"; +const _B = "Byte"; +const _BL = "BooleanList"; +const _BWXN = "BodyWithXmlName"; +const _BWXNIO = "BodyWithXmlNameInputOutput"; +const _Bl = "Blob"; +const _Bo = "Boolean"; +const _CAVQS = "ConstantAndVariableQueryString"; +const _CAVQSI = "ConstantAndVariableQueryStringInput"; +const _CE = "ComplexError"; +const _CE_ = "Content-Encoding"; +const _CNED = "ComplexNestedErrorData"; +const _CQS = "ConstantQueryString"; +const _CQSI = "ConstantQueryStringInput"; +const _CTP = "ContentTypeParameters"; +const _CTPI = "ContentTypeParametersInput"; +const _CTPO = "ContentTypeParametersOutput"; +const _D = "Double"; +const _DD = "DoubleDribble"; +const _DL = "DoubleList"; +const _DO = "DatetimeOffsets"; +const _DOO = "DatetimeOffsetsOutput"; +const _DT = "DateTime"; +const _E = "Enum"; +const _EIAEO = "EmptyInputAndEmptyOutput"; +const _EIAEOI = "EmptyInputAndEmptyOutputInput"; +const _EIAEOO = "EmptyInputAndEmptyOutputOutput"; +const _EL = "EnumList"; +const _EO = "EndpointOperation"; +const _EPI = "EnumPayloadInput"; +const _ES = "EpochSeconds"; +const _EWHLHO = "EndpointWithHostLabelHeaderOperation"; +const _EWHLO = "EndpointWithHostLabelOperation"; +const _EWHLOR = "EndpointWithHostLabelOperationRequest"; +const _Em = "Empty"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FEL = "FooEnumList"; +const _FEM = "FooEnumMap"; +const _FES = "FooEnumSet"; +const _FPH = "FooPrefixHeaders"; +const _FS = "FractionalSeconds"; +const _FSO = "FractionalSecondsOutput"; +const _FXM = "FlattenedXmlMap"; +const _FXMR = "FlattenedXmlMapRequest"; +const _FXMRl = "FlattenedXmlMapResponse"; +const _FXMWXN = "FlattenedXmlMapWithXmlName"; +const _FXMWXNIOM = "FlattenedXmlMapWithXmlNameInputOutputMap"; +const _FXMWXNO = "FlattenedXmlMapWithXmlNamespaceOutput"; +const _FXMWXNOM = "FlattenedXmlMapWithXmlNamespaceOutputMap"; +const _FXMWXNR = "FlattenedXmlMapWithXmlNameRequest"; +const _FXMWXNRl = "FlattenedXmlMapWithXmlNameResponse"; +const _FXMWXNl = "FlattenedXmlMapWithXmlNamespace"; +const _Fo = "Foo"; +const _GS = "GreetingStruct"; +const _GWE = "GreetingWithErrors"; +const _GWEO = "GreetingWithErrorsOutput"; +const _H = "Header"; +const _HD = "HttpDate"; +const _HEP = "HttpEnumPayload"; +const _HEPH = "HttpEmptyPrefixHeaders"; +const _HEPHI = "HttpEmptyPrefixHeadersInput"; +const _HEPHO = "HttpEmptyPrefixHeadersOutput"; +const _HLHI = "HostLabelHeaderInput"; +const _HPH = "HttpPrefixHeaders"; +const _HPHIO = "HttpPrefixHeadersInputOutput"; +const _HPT = "HttpPayloadTraits"; +const _HPTIO = "HttpPayloadTraitsInputOutput"; +const _HPTWMT = "HttpPayloadTraitsWithMediaType"; +const _HPTWMTIO = "HttpPayloadTraitsWithMediaTypeInputOutput"; +const _HPWMXN = "HttpPayloadWithMemberXmlName"; +const _HPWMXNIO = "HttpPayloadWithMemberXmlNameInputOutput"; +const _HPWS = "HttpPayloadWithStructure"; +const _HPWSIO = "HttpPayloadWithStructureInputOutput"; +const _HPWU = "HttpPayloadWithUnion"; +const _HPWUIO = "HttpPayloadWithUnionInputOutput"; +const _HPWXN = "HttpPayloadWithXmlName"; +const _HPWXNAP = "HttpPayloadWithXmlNamespaceAndPrefix"; +const _HPWXNAPIO = "HttpPayloadWithXmlNamespaceAndPrefixInputOutput"; +const _HPWXNIO = "HttpPayloadWithXmlNameInputOutput"; +const _HPWXNIOt = "HttpPayloadWithXmlNamespaceInputOutput"; +const _HPWXNt = "HttpPayloadWithXmlNamespace"; +const _HRC = "HttpResponseCode"; +const _HRCO = "HttpResponseCodeOutput"; +const _HRWFL = "HttpRequestWithFloatLabels"; +const _HRWFLI = "HttpRequestWithFloatLabelsInput"; +const _HRWGLIP = "HttpRequestWithGreedyLabelInPath"; +const _HRWGLIPI = "HttpRequestWithGreedyLabelInPathInput"; +const _HRWL = "HttpRequestWithLabels"; +const _HRWLATF = "HttpRequestWithLabelsAndTimestampFormat"; +const _HRWLATFI = "HttpRequestWithLabelsAndTimestampFormatInput"; +const _HRWLI = "HttpRequestWithLabelsInput"; +const _HSP = "HttpStringPayload"; +const _He = "Hello"; +const _Ho = "Hola"; +const _I = "Integer"; +const _IAOWH = "InputAndOutputWithHeaders"; +const _IAOWHIO = "InputAndOutputWithHeadersIO"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IEM = "IntegerEnumMap"; +const _IES = "IntegerEnumSet"; +const _IG = "InvalidGreeting"; +const _IK = "InnerKey"; +const _IL = "IntegerList"; +const _IQPIR = "IgnoreQueryParamsInResponse"; +const _IQPIRO = "IgnoreQueryParamsInResponseOutput"; +const _IS = "IntegerSet"; +const _IV = "InnerValue"; +const _K = "K"; +const _KVP = "KVP"; +const _L = "Long"; +const _LWMN = "ListWithMemberNamespace"; +const _LWN = "ListWithNamespace"; +const _M = "Message"; +const _N = "Nested"; +const _NAEHC = "NullAndEmptyHeadersClient"; +const _NAEHIO = "NullAndEmptyHeadersIO"; +const _NAEHS = "NullAndEmptyHeadersServer"; +const _NIANO = "NoInputAndNoOutput"; +const _NIAO = "NoInputAndOutput"; +const _NIAOO = "NoInputAndOutputOutput"; +const _NM = "NestedMap"; +const _NP = "NestedPayload"; +const _NSL = "NestedStringList"; +const _NXM = "NestedXmlMaps"; +const _NXMR = "NestedXmlMapsRequest"; +const _NXMRe = "NestedXmlMapsResponse"; +const _NXMWXN = "NestedXmlMapWithXmlName"; +const _NXMWXNIM = "NestedXmlMapWithXmlNameInnerMap"; +const _NXMWXNM = "NestedXmlMapWithXmlNameMap"; +const _NXMWXNR = "NestedXmlMapWithXmlNameRequest"; +const _NXMWXNRe = "NestedXmlMapWithXmlNameResponse"; +const _Nu = "Null"; +const _OK = "OuterKey"; +const _ONSES = "OmitsNullSerializesEmptyString"; +const _ONSESI = "OmitsNullSerializesEmptyStringInput"; +const _PWCE = "PutWithContentEncoding"; +const _PWCEI = "PutWithContentEncodingInput"; +const _PWXN = "PayloadWithXmlName"; +const _PWXNAP = "PayloadWithXmlNamespaceAndPrefix"; +const _PWXNa = "PayloadWithXmlNamespace"; +const _QITAF = "QueryIdempotencyTokenAutoFill"; +const _QITAFI = "QueryIdempotencyTokenAutoFillInput"; +const _QP = "QueryPrecedence"; +const _QPASLM = "QueryParamsAsStringListMap"; +const _QPASLMI = "QueryParamsAsStringListMapInput"; +const _QPI = "QueryPrecedenceInput"; +const _RLM = "RenamedListMembers"; +const _RS = "RecursiveShapes"; +const _RSION = "RecursiveShapesInputOutputNested1"; +const _RSIONe = "RecursiveShapesInputOutputNested2"; +const _RSR = "RecursiveShapesRequest"; +const _RSRe = "RecursiveShapesResponse"; +const _S = "String"; +const _SE = "StringEnum"; +const _SL = "StringList"; +const _SLM = "StringListMap"; +const _SLMt = "StructureListMember"; +const _SLt = "StructureList"; +const _SM = "StringMap"; +const _SPI = "StringPayloadInput"; +const _SS = "StringSet"; +const _SSP = "SimpleScalarProperties"; +const _SSPR = "SimpleScalarPropertiesRequest"; +const _SSPRi = "SimpleScalarPropertiesResponse"; +const _Se = "Setting"; +const _Sh = "Short"; +const _St = "Status"; +const _T = "Timestamp"; +const _TFH = "TimestampFormatHeaders"; +const _TFHIO = "TimestampFormatHeadersIO"; +const _TL = "TimestampList"; +const _TLo = "TopLevel"; +const _TPB = "TextPlainBlob"; +const _UP = "UnionPayload"; +const _V = "V"; +const _XA = "X-A"; +const _XAAI = "X-Amz-Account-Id"; +const _XAOP = "XmlAttributesOnPayload"; +const _XAOPR = "XmlAttributesOnPayloadRequest"; +const _XAOPRm = "XmlAttributesOnPayloadResponse"; +const _XAPR = "XmlAttributesPayloadRequest"; +const _XAPRm = "XmlAttributesPayloadResponse"; +const _XAR = "XmlAttributesRequest"; +const _XARm = "XmlAttributesResponse"; +const _XAm = "XmlAttributes"; +const _XB = "X-Byte"; +const _XBR = "XmlBlobsRequest"; +const _XBRm = "XmlBlobsResponse"; +const _XB_ = "X-Boolean1"; +const _XB__ = "X-Boolean2"; +const _XB___ = "X-BooleanList"; +const _XB____ = "X-B"; +const _XBm = "XmlBlobs"; +const _XC = "X-C"; +const _XD = "X-Double"; +const _XE = "X-Enum"; +const _XEB = "XmlEmptyBlobs"; +const _XEBR = "XmlEmptyBlobsRequest"; +const _XEBRm = "XmlEmptyBlobsResponse"; +const _XEL = "XmlEmptyLists"; +const _XELR = "XmlEmptyListsRequest"; +const _XELRm = "XmlEmptyListsResponse"; +const _XEM = "XmlEmptyMaps"; +const _XEMR = "XmlEmptyMapsRequest"; +const _XEMRm = "XmlEmptyMapsResponse"; +const _XER = "XmlEnumsRequest"; +const _XERm = "XmlEnumsResponse"; +const _XES = "XmlEmptyStrings"; +const _XESR = "XmlEmptyStringsRequest"; +const _XESRm = "XmlEmptyStringsResponse"; +const _XE_ = "X-EnumList"; +const _XEm = "XmlEnums"; +const _XF = "X-Foo"; +const _XF_ = "X-Float"; +const _XG = "X-Greeting"; +const _XH = "X-Header"; +const _XI = "X-Integer"; +const _XIE = "XmlIntEnums"; +const _XIER = "XmlIntEnumsRequest"; +const _XIERm = "XmlIntEnumsResponse"; +const _XI_ = "X-IntegerList"; +const _XL = "X-Long"; +const _XLR = "XmlListsRequest"; +const _XLRm = "XmlListsResponse"; +const _XLm = "XmlLists"; +const _XM = "XmlMaps"; +const _XMIOM = "XmlMapsInputOutputMap"; +const _XMR = "XmlMapsRequest"; +const _XMRm = "XmlMapsResponse"; +const _XMWXN = "XmlMapWithXmlNamespace"; +const _XMWXNIOM = "XmlMapWithXmlNamespaceInputOutputMap"; +const _XMWXNR = "XmlMapWithXmlNamespaceRequest"; +const _XMWXNRm = "XmlMapWithXmlNamespaceResponse"; +const _XMXN = "XmlMapsXmlName"; +const _XMXNIOM = "XmlMapsXmlNameInputOutputMap"; +const _XMXNR = "XmlMapsXmlNameRequest"; +const _XMXNRm = "XmlMapsXmlNameResponse"; +const _XN = "XmlNamespaces"; +const _XNL = "XmlNamespacedList"; +const _XNN = "XmlNamespaceNested"; +const _XNR = "XmlNamespacesRequest"; +const _XNRm = "XmlNamespacesResponse"; +const _XNUS = "XmlNestedUnionStruct"; +const _XS = "X-String"; +const _XS_ = "X-Short"; +const _XS__ = "X-StringList"; +const _XS___ = "X-StringSet"; +const _XT = "X-TimestampList"; +const _XTR = "XmlTimestampsRequest"; +const _XTRm = "XmlTimestampsResponse"; +const _XTm = "XmlTimestamps"; +const _XU = "XmlUnions"; +const _XUR = "XmlUnionsRequest"; +const _XURm = "XmlUnionsResponse"; +const _XUS = "XmlUnionShape"; +const _Xd = "X-defaultFormat"; +const _Xm = "X-memberEpochSeconds"; +const _Xm_ = "X-memberHttpDate"; +const _Xm__ = "X-memberDateTime"; +const _Xt = "X-targetEpochSeconds"; +const _Xt_ = "X-targetHttpDate"; +const _Xt__ = "X-targetDateTime"; +const _a = "a"; +const _aI = "accountId"; +const _at = "attr"; +const _b = "baz"; +const _bL = "booleanList"; +const _bV = "byteValue"; +const _bVo = "booleanValue"; +const _b_ = "b"; +const _ba = "bar"; +const _bl = "blob"; +const _bo = "boolean"; +const _c = "client"; +const _cN = "customName"; +const _c_ = "c"; +const _co = "corge"; +const _d = "datetime"; +const _dF = "defaultFormat"; +const _dT = "dateTime"; +const _dTOT = "dateTimeOnTarget"; +const _dV = "doubleValue"; +const _da = "data"; +const _do = "double"; +const _e = "error"; +const _eL = "enumList"; +const _eS = "emptyString"; +const _eSOT = "epochSecondsOnTarget"; +const _eSp = "epochSeconds"; +const _en = "encoding"; +const _end = "endpoint"; +const _f = "foo"; +const _fBV = "falseBooleanValue"; +const _fE = "fooEnum1"; +const _fEL = "fooEnumList"; +const _fEM = "fooEnumMap"; +const _fES = "fooEnumSet"; +const _fEo = "fooEnum2"; +const _fEoo = "fooEnum3"; +const _fL = "flattenedList"; +const _fLWMN = "flattenedListWithMemberNamespace"; +const _fLWN = "flattenedListWithNamespace"; +const _fLl = "flattenedList2"; +const _fM = "fooMap"; +const _fNM = "flatNestedMap"; +const _fSL = "flattenedStructureList"; +const _fV = "floatValue"; +const _fl = "float"; +const _g = "greeting"; +const _h = "hello"; +const _hB = "headerByte"; +const _hBL = "headerBooleanList"; +const _hD = "headerDouble"; +const _hDOT = "httpDateOnTarget"; +const _hDt = "httpDate"; +const _hE = "httpError"; +const _hEL = "headerEnumList"; +const _hEe = "headerEnum"; +const _hF = "headerFloat"; +const _hFB = "headerFalseBool"; +const _hH = "httpHeader"; +const _hI = "headerInteger"; +const _hIL = "headerIntegerList"; +const _hL = "hostLabel"; +const _hLe = "headerLong"; +const _hP = "httpPayload"; +const _hPH = "httpPrefixHeaders"; +const _hQ = "httpQuery"; +const _hS = "headerString"; +const _hSL = "headerStringList"; +const _hSS = "headerStringSet"; +const _hSe = "headerShort"; +const _hTB = "headerTrueBool"; +const _hTL = "headerTimestampList"; +const _hi = "hi"; +const _hk = "https://the-key.example.com"; +const _hl = "https://xml-list.example.com"; +const _hm = "https://the-member.example.com"; +const _hm_ = "https://xml-member.example.com"; +const _ht = "http://foo.com"; +const _htt = "http://baz.com"; +const _http = "http://qux.com"; +const _http_ = "http"; +const _httpb = "http://bux.com"; +const _hv = "https://the-value.example.com"; +const _i = "integer"; +const _iE = "intEnum1"; +const _iEL = "intEnumList"; +const _iEM = "intEnumMap"; +const _iES = "intEnumSet"; +const _iEn = "intEnum2"; +const _iEnt = "intEnum3"; +const _iL = "integerList"; +const _iT = "idempotencyToken"; +const _iV = "integerValue"; +const _it = "item"; +const _l = "label"; +const _lV = "longValue"; +const _lo = "long"; +const _mDT = "memberDateTime"; +const _mES = "memberEpochSeconds"; +const _mHD = "memberHttpDate"; +const _mM = "myMap"; +const _mS = "maybeSet"; +const _mSL = "myStructureList"; +const _mT = "mediaType"; +const _n = "nested"; +const _nM = "nestedMap"; +const _nSL = "nestedStringList"; +const _nV = "nullValue"; +const _nXMWXNM = "nestedXmlMapWithXmlNameMap"; +const _na = "name"; +const _no = "normal"; +const _o = "other"; +const _p = "payload"; +const _pH = "prefixHeaders"; +const _q = "qux"; +const _qB = "queryByte"; +const _qBL = "queryBooleanList"; +const _qBu = "queryBoolean"; +const _qD = "queryDouble"; +const _qDL = "queryDoubleList"; +const _qE = "queryEnum"; +const _qEL = "queryEnumList"; +const _qF = "queryFloat"; +const _qI = "queryInteger"; +const _qIE = "queryIntegerEnum"; +const _qIEL = "queryIntegerEnumList"; +const _qIL = "queryIntegerList"; +const _qIS = "queryIntegerSet"; +const _qL = "queryLong"; +const _qPMOS = "queryParamsMapOfStrings"; +const _qS = "queryString"; +const _qSL = "queryStringList"; +const _qSS = "queryStringSet"; +const _qSu = "queryShort"; +const _qT = "queryTimestamp"; +const _qTL = "queryTimestampList"; +const _r = "renamed"; +const _rLM = "renamedListMembers"; +const _rM = "recursiveMember"; +const _s = "string"; +const _sH = "specificHeader"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sS = "stringSet"; +const _sV = "stringValue"; +const _sVh = "shortValue"; +const _sVt = "structValue"; +const _sh = "short"; +const _t = "text/plain"; +const _tBV = "trueBooleanValue"; +const _tDT = "targetDateTime"; +const _tES = "targetEpochSeconds"; +const _tHD = "targetHttpDate"; +const _tL = "timestampList"; +const _te = "test"; +const _ti = "timestamp"; +const _to = "token"; +const _uV = "unionValue"; +const _v = "value"; +const _va = "values"; +const _xA = "xmlAttribute"; +const _xF = "xmlFlattened"; +const _xN = "xmlName"; +const _xNm = "xmlNamespace"; +const _xf = "x-foo"; +const _xf_ = "x-foo-"; +const n0 = "aws.protocoltests.shared"; +const n1 = "aws.protocoltests.restxml"; + +// smithy-typescript generated code +import { error, list, map, op, sim, struct, struct as uni } from "@smithy/core/schema"; + +import { ComplexError as __ComplexError, InvalidGreeting as __InvalidGreeting } from "../models/index"; +import { RestXmlProtocolServiceException as __RestXmlProtocolServiceException } from "../models/RestXmlProtocolServiceException"; + +/* eslint no-var: 0 */ + +export var TextPlainBlob = sim(n0, _TPB, 21, { + [_mT]: _t, +}); +export var AllQueryStringTypesInput = struct( + n1, + _AQSTI, + 0, + [ + _qS, + _qSL, + _qSS, + _qB, + _qSu, + _qI, + _qIL, + _qIS, + _qL, + _qF, + _qD, + _qDL, + _qBu, + _qBL, + _qT, + _qTL, + _qE, + _qEL, + _qIE, + _qIEL, + _qPMOS, + ], + [ + [ + 0, + { + [_hQ]: _S, + }, + ], + [ + 64 | 0, + { + [_hQ]: _SL, + }, + ], + [ + 64 | 0, + { + [_hQ]: _SS, + }, + ], + [ + 1, + { + [_hQ]: _B, + }, + ], + [ + 1, + { + [_hQ]: _Sh, + }, + ], + [ + 1, + { + [_hQ]: _I, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IL, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IS, + }, + ], + [ + 1, + { + [_hQ]: _L, + }, + ], + [ + 1, + { + [_hQ]: _F, + }, + ], + [ + 1, + { + [_hQ]: _D, + }, + ], + [ + 64 | 1, + { + [_hQ]: _DL, + }, + ], + [ + 2, + { + [_hQ]: _Bo, + }, + ], + [ + 64 | 2, + { + [_hQ]: _BL, + }, + ], + [ + 4, + { + [_hQ]: _T, + }, + ], + [ + 64 | 4, + { + [_hQ]: _TL, + }, + ], + [ + 0, + { + [_hQ]: _E, + }, + ], + [ + 64 | 0, + { + [_hQ]: _EL, + }, + ], + [ + 1, + { + [_hQ]: _IE, + }, + ], + [ + 64 | 1, + { + [_hQ]: _IEL, + }, + ], + [128 | 0, 64], + ] +); +export var BodyWithXmlNameInputOutput = struct( + n1, + _BWXNIO, + { + [_xN]: _A, + }, + [_n], + [[() => PayloadWithXmlName, 0]] +); +export var ComplexError = error( + n1, + _CE, + { + [_e]: _c, + [_hE]: 403, + }, + [_H, _TLo, _N], + [ + [ + 0, + { + [_hH]: _XH, + }, + ], + 0, + () => ComplexNestedErrorData, + ], + + __ComplexError +); +export var ComplexNestedErrorData = struct(n1, _CNED, 0, [_Fo], [0]); +export var ConstantAndVariableQueryStringInput = struct( + n1, + _CAVQSI, + 0, + [_b, _mS], + [ + [ + 0, + { + [_hQ]: _b, + }, + ], + [ + 0, + { + [_hQ]: _mS, + }, + ], + ] +); +export var ConstantQueryStringInput = struct(n1, _CQSI, 0, [_h], [[0, 1]]); +export var ContentTypeParametersInput = struct(n1, _CTPI, 0, [_v], [1]); +export var ContentTypeParametersOutput = struct(n1, _CTPO, 0, [], []); +export var DatetimeOffsetsOutput = struct(n1, _DOO, 0, [_d], [5]); +export var EmptyInputAndEmptyOutputInput = struct(n1, _EIAEOI, 0, [], []); +export var EmptyInputAndEmptyOutputOutput = struct(n1, _EIAEOO, 0, [], []); +export var EndpointWithHostLabelOperationRequest = struct( + n1, + _EWHLOR, + 0, + [_l], + [ + [ + 0, + { + [_hL]: 1, + }, + ], + ] +); +export var EnumPayloadInput = struct(n1, _EPI, 0, [_p], [[0, 16]]); +export var FlattenedXmlMapRequest = struct( + n1, + _FXMR, + 0, + [_mM], + [ + [ + 128 | 0, + { + [_xF]: 1, + }, + ], + ] +); +export var FlattenedXmlMapResponse = struct( + n1, + _FXMRl, + 0, + [_mM], + [ + [ + 128 | 0, + { + [_xF]: 1, + }, + ], + ] +); +export var FlattenedXmlMapWithXmlNameRequest = struct( + n1, + _FXMWXNR, + 0, + [_mM], + [ + [ + () => FlattenedXmlMapWithXmlNameInputOutputMap, + { + [_xN]: _KVP, + [_xF]: 1, + }, + ], + ] +); +export var FlattenedXmlMapWithXmlNameResponse = struct( + n1, + _FXMWXNRl, + 0, + [_mM], + [ + [ + () => FlattenedXmlMapWithXmlNameInputOutputMap, + { + [_xN]: _KVP, + [_xF]: 1, + }, + ], + ] +); +export var FlattenedXmlMapWithXmlNamespaceOutput = struct( + n1, + _FXMWXNO, + 0, + [_mM], + [ + [ + () => FlattenedXmlMapWithXmlNamespaceOutputMap, + { + [_xN]: _KVP, + [_xF]: 1, + [_xNm]: [_, _hm], + }, + ], + ] +); +export var FractionalSecondsOutput = struct(n1, _FSO, 0, [_d], [5]); +export var GreetingWithErrorsOutput = struct( + n1, + _GWEO, + 0, + [_g], + [ + [ + 0, + { + [_hH]: _XG, + }, + ], + ] +); +export var HostLabelHeaderInput = struct( + n1, + _HLHI, + 0, + [_aI], + [ + [ + 0, + { + [_hL]: 1, + [_hH]: _XAAI, + }, + ], + ] +); +export var HttpEmptyPrefixHeadersInput = struct( + n1, + _HEPHI, + 0, + [_pH, _sH], + [ + [ + 128 | 0, + { + [_hPH]: _, + }, + ], + [ + 0, + { + [_hH]: _h, + }, + ], + ] +); +export var HttpEmptyPrefixHeadersOutput = struct( + n1, + _HEPHO, + 0, + [_pH, _sH], + [ + [ + 128 | 0, + { + [_hPH]: _, + }, + ], + [ + 0, + { + [_hH]: _h, + }, + ], + ] +); +export var HttpPayloadTraitsInputOutput = struct( + n1, + _HPTIO, + 0, + [_f, _bl], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + [21, 16], + ] +); +export var HttpPayloadTraitsWithMediaTypeInputOutput = struct( + n1, + _HPTWMTIO, + 0, + [_f, _bl], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + [() => TextPlainBlob, 16], + ] +); +export var HttpPayloadWithMemberXmlNameInputOutput = struct( + n1, + _HPWMXNIO, + 0, + [_n], + [ + [ + () => PayloadWithXmlName, + { + [_hP]: 1, + [_xN]: _Ho, + }, + ], + ] +); +export var HttpPayloadWithStructureInputOutput = struct(n1, _HPWSIO, 0, [_n], [[() => NestedPayload, 16]]); +export var HttpPayloadWithUnionInputOutput = struct(n1, _HPWUIO, 0, [_n], [[() => UnionPayload, 16]]); +export var HttpPayloadWithXmlNameInputOutput = struct(n1, _HPWXNIO, 0, [_n], [[() => PayloadWithXmlName, 16]]); +export var HttpPayloadWithXmlNamespaceAndPrefixInputOutput = struct( + n1, + _HPWXNAPIO, + 0, + [_n], + [[() => PayloadWithXmlNamespaceAndPrefix, 16]] +); +export var HttpPayloadWithXmlNamespaceInputOutput = struct( + n1, + _HPWXNIOt, + 0, + [_n], + [[() => PayloadWithXmlNamespace, 16]] +); +export var HttpPrefixHeadersInputOutput = struct( + n1, + _HPHIO, + 0, + [_f, _fM], + [ + [ + 0, + { + [_hH]: _xf, + }, + ], + [ + 128 | 0, + { + [_hPH]: _xf_, + }, + ], + ] +); +export var HttpRequestWithFloatLabelsInput = struct( + n1, + _HRWFLI, + 0, + [_fl, _do], + [ + [1, 1], + [1, 1], + ] +); +export var HttpRequestWithGreedyLabelInPathInput = struct( + n1, + _HRWGLIPI, + 0, + [_f, _b], + [ + [0, 1], + [0, 1], + ] +); +export var HttpRequestWithLabelsAndTimestampFormatInput = struct( + n1, + _HRWLATFI, + 0, + [_mES, _mHD, _mDT, _dF, _tES, _tHD, _tDT], + [ + [7, 1], + [6, 1], + [5, 1], + [4, 1], + [7, 1], + [6, 1], + [5, 1], + ] +); +export var HttpRequestWithLabelsInput = struct( + n1, + _HRWLI, + 0, + [_s, _sh, _i, _lo, _fl, _do, _bo, _ti], + [ + [0, 1], + [1, 1], + [1, 1], + [1, 1], + [1, 1], + [1, 1], + [2, 1], + [4, 1], + ] +); +export var HttpResponseCodeOutput = struct(n1, _HRCO, 0, [_St], [[1, 32]]); +export var IgnoreQueryParamsInResponseOutput = struct( + n1, + _IQPIRO, + 0, + [_b], + [ + [ + 0, + { + [_hQ]: _b, + }, + ], + ] +); +export var InputAndOutputWithHeadersIO = struct( + n1, + _IAOWHIO, + 0, + [_hS, _hB, _hSe, _hI, _hLe, _hF, _hD, _hTB, _hFB, _hSL, _hSS, _hIL, _hBL, _hTL, _hEe, _hEL], + [ + [ + 0, + { + [_hH]: _XS, + }, + ], + [ + 1, + { + [_hH]: _XB, + }, + ], + [ + 1, + { + [_hH]: _XS_, + }, + ], + [ + 1, + { + [_hH]: _XI, + }, + ], + [ + 1, + { + [_hH]: _XL, + }, + ], + [ + 1, + { + [_hH]: _XF_, + }, + ], + [ + 1, + { + [_hH]: _XD, + }, + ], + [ + 2, + { + [_hH]: _XB_, + }, + ], + [ + 2, + { + [_hH]: _XB__, + }, + ], + [ + 64 | 0, + { + [_hH]: _XS__, + }, + ], + [ + 64 | 0, + { + [_hH]: _XS___, + }, + ], + [ + 64 | 1, + { + [_hH]: _XI_, + }, + ], + [ + 64 | 2, + { + [_hH]: _XB___, + }, + ], + [ + 64 | 4, + { + [_hH]: _XT, + }, + ], + [ + 0, + { + [_hH]: _XE, + }, + ], + [ + 64 | 0, + { + [_hH]: _XE_, + }, + ], + ] +); +export var InvalidGreeting = error( + n1, + _IG, + { + [_e]: _c, + [_hE]: 400, + }, + [_M], + [0], + + __InvalidGreeting +); +export var NestedPayload = struct(n1, _NP, 0, [_g, _na], [0, 0]); +export var NestedXmlMapsRequest = struct( + n1, + _NXMR, + 0, + [_nM, _fNM], + [ + map(n1, _NM, 0, 0, 128 | 0), + [ + map(n1, _NM, 0, 0, 128 | 0), + { + [_xF]: 1, + }, + ], + ] +); +export var NestedXmlMapsResponse = struct( + n1, + _NXMRe, + 0, + [_nM, _fNM], + [ + map(n1, _NM, 0, 0, 128 | 0), + [ + map(n1, _NM, 0, 0, 128 | 0), + { + [_xF]: 1, + }, + ], + ] +); +export var NestedXmlMapWithXmlNameRequest = struct( + n1, + _NXMWXNR, + 0, + [_nXMWXNM], + [[() => NestedXmlMapWithXmlNameMap, 0]] +); +export var NestedXmlMapWithXmlNameResponse = struct( + n1, + _NXMWXNRe, + 0, + [_nXMWXNM], + [[() => NestedXmlMapWithXmlNameMap, 0]] +); +export var NoInputAndOutputOutput = struct(n1, _NIAOO, 0, [], []); +export var NullAndEmptyHeadersIO = struct( + n1, + _NAEHIO, + 0, + [_a, _b_, _c_], + [ + [ + 0, + { + [_hH]: _XA, + }, + ], + [ + 0, + { + [_hH]: _XB____, + }, + ], + [ + 64 | 0, + { + [_hH]: _XC, + }, + ], + ] +); +export var OmitsNullSerializesEmptyStringInput = struct( + n1, + _ONSESI, + 0, + [_nV, _eS], + [ + [ + 0, + { + [_hQ]: _Nu, + }, + ], + [ + 0, + { + [_hQ]: _Em, + }, + ], + ] +); +export var PayloadWithXmlName = struct( + n1, + _PWXN, + { + [_xN]: _He, + }, + [_na], + [0] +); +export var PayloadWithXmlNamespace = struct( + n1, + _PWXNa, + { + [_xNm]: [_, _ht], + }, + [_na], + [0] +); +export var PayloadWithXmlNamespaceAndPrefix = struct( + n1, + _PWXNAP, + { + [_xNm]: [_b, _ht], + }, + [_na], + [0] +); +export var PutWithContentEncodingInput = struct( + n1, + _PWCEI, + 0, + [_en, _da], + [ + [ + 0, + { + [_hH]: _CE_, + }, + ], + 0, + ] +); +export var QueryIdempotencyTokenAutoFillInput = struct( + n1, + _QITAFI, + 0, + [_to], + [ + [ + 0, + { + [_iT]: 1, + [_hQ]: _to, + }, + ], + ] +); +export var QueryParamsAsStringListMapInput = struct( + n1, + _QPASLMI, + 0, + [_q, _f], + [ + [ + 0, + { + [_hQ]: _co, + }, + ], + [map(n0, _SLM, 0, 0, 64 | 0), 64], + ] +); +export var QueryPrecedenceInput = struct( + n1, + _QPI, + 0, + [_f, _b], + [ + [ + 0, + { + [_hQ]: _ba, + }, + ], + [128 | 0, 64], + ] +); +export var RecursiveShapesInputOutputNested1 = struct( + n1, + _RSION, + 0, + [_f, _n], + [0, () => RecursiveShapesInputOutputNested2] +); +export var RecursiveShapesInputOutputNested2 = struct( + n1, + _RSIONe, + 0, + [_ba, _rM], + [0, () => RecursiveShapesInputOutputNested1] +); +export var RecursiveShapesRequest = struct(n1, _RSR, 0, [_n], [() => RecursiveShapesInputOutputNested1]); +export var RecursiveShapesResponse = struct(n1, _RSRe, 0, [_n], [() => RecursiveShapesInputOutputNested1]); +export var SimpleScalarPropertiesRequest = struct( + n1, + _SSPR, + 0, + [_f, _sV, _tBV, _fBV, _bV, _sVh, _iV, _lV, _fV, _dV], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + 0, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + [ + 1, + { + [_xN]: _DD, + }, + ], + ] +); +export var SimpleScalarPropertiesResponse = struct( + n1, + _SSPRi, + 0, + [_f, _sV, _tBV, _fBV, _bV, _sVh, _iV, _lV, _fV, _dV], + [ + [ + 0, + { + [_hH]: _XF, + }, + ], + 0, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + [ + 1, + { + [_xN]: _DD, + }, + ], + ] +); +export var StringPayloadInput = struct(n1, _SPI, 0, [_p], [[0, 16]]); +export var StructureListMember = struct( + n1, + _SLMt, + 0, + [_a, _b_], + [ + [ + 0, + { + [_xN]: _v, + }, + ], + [ + 0, + { + [_xN]: _o, + }, + ], + ] +); +export var TimestampFormatHeadersIO = struct( + n1, + _TFHIO, + 0, + [_mES, _mHD, _mDT, _dF, _tES, _tHD, _tDT], + [ + [ + 7, + { + [_hH]: _Xm, + }, + ], + [ + 6, + { + [_hH]: _Xm_, + }, + ], + [ + 5, + { + [_hH]: _Xm__, + }, + ], + [ + 4, + { + [_hH]: _Xd, + }, + ], + [ + 7, + { + [_hH]: _Xt, + }, + ], + [ + 6, + { + [_hH]: _Xt_, + }, + ], + [ + 5, + { + [_hH]: _Xt__, + }, + ], + ] +); +export var XmlAttributesOnPayloadRequest = struct(n1, _XAOPR, 0, [_p], [[() => XmlAttributesPayloadRequest, 16]]); +export var XmlAttributesOnPayloadResponse = struct(n1, _XAOPRm, 0, [_p], [[() => XmlAttributesPayloadResponse, 16]]); +export var XmlAttributesPayloadRequest = struct( + n1, + _XAPR, + 0, + [_f, _at], + [ + 0, + [ + 0, + { + [_xN]: _te, + [_xA]: 1, + }, + ], + ] +); +export var XmlAttributesPayloadResponse = struct( + n1, + _XAPRm, + 0, + [_f, _at], + [ + 0, + [ + 0, + { + [_xN]: _te, + [_xA]: 1, + }, + ], + ] +); +export var XmlAttributesRequest = struct( + n1, + _XAR, + 0, + [_f, _at], + [ + 0, + [ + 0, + { + [_xN]: _te, + [_xA]: 1, + }, + ], + ] +); +export var XmlAttributesResponse = struct( + n1, + _XARm, + 0, + [_f, _at], + [ + 0, + [ + 0, + { + [_xN]: _te, + [_xA]: 1, + }, + ], + ] +); +export var XmlBlobsRequest = struct(n1, _XBR, 0, [_da], [21]); +export var XmlBlobsResponse = struct(n1, _XBRm, 0, [_da], [21]); +export var XmlEmptyBlobsRequest = struct(n1, _XEBR, 0, [_da], [21]); +export var XmlEmptyBlobsResponse = struct(n1, _XEBRm, 0, [_da], [21]); +export var XmlEmptyListsRequest = struct( + n1, + _XELR, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _rLM, _fL, _fLl, _fLWMN, _fLWN, _sLt, _fSL], + [ + 64 | 0, + 64 | 0, + 64 | 1, + 64 | 2, + 64 | 4, + 64 | 0, + 64 | 1, + list(n0, _NSL, 0, 64 | 0), + [ + () => RenamedListMembers, + { + [_xN]: _r, + }, + ], + [ + () => RenamedListMembers, + { + [_xF]: 1, + }, + ], + [ + () => RenamedListMembers, + { + [_xN]: _cN, + [_xF]: 1, + }, + ], + [ + () => ListWithMemberNamespace, + { + [_xF]: 1, + }, + ], + [ + () => ListWithNamespace, + { + [_xF]: 1, + }, + ], + [ + () => StructureList, + { + [_xN]: _mSL, + }, + ], + [ + () => StructureList, + { + [_xF]: 1, + }, + ], + ] +); +export var XmlEmptyListsResponse = struct( + n1, + _XELRm, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _rLM, _fL, _fLl, _fLWMN, _fLWN, _sLt, _fSL], + [ + 64 | 0, + 64 | 0, + 64 | 1, + 64 | 2, + 64 | 4, + 64 | 0, + 64 | 1, + list(n0, _NSL, 0, 64 | 0), + [ + () => RenamedListMembers, + { + [_xN]: _r, + }, + ], + [ + () => RenamedListMembers, + { + [_xF]: 1, + }, + ], + [ + () => RenamedListMembers, + { + [_xN]: _cN, + [_xF]: 1, + }, + ], + [ + () => ListWithMemberNamespace, + { + [_xF]: 1, + }, + ], + [ + () => ListWithNamespace, + { + [_xF]: 1, + }, + ], + [ + () => StructureList, + { + [_xN]: _mSL, + }, + ], + [ + () => StructureList, + { + [_xF]: 1, + }, + ], + ] +); +export var XmlEmptyMapsRequest = struct(n1, _XEMR, 0, [_mM], [() => XmlMapsInputOutputMap]); +export var XmlEmptyMapsResponse = struct(n1, _XEMRm, 0, [_mM], [() => XmlMapsInputOutputMap]); +export var XmlEmptyStringsRequest = struct(n1, _XESR, 0, [_eS], [0]); +export var XmlEmptyStringsResponse = struct(n1, _XESRm, 0, [_eS], [0]); +export var XmlEnumsRequest = struct( + n1, + _XER, + 0, + [_fE, _fEo, _fEoo, _fEL, _fES, _fEM], + [0, 0, 0, 64 | 0, 64 | 0, 128 | 0] +); +export var XmlEnumsResponse = struct( + n1, + _XERm, + 0, + [_fE, _fEo, _fEoo, _fEL, _fES, _fEM], + [0, 0, 0, 64 | 0, 64 | 0, 128 | 0] +); +export var XmlIntEnumsRequest = struct( + n1, + _XIER, + 0, + [_iE, _iEn, _iEnt, _iEL, _iES, _iEM], + [1, 1, 1, 64 | 1, 64 | 1, 128 | 1] +); +export var XmlIntEnumsResponse = struct( + n1, + _XIERm, + 0, + [_iE, _iEn, _iEnt, _iEL, _iES, _iEM], + [1, 1, 1, 64 | 1, 64 | 1, 128 | 1] +); +export var XmlListsRequest = struct( + n1, + _XLR, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _rLM, _fL, _fLl, _fLWMN, _fLWN, _sLt, _fSL], + [ + 64 | 0, + 64 | 0, + 64 | 1, + 64 | 2, + 64 | 4, + 64 | 0, + 64 | 1, + list(n0, _NSL, 0, 64 | 0), + [ + () => RenamedListMembers, + { + [_xN]: _r, + }, + ], + [ + () => RenamedListMembers, + { + [_xF]: 1, + }, + ], + [ + () => RenamedListMembers, + { + [_xN]: _cN, + [_xF]: 1, + }, + ], + [ + () => ListWithMemberNamespace, + { + [_xF]: 1, + }, + ], + [ + () => ListWithNamespace, + { + [_xF]: 1, + }, + ], + [ + () => StructureList, + { + [_xN]: _mSL, + }, + ], + [ + () => StructureList, + { + [_xF]: 1, + }, + ], + ] +); +export var XmlListsResponse = struct( + n1, + _XLRm, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _rLM, _fL, _fLl, _fLWMN, _fLWN, _sLt, _fSL], + [ + 64 | 0, + 64 | 0, + 64 | 1, + 64 | 2, + 64 | 4, + 64 | 0, + 64 | 1, + list(n0, _NSL, 0, 64 | 0), + [ + () => RenamedListMembers, + { + [_xN]: _r, + }, + ], + [ + () => RenamedListMembers, + { + [_xF]: 1, + }, + ], + [ + () => RenamedListMembers, + { + [_xN]: _cN, + [_xF]: 1, + }, + ], + [ + () => ListWithMemberNamespace, + { + [_xF]: 1, + }, + ], + [ + () => ListWithNamespace, + { + [_xF]: 1, + }, + ], + [ + () => StructureList, + { + [_xN]: _mSL, + }, + ], + [ + () => StructureList, + { + [_xF]: 1, + }, + ], + ] +); +export var XmlMapsRequest = struct(n1, _XMR, 0, [_mM], [() => XmlMapsInputOutputMap]); +export var XmlMapsResponse = struct(n1, _XMRm, 0, [_mM], [() => XmlMapsInputOutputMap]); +export var XmlMapsXmlNameRequest = struct(n1, _XMXNR, 0, [_mM], [[() => XmlMapsXmlNameInputOutputMap, 0]]); +export var XmlMapsXmlNameResponse = struct(n1, _XMXNRm, 0, [_mM], [[() => XmlMapsXmlNameInputOutputMap, 0]]); +export var XmlMapWithXmlNamespaceRequest = struct( + n1, + _XMWXNR, + 0, + [_mM], + [ + [ + () => XmlMapWithXmlNamespaceInputOutputMap, + { + [_xNm]: [_, _hm], + [_xN]: _KVP, + }, + ], + ] +); +export var XmlMapWithXmlNamespaceResponse = struct( + n1, + _XMWXNRm, + 0, + [_mM], + [ + [ + () => XmlMapWithXmlNamespaceInputOutputMap, + { + [_xNm]: [_, _hm], + [_xN]: _KVP, + }, + ], + ] +); +export var XmlNamespaceNested = struct( + n1, + _XNN, + { + [_xNm]: [_, _ht], + }, + [_f, _va], + [ + [ + 0, + { + [_xNm]: [_b, _htt], + }, + ], + [ + () => XmlNamespacedList, + { + [_xNm]: [_, _http], + }, + ], + ] +); +export var XmlNamespacesRequest = struct( + n1, + _XNR, + { + [_xNm]: [_, _ht], + }, + [_n], + [[() => XmlNamespaceNested, 0]] +); +export var XmlNamespacesResponse = struct( + n1, + _XNRm, + { + [_xNm]: [_, _ht], + }, + [_n], + [[() => XmlNamespaceNested, 0]] +); +export var XmlNestedUnionStruct = struct( + n1, + _XNUS, + 0, + [_sV, _bVo, _bV, _sVh, _iV, _lV, _fV, _dV], + [0, 2, 1, 1, 1, 1, 1, 1] +); +export var XmlTimestampsRequest = struct( + n1, + _XTR, + 0, + [_no, _dT, _dTOT, _eSp, _eSOT, _hDt, _hDOT], + [4, 5, 5, 7, 7, 6, 6] +); +export var XmlTimestampsResponse = struct( + n1, + _XTRm, + 0, + [_no, _dT, _dTOT, _eSp, _eSOT, _hDt, _hDOT], + [4, 5, 5, 7, 7, 6, 6] +); +export var XmlUnionsRequest = struct(n1, _XUR, 0, [_uV], [() => XmlUnionShape]); +export var XmlUnionsResponse = struct(n1, _XURm, 0, [_uV], [() => XmlUnionShape]); +export var GreetingStruct = struct(n0, _GS, 0, [_hi], [0]); +export var Unit = "unit" as const; + +export var RestXmlProtocolServiceException = error( + "smithy.ts.sdk.synthetic.aws.protocoltests.restxml", + "RestXmlProtocolServiceException", + 0, + [], + [], + __RestXmlProtocolServiceException +); +export var ListWithMemberNamespace = list( + n1, + _LWMN, + { + [_xNm]: [_, _hl], + }, + [ + 0, + { + [_xNm]: [_, _hm_], + }, + ] +); +export var ListWithNamespace = list( + n1, + _LWN, + { + [_xNm]: [_, _hl], + }, + 0 +); +export var RenamedListMembers = list(n1, _RLM, 0, [ + 0, + { + [_xN]: _it, + }, +]); +export var StructureList = list(n1, _SLt, 0, [ + () => StructureListMember, + { + [_xN]: _it, + }, +]); +export var XmlNamespacedList = list(n1, _XNL, 0, [ + 0, + { + [_xNm]: [_, _httpb], + }, +]); +export var BooleanList = 64 | 2; + +export var DoubleList = 64 | 1; + +export var FooEnumList = 64 | 0; + +export var FooEnumSet = 64 | 0; + +export var IntegerEnumList = 64 | 1; + +export var IntegerEnumSet = 64 | 1; + +export var IntegerList = 64 | 1; + +export var IntegerSet = 64 | 1; + +export var NestedStringList = list(n0, _NSL, 0, 64 | 0); +export var StringList = 64 | 0; + +export var StringSet = 64 | 0; + +export var TimestampList = 64 | 4; + +export var FlattenedXmlMapWithXmlNameInputOutputMap = map( + n1, + _FXMWXNIOM, + 0, + [ + 0, + { + [_xN]: _K, + }, + ], + [ + 0, + { + [_xN]: _V, + }, + ] +); +export var FlattenedXmlMapWithXmlNamespaceOutputMap = map( + n1, + _FXMWXNOM, + 0, + [ + 0, + { + [_xNm]: [_, _hk], + [_xN]: _K, + }, + ], + [ + 0, + { + [_xNm]: [_, _hv], + [_xN]: _V, + }, + ] +); +export var FooPrefixHeaders = 128 | 0; + +export var NestedMap = map(n1, _NM, 0, 0, 128 | 0); +export var NestedXmlMapWithXmlNameInnerMap = map( + n1, + _NXMWXNIM, + 0, + [ + 0, + { + [_xN]: _IK, + }, + ], + [ + 0, + { + [_xN]: _IV, + }, + ] +); +export var NestedXmlMapWithXmlNameMap = map( + n1, + _NXMWXNM, + 0, + [ + 0, + { + [_xN]: _OK, + }, + ], + [() => NestedXmlMapWithXmlNameInnerMap, 0] +); +export var XmlMapsInputOutputMap = map(n1, _XMIOM, 0, 0, () => GreetingStruct); +export var XmlMapsXmlNameInputOutputMap = map( + n1, + _XMXNIOM, + 0, + [ + 0, + { + [_xN]: _At, + }, + ], + [ + () => GreetingStruct, + { + [_xN]: _Se, + }, + ] +); +export var XmlMapWithXmlNamespaceInputOutputMap = map( + n1, + _XMWXNIOM, + 0, + [ + 0, + { + [_xNm]: [_, _hk], + [_xN]: _K, + }, + ], + [ + 0, + { + [_xNm]: [_, _hv], + [_xN]: _V, + }, + ] +); +export var FooEnumMap = 128 | 0; + +export var IntegerEnumMap = 128 | 1; + +export var StringListMap = map(n0, _SLM, 0, 0, 64 | 0); +export var StringMap = 128 | 0; + +export var UnionPayload = uni(n1, _UP, 0, [_g], [0]); +export var XmlUnionShape = uni( + n1, + _XUS, + 0, + [_sV, _bVo, _bV, _sVh, _iV, _lV, _fV, _dV, _uV, _sVt], + [0, 2, 1, 1, 1, 1, 1, 1, () => XmlUnionShape, () => XmlNestedUnionStruct] +); +export var AllQueryStringTypes = op( + n1, + _AQST, + { + [_http_]: ["GET", "/AllQueryStringTypesInput", 200], + }, + () => AllQueryStringTypesInput, + () => Unit +); +export var BodyWithXmlName = op( + n1, + _BWXN, + { + [_http_]: ["PUT", "/BodyWithXmlName", 200], + }, + () => BodyWithXmlNameInputOutput, + () => BodyWithXmlNameInputOutput +); +export var ConstantAndVariableQueryString = op( + n1, + _CAVQS, + { + [_http_]: ["GET", "/ConstantAndVariableQueryString?foo=bar", 200], + }, + () => ConstantAndVariableQueryStringInput, + () => Unit +); +export var ConstantQueryString = op( + n1, + _CQS, + { + [_http_]: ["GET", "/ConstantQueryString/{hello}?foo=bar&hello", 200], + }, + () => ConstantQueryStringInput, + () => Unit +); +export var ContentTypeParameters = op( + n1, + _CTP, + { + [_http_]: ["PUT", "/ContentTypeParameters", 200], + }, + () => ContentTypeParametersInput, + () => ContentTypeParametersOutput +); +export var DatetimeOffsets = op( + n1, + _DO, + { + [_http_]: ["POST", "/DatetimeOffsets", 200], + }, + () => Unit, + () => DatetimeOffsetsOutput +); +export var EmptyInputAndEmptyOutput = op( + n1, + _EIAEO, + { + [_http_]: ["POST", "/EmptyInputAndEmptyOutput", 200], + }, + () => EmptyInputAndEmptyOutputInput, + () => EmptyInputAndEmptyOutputOutput +); +export var EndpointOperation = op( + n1, + _EO, + { + [_http_]: ["POST", "/EndpointOperation", 200], + [_end]: ["foo."], + }, + () => Unit, + () => Unit +); +export var EndpointWithHostLabelHeaderOperation = op( + n1, + _EWHLHO, + { + [_http_]: ["POST", "/EndpointWithHostLabelHeaderOperation", 200], + [_end]: ["{accountId}."], + }, + () => HostLabelHeaderInput, + () => Unit +); +export var EndpointWithHostLabelOperation = op( + n1, + _EWHLO, + { + [_http_]: ["POST", "/EndpointWithHostLabelOperation", 200], + [_end]: ["foo.{label}."], + }, + () => EndpointWithHostLabelOperationRequest, + () => Unit +); +export var FlattenedXmlMap = op( + n1, + _FXM, + { + [_http_]: ["POST", "/FlattenedXmlMap", 200], + }, + () => FlattenedXmlMapRequest, + () => FlattenedXmlMapResponse +); +export var FlattenedXmlMapWithXmlName = op( + n1, + _FXMWXN, + { + [_http_]: ["POST", "/FlattenedXmlMapWithXmlName", 200], + }, + () => FlattenedXmlMapWithXmlNameRequest, + () => FlattenedXmlMapWithXmlNameResponse +); +export var FlattenedXmlMapWithXmlNamespace = op( + n1, + _FXMWXNl, + { + [_http_]: ["POST", "/FlattenedXmlMapWithXmlNamespace", 200], + }, + () => Unit, + () => FlattenedXmlMapWithXmlNamespaceOutput +); +export var FractionalSeconds = op( + n1, + _FS, + { + [_http_]: ["POST", "/FractionalSeconds", 200], + }, + () => Unit, + () => FractionalSecondsOutput +); +export var GreetingWithErrors = op( + n1, + _GWE, + { + [_http_]: ["PUT", "/GreetingWithErrors", 200], + }, + () => Unit, + () => GreetingWithErrorsOutput +); +export var HttpEmptyPrefixHeaders = op( + n1, + _HEPH, + { + [_http_]: ["GET", "/HttpEmptyPrefixHeaders", 200], + }, + () => HttpEmptyPrefixHeadersInput, + () => HttpEmptyPrefixHeadersOutput +); +export var HttpEnumPayload = op( + n1, + _HEP, + { + [_http_]: ["POST", "/EnumPayload", 200], + }, + () => EnumPayloadInput, + () => EnumPayloadInput +); +export var HttpPayloadTraits = op( + n1, + _HPT, + { + [_http_]: ["POST", "/HttpPayloadTraits", 200], + }, + () => HttpPayloadTraitsInputOutput, + () => HttpPayloadTraitsInputOutput +); +export var HttpPayloadTraitsWithMediaType = op( + n1, + _HPTWMT, + { + [_http_]: ["POST", "/HttpPayloadTraitsWithMediaType", 200], + }, + () => HttpPayloadTraitsWithMediaTypeInputOutput, + () => HttpPayloadTraitsWithMediaTypeInputOutput +); +export var HttpPayloadWithMemberXmlName = op( + n1, + _HPWMXN, + { + [_http_]: ["PUT", "/HttpPayloadWithMemberXmlName", 200], + }, + () => HttpPayloadWithMemberXmlNameInputOutput, + () => HttpPayloadWithMemberXmlNameInputOutput +); +export var HttpPayloadWithStructure = op( + n1, + _HPWS, + { + [_http_]: ["PUT", "/HttpPayloadWithStructure", 200], + }, + () => HttpPayloadWithStructureInputOutput, + () => HttpPayloadWithStructureInputOutput +); +export var HttpPayloadWithUnion = op( + n1, + _HPWU, + { + [_http_]: ["PUT", "/HttpPayloadWithUnion", 200], + }, + () => HttpPayloadWithUnionInputOutput, + () => HttpPayloadWithUnionInputOutput +); +export var HttpPayloadWithXmlName = op( + n1, + _HPWXN, + { + [_http_]: ["PUT", "/HttpPayloadWithXmlName", 200], + }, + () => HttpPayloadWithXmlNameInputOutput, + () => HttpPayloadWithXmlNameInputOutput +); +export var HttpPayloadWithXmlNamespace = op( + n1, + _HPWXNt, + { + [_http_]: ["PUT", "/HttpPayloadWithXmlNamespace", 200], + }, + () => HttpPayloadWithXmlNamespaceInputOutput, + () => HttpPayloadWithXmlNamespaceInputOutput +); +export var HttpPayloadWithXmlNamespaceAndPrefix = op( + n1, + _HPWXNAP, + { + [_http_]: ["PUT", "/HttpPayloadWithXmlNamespaceAndPrefix", 200], + }, + () => HttpPayloadWithXmlNamespaceAndPrefixInputOutput, + () => HttpPayloadWithXmlNamespaceAndPrefixInputOutput +); +export var HttpPrefixHeaders = op( + n1, + _HPH, + { + [_http_]: ["GET", "/HttpPrefixHeaders", 200], + }, + () => HttpPrefixHeadersInputOutput, + () => HttpPrefixHeadersInputOutput +); +export var HttpRequestWithFloatLabels = op( + n1, + _HRWFL, + { + [_http_]: ["GET", "/FloatHttpLabels/{float}/{double}", 200], + }, + () => HttpRequestWithFloatLabelsInput, + () => Unit +); +export var HttpRequestWithGreedyLabelInPath = op( + n1, + _HRWGLIP, + { + [_http_]: ["GET", "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}", 200], + }, + () => HttpRequestWithGreedyLabelInPathInput, + () => Unit +); +export var HttpRequestWithLabels = op( + n1, + _HRWL, + { + [_http_]: [ + "GET", + "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}", + 200, + ], + }, + () => HttpRequestWithLabelsInput, + () => Unit +); +export var HttpRequestWithLabelsAndTimestampFormat = op( + n1, + _HRWLATF, + { + [_http_]: [ + "GET", + "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}", + 200, + ], + }, + () => HttpRequestWithLabelsAndTimestampFormatInput, + () => Unit +); +export var HttpResponseCode = op( + n1, + _HRC, + { + [_http_]: ["PUT", "/HttpResponseCode", 200], + }, + () => Unit, + () => HttpResponseCodeOutput +); +export var HttpStringPayload = op( + n1, + _HSP, + { + [_http_]: ["POST", "/StringPayload", 200], + }, + () => StringPayloadInput, + () => StringPayloadInput +); +export var IgnoreQueryParamsInResponse = op( + n1, + _IQPIR, + { + [_http_]: ["GET", "/IgnoreQueryParamsInResponse", 200], + }, + () => Unit, + () => IgnoreQueryParamsInResponseOutput +); +export var InputAndOutputWithHeaders = op( + n1, + _IAOWH, + { + [_http_]: ["POST", "/InputAndOutputWithHeaders", 200], + }, + () => InputAndOutputWithHeadersIO, + () => InputAndOutputWithHeadersIO +); +export var NestedXmlMaps = op( + n1, + _NXM, + { + [_http_]: ["POST", "/NestedXmlMaps", 200], + }, + () => NestedXmlMapsRequest, + () => NestedXmlMapsResponse +); +export var NestedXmlMapWithXmlName = op( + n1, + _NXMWXN, + { + [_http_]: ["POST", "/NestedXmlMapWithXmlName", 200], + }, + () => NestedXmlMapWithXmlNameRequest, + () => NestedXmlMapWithXmlNameResponse +); +export var NoInputAndNoOutput = op( + n1, + _NIANO, + { + [_http_]: ["POST", "/NoInputAndNoOutput", 200], + }, + () => Unit, + () => Unit +); +export var NoInputAndOutput = op( + n1, + _NIAO, + { + [_http_]: ["POST", "/NoInputAndOutputOutput", 200], + }, + () => Unit, + () => NoInputAndOutputOutput +); +export var NullAndEmptyHeadersClient = op( + n1, + _NAEHC, + { + [_http_]: ["GET", "/NullAndEmptyHeadersClient", 200], + }, + () => NullAndEmptyHeadersIO, + () => NullAndEmptyHeadersIO +); +export var NullAndEmptyHeadersServer = op( + n1, + _NAEHS, + { + [_http_]: ["GET", "/NullAndEmptyHeadersServer", 200], + }, + () => NullAndEmptyHeadersIO, + () => NullAndEmptyHeadersIO +); +export var OmitsNullSerializesEmptyString = op( + n1, + _ONSES, + { + [_http_]: ["GET", "/OmitsNullSerializesEmptyString", 200], + }, + () => OmitsNullSerializesEmptyStringInput, + () => Unit +); +export var PutWithContentEncoding = op( + n1, + _PWCE, + { + [_http_]: ["POST", "/requestcompression/putcontentwithencoding", 200], + }, + () => PutWithContentEncodingInput, + () => Unit +); +export var QueryIdempotencyTokenAutoFill = op( + n1, + _QITAF, + { + [_http_]: ["POST", "/QueryIdempotencyTokenAutoFill", 200], + }, + () => QueryIdempotencyTokenAutoFillInput, + () => Unit +); +export var QueryParamsAsStringListMap = op( + n1, + _QPASLM, + { + [_http_]: ["POST", "/StringListMap", 200], + }, + () => QueryParamsAsStringListMapInput, + () => Unit +); +export var QueryPrecedence = op( + n1, + _QP, + { + [_http_]: ["POST", "/Precedence", 200], + }, + () => QueryPrecedenceInput, + () => Unit +); +export var RecursiveShapes = op( + n1, + _RS, + { + [_http_]: ["PUT", "/RecursiveShapes", 200], + }, + () => RecursiveShapesRequest, + () => RecursiveShapesResponse +); +export var SimpleScalarProperties = op( + n1, + _SSP, + { + [_http_]: ["PUT", "/SimpleScalarProperties", 200], + }, + () => SimpleScalarPropertiesRequest, + () => SimpleScalarPropertiesResponse +); +export var TimestampFormatHeaders = op( + n1, + _TFH, + { + [_http_]: ["POST", "/TimestampFormatHeaders", 200], + }, + () => TimestampFormatHeadersIO, + () => TimestampFormatHeadersIO +); +export var XmlAttributes = op( + n1, + _XAm, + { + [_http_]: ["PUT", "/XmlAttributes", 200], + }, + () => XmlAttributesRequest, + () => XmlAttributesResponse +); +export var XmlAttributesOnPayload = op( + n1, + _XAOP, + { + [_http_]: ["PUT", "/XmlAttributesOnPayload", 200], + }, + () => XmlAttributesOnPayloadRequest, + () => XmlAttributesOnPayloadResponse +); +export var XmlBlobs = op( + n1, + _XBm, + { + [_http_]: ["POST", "/XmlBlobs", 200], + }, + () => XmlBlobsRequest, + () => XmlBlobsResponse +); +export var XmlEmptyBlobs = op( + n1, + _XEB, + { + [_http_]: ["POST", "/XmlEmptyBlobs", 200], + }, + () => XmlEmptyBlobsRequest, + () => XmlEmptyBlobsResponse +); +export var XmlEmptyLists = op( + n1, + _XEL, + { + [_http_]: ["PUT", "/XmlEmptyLists", 200], + }, + () => XmlEmptyListsRequest, + () => XmlEmptyListsResponse +); +export var XmlEmptyMaps = op( + n1, + _XEM, + { + [_http_]: ["POST", "/XmlEmptyMaps", 200], + }, + () => XmlEmptyMapsRequest, + () => XmlEmptyMapsResponse +); +export var XmlEmptyStrings = op( + n1, + _XES, + { + [_http_]: ["PUT", "/XmlEmptyStrings", 200], + }, + () => XmlEmptyStringsRequest, + () => XmlEmptyStringsResponse +); +export var XmlEnums = op( + n1, + _XEm, + { + [_http_]: ["PUT", "/XmlEnums", 200], + }, + () => XmlEnumsRequest, + () => XmlEnumsResponse +); +export var XmlIntEnums = op( + n1, + _XIE, + { + [_http_]: ["PUT", "/XmlIntEnums", 200], + }, + () => XmlIntEnumsRequest, + () => XmlIntEnumsResponse +); +export var XmlLists = op( + n1, + _XLm, + { + [_http_]: ["PUT", "/XmlLists", 200], + }, + () => XmlListsRequest, + () => XmlListsResponse +); +export var XmlMaps = op( + n1, + _XM, + { + [_http_]: ["POST", "/XmlMaps", 200], + }, + () => XmlMapsRequest, + () => XmlMapsResponse +); +export var XmlMapsXmlName = op( + n1, + _XMXN, + { + [_http_]: ["POST", "/XmlMapsXmlName", 200], + }, + () => XmlMapsXmlNameRequest, + () => XmlMapsXmlNameResponse +); +export var XmlMapWithXmlNamespace = op( + n1, + _XMWXN, + { + [_http_]: ["POST", "/XmlMapWithXmlNamespace", 200], + }, + () => XmlMapWithXmlNamespaceRequest, + () => XmlMapWithXmlNamespaceResponse +); +export var XmlNamespaces = op( + n1, + _XN, + { + [_http_]: ["POST", "/XmlNamespaces", 200], + }, + () => XmlNamespacesRequest, + () => XmlNamespacesResponse +); +export var XmlTimestamps = op( + n1, + _XTm, + { + [_http_]: ["POST", "/XmlTimestamps", 200], + }, + () => XmlTimestampsRequest, + () => XmlTimestampsResponse +); +export var XmlUnions = op( + n1, + _XU, + { + [_http_]: ["PUT", "/XmlUnions", 200], + }, + () => XmlUnionsRequest, + () => XmlUnionsResponse +); diff --git a/private/aws-protocoltests-restxml-schema/test/functional/restxml.spec.ts b/private/aws-protocoltests-restxml-schema/test/functional/restxml.spec.ts new file mode 100644 index 0000000000000..172806c1c56a9 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/test/functional/restxml.spec.ts @@ -0,0 +1,8101 @@ +// smithy-typescript generated code +import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; +import { buildQueryString } from "@smithy/querystring-builder"; +import { Encoder as __Encoder } from "@smithy/types"; +import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; +import { decodeHTML } from "entities"; +import { XMLParser } from "fast-xml-parser"; +import { Readable } from "stream"; +import { expect, test as it } from "vitest"; + +import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand"; +import { BodyWithXmlNameCommand } from "../../src/commands/BodyWithXmlNameCommand"; +import { ConstantAndVariableQueryStringCommand } from "../../src/commands/ConstantAndVariableQueryStringCommand"; +import { ConstantQueryStringCommand } from "../../src/commands/ConstantQueryStringCommand"; +import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelHeaderOperationCommand } from "../../src/commands/EndpointWithHostLabelHeaderOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommand } from "../../src/commands/FlattenedXmlMapCommand"; +import { FlattenedXmlMapWithXmlNameCommand } from "../../src/commands/FlattenedXmlMapWithXmlNameCommand"; +import { FlattenedXmlMapWithXmlNamespaceCommand } from "../../src/commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { FractionalSecondsCommand } from "../../src/commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HttpEmptyPrefixHeadersCommand } from "../../src/commands/HttpEmptyPrefixHeadersCommand"; +import { HttpEnumPayloadCommand } from "../../src/commands/HttpEnumPayloadCommand"; +import { HttpPayloadTraitsCommand } from "../../src/commands/HttpPayloadTraitsCommand"; +import { HttpPayloadTraitsWithMediaTypeCommand } from "../../src/commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { HttpPayloadWithMemberXmlNameCommand } from "../../src/commands/HttpPayloadWithMemberXmlNameCommand"; +import { HttpPayloadWithStructureCommand } from "../../src/commands/HttpPayloadWithStructureCommand"; +import { HttpPayloadWithUnionCommand } from "../../src/commands/HttpPayloadWithUnionCommand"; +import { HttpPayloadWithXmlNameCommand } from "../../src/commands/HttpPayloadWithXmlNameCommand"; +import { HttpPayloadWithXmlNamespaceAndPrefixCommand } from "../../src/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand"; +import { HttpPayloadWithXmlNamespaceCommand } from "../../src/commands/HttpPayloadWithXmlNamespaceCommand"; +import { HttpPrefixHeadersCommand } from "../../src/commands/HttpPrefixHeadersCommand"; +import { HttpRequestWithFloatLabelsCommand } from "../../src/commands/HttpRequestWithFloatLabelsCommand"; +import { HttpRequestWithGreedyLabelInPathCommand } from "../../src/commands/HttpRequestWithGreedyLabelInPathCommand"; +import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../src/commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { HttpRequestWithLabelsCommand } from "../../src/commands/HttpRequestWithLabelsCommand"; +import { HttpResponseCodeCommand } from "../../src/commands/HttpResponseCodeCommand"; +import { HttpStringPayloadCommand } from "../../src/commands/HttpStringPayloadCommand"; +import { IgnoreQueryParamsInResponseCommand } from "../../src/commands/IgnoreQueryParamsInResponseCommand"; +import { InputAndOutputWithHeadersCommand } from "../../src/commands/InputAndOutputWithHeadersCommand"; +import { NestedXmlMapsCommand } from "../../src/commands/NestedXmlMapsCommand"; +import { NestedXmlMapWithXmlNameCommand } from "../../src/commands/NestedXmlMapWithXmlNameCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { NullAndEmptyHeadersClientCommand } from "../../src/commands/NullAndEmptyHeadersClientCommand"; +import { OmitsNullSerializesEmptyStringCommand } from "../../src/commands/OmitsNullSerializesEmptyStringCommand"; +import { PutWithContentEncodingCommand } from "../../src/commands/PutWithContentEncodingCommand"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryParamsAsStringListMapCommand } from "../../src/commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommand } from "../../src/commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommand } from "../../src/commands/RecursiveShapesCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { TimestampFormatHeadersCommand } from "../../src/commands/TimestampFormatHeadersCommand"; +import { XmlAttributesCommand } from "../../src/commands/XmlAttributesCommand"; +import { XmlAttributesOnPayloadCommand } from "../../src/commands/XmlAttributesOnPayloadCommand"; +import { XmlBlobsCommand } from "../../src/commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommand } from "../../src/commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommand } from "../../src/commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommand } from "../../src/commands/XmlEmptyMapsCommand"; +import { XmlEmptyStringsCommand } from "../../src/commands/XmlEmptyStringsCommand"; +import { XmlEnumsCommand } from "../../src/commands/XmlEnumsCommand"; +import { XmlIntEnumsCommand } from "../../src/commands/XmlIntEnumsCommand"; +import { XmlListsCommand } from "../../src/commands/XmlListsCommand"; +import { XmlMapsCommand } from "../../src/commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommand } from "../../src/commands/XmlMapsXmlNameCommand"; +import { XmlMapWithXmlNamespaceCommand } from "../../src/commands/XmlMapWithXmlNamespaceCommand"; +import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand"; +import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand"; +import { XmlUnionsCommand } from "../../src/commands/XmlUnionsCommand"; +import { RestXmlProtocolClient } from "../../src/RestXmlProtocolClient"; + +/** + * Throws an expected exception that contains the serialized request. + */ +class EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error { + constructor(readonly request: HttpRequest) { + super(); + } +} + +/** + * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a + * request. The thrown exception contains the serialized request. + */ +class RequestSerializationTestHandler implements HttpHandler { + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request)); + } + updateHttpClientConfig(key: never, value: never): void {} + httpHandlerConfigs() { + return {}; + } +} + +/** + * Returns a resolved Promise of the specified response contents. + */ +class ResponseDeserializationTestHandler implements HttpHandler { + isSuccess: boolean; + code: number; + headers: HeaderBag; + body: string | Uint8Array; + isBase64Body: boolean; + + constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) { + this.isSuccess = isSuccess; + this.code = code; + if (headers === undefined) { + this.headers = {}; + } else { + this.headers = headers; + } + if (body === undefined) { + body = ""; + } + this.body = body; + this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), "base64").toString("base64") === body; + } + + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.resolve({ + response: new HttpResponse({ + statusCode: this.code, + headers: this.headers, + body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]), + }), + }); + } + + updateHttpClientConfig(key: never, value: never): void {} + + httpHandlerConfigs() { + return {}; + } +} + +interface comparableParts { + [key: string]: string; +} + +/** + * Generates a standard map of un-equal values given input parts. + */ +const compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => { + const unequalParts: any = {}; + Object.keys(expectedParts).forEach((key) => { + if (generatedParts[key] === undefined) { + unequalParts[key] = { exp: expectedParts[key], gen: undefined }; + } else if (!equivalentContents(expectedParts[key], generatedParts[key])) { + unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] }; + } + }); + + Object.keys(generatedParts).forEach((key) => { + if (expectedParts[key] === undefined) { + unequalParts[key] = { exp: undefined, gen: generatedParts[key] }; + } + }); + + if (Object.keys(unequalParts).length !== 0) { + return unequalParts; + } + return undefined; +}; + +/** + * Compares all types for equivalent contents, doing nested + * equality checks based on non-`$metadata` + * properties that have defined values. + */ +const equivalentContents = (expected: any, generated: any): boolean => { + if (typeof (global as any).expect === "function") { + expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected)); + return true; + } + + const localExpected = expected; + + // Short circuit on equality. + if (localExpected == generated) { + return true; + } + + if (typeof expected !== "object") { + return expected === generated; + } + + // If a test fails with an issue in the below 6 lines, it's likely + // due to an issue in the nestedness or existence of the property + // being compared. + delete localExpected["$metadata"]; + delete generated["$metadata"]; + Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]); + Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]); + + const expectedProperties = Object.getOwnPropertyNames(localExpected); + const generatedProperties = Object.getOwnPropertyNames(generated); + + // Short circuit on different property counts. + if (expectedProperties.length != generatedProperties.length) { + return false; + } + + // Compare properties directly. + for (let index = 0; index < expectedProperties.length; index++) { + const propertyName = expectedProperties[index]; + if (!equivalentContents(localExpected[propertyName], generated[propertyName])) { + return false; + } + } + + return true; +}; + +const clientParams = { + region: "us-west-2", + credentials: { accessKeyId: "key", secretAccessKey: "secret" }, + endpoint: () => { + const url = new URL("https://localhost/"); + return Promise.resolve({ + hostname: url.hostname, + protocol: url.protocol, + path: url.pathname, + }) as Promise; + }, +}; + +/** + * A wrapper function that shadows `fail` from jest-jasmine2 + * (jasmine2 was replaced with circus in > v27 as the default test runner) + */ +const fail = (error?: any): never => { + throw new Error(error); +}; + +/** + * Hexadecimal to byteArray. + */ +const toBytes = (hex: string) => { + return Buffer.from(hex, "base64"); +}; + +function normalizeByteArrayType(data: any) { + // normalize float32 errors + if (typeof data === "number") { + const u = new Uint8Array(4); + const dv = new DataView(u.buffer, u.byteOffset, u.byteLength); + dv.setFloat32(0, data); + return dv.getFloat32(0); + } + if (!data || typeof data !== "object") { + return data; + } + if (data instanceof Uint8Array) { + return Uint8Array.from(data); + } + if (data instanceof String || data instanceof Boolean || data instanceof Number) { + return data.valueOf(); + } + const output = {} as any; + for (const key of Object.getOwnPropertyNames(data)) { + output[key] = normalizeByteArrayType(data[key]); + } + return output; +} + +/** + * Serializes query string parameters with all supported types + */ +it("AllQueryStringTypes:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryString: "Hello there", + queryStringList: ["a", "b", "c"], + queryStringSet: ["a", "b", "c"], + queryByte: 1, + queryShort: 2, + queryInteger: 3, + queryIntegerList: [1, 2, 3], + queryIntegerSet: [1, 2, 3], + queryLong: 4, + queryFloat: 1.1, + queryDouble: 1.1, + queryDoubleList: [1.1, 2.1, 3.1], + queryBoolean: true, + queryBooleanList: [true, false, true], + queryTimestamp: new Date(1000), + queryTimestampList: [new Date(1000), new Date(2000), new Date(3000)], + queryEnum: "Foo", + queryEnumList: ["Foo", "Baz", "Bar"], + queryIntegerEnum: 1, + queryIntegerEnumList: [1, 2], + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("String=Hello%20there"); + expect(queryString).toContain("StringList=a"); + expect(queryString).toContain("StringList=b"); + expect(queryString).toContain("StringList=c"); + expect(queryString).toContain("StringSet=a"); + expect(queryString).toContain("StringSet=b"); + expect(queryString).toContain("StringSet=c"); + expect(queryString).toContain("Byte=1"); + expect(queryString).toContain("Short=2"); + expect(queryString).toContain("Integer=3"); + expect(queryString).toContain("IntegerList=1"); + expect(queryString).toContain("IntegerList=2"); + expect(queryString).toContain("IntegerList=3"); + expect(queryString).toContain("IntegerSet=1"); + expect(queryString).toContain("IntegerSet=2"); + expect(queryString).toContain("IntegerSet=3"); + expect(queryString).toContain("Long=4"); + expect(queryString).toContain("Float=1.1"); + expect(queryString).toContain("Double=1.1"); + expect(queryString).toContain("DoubleList=1.1"); + expect(queryString).toContain("DoubleList=2.1"); + expect(queryString).toContain("DoubleList=3.1"); + expect(queryString).toContain("Boolean=true"); + expect(queryString).toContain("BooleanList=true"); + expect(queryString).toContain("BooleanList=false"); + expect(queryString).toContain("BooleanList=true"); + expect(queryString).toContain("Timestamp=1970-01-01T00%3A00%3A01Z"); + expect(queryString).toContain("TimestampList=1970-01-01T00%3A00%3A01Z"); + expect(queryString).toContain("TimestampList=1970-01-01T00%3A00%3A02Z"); + expect(queryString).toContain("TimestampList=1970-01-01T00%3A00%3A03Z"); + expect(queryString).toContain("Enum=Foo"); + expect(queryString).toContain("EnumList=Foo"); + expect(queryString).toContain("EnumList=Baz"); + expect(queryString).toContain("EnumList=Bar"); + expect(queryString).toContain("IntegerEnum=1"); + expect(queryString).toContain("IntegerEnumList=1"); + expect(queryString).toContain("IntegerEnumList=2"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Handles query string maps + */ +it("RestXmlQueryStringMap:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryParamsMapOfStrings: { + QueryParamsStringKeyA: "Foo", + QueryParamsStringKeyB: "Bar", + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("QueryParamsStringKeyA=Foo"); + expect(queryString).toContain("QueryParamsStringKeyB=Bar"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Handles escaping all required characters in the query string. + */ +it("RestXmlQueryStringEscaping:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryString: " %:/?#[]@!$&'()*+,;=😹", + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("String=%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling NaN float query values. + */ +it("RestXmlSupportsNaNFloatQueryValues:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryFloat: NaN, + queryDouble: NaN, + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Float=NaN"); + expect(queryString).toContain("Double=NaN"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling Infinity float query values. + */ +it("RestXmlSupportsInfinityFloatQueryValues:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryFloat: Infinity, + queryDouble: Infinity, + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Float=Infinity"); + expect(queryString).toContain("Double=Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling -Infinity float query values. + */ +it("RestXmlSupportsNegativeInfinityFloatQueryValues:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryFloat: -Infinity, + queryDouble: -Infinity, + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Float=-Infinity"); + expect(queryString).toContain("Double=-Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Query values of 0 and false are serialized + */ +it("RestXmlZeroAndFalseQueryValues:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new AllQueryStringTypesCommand({ + queryInteger: 0, + queryBoolean: false, + } 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("GET"); + expect(r.path).toBe("/AllQueryStringTypesInput"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Integer=0"); + expect(queryString).toContain("Boolean=false"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a payload using a wrapper name based on the xmlName + */ +it("BodyWithXmlName:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new BodyWithXmlNameCommand({ + nested: { + name: "Phreddy", + } 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("PUT"); + expect(r.path).toBe("/BodyWithXmlName"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Phreddy`; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a payload using a wrapper name based on the xmlName + */ +it("BodyWithXmlName:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + `Phreddy` + ), + }); + + const params: any = {}; + const command = new BodyWithXmlNameCommand(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 = [ + { + nested: { + name: "Phreddy", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Mixes constant and variable query string parameters + */ +it("ConstantAndVariableQueryStringMissingOneValue:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new ConstantAndVariableQueryStringCommand({ + baz: "bam", + } 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("GET"); + expect(r.path).toBe("/ConstantAndVariableQueryString"); + + expect( + r.query["maybeSet"], + `Query key "maybeSet" should have been undefined in ${JSON.stringify(r.query)}` + ).toBeUndefined(); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("foo=bar"); + expect(queryString).toContain("baz=bam"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Mixes constant and variable query string parameters + */ +it("ConstantAndVariableQueryStringAllValues:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new ConstantAndVariableQueryStringCommand({ + baz: "bam", + maybeSet: "yes", + } 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("GET"); + expect(r.path).toBe("/ConstantAndVariableQueryString"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("foo=bar"); + expect(queryString).toContain("baz=bam"); + expect(queryString).toContain("maybeSet=yes"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Includes constant query string parameters + */ +it("ConstantQueryString:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new ConstantQueryStringCommand({ + hello: "hi", + } 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("GET"); + expect(r.path).toBe("/ConstantQueryString/hi"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("foo=bar"); + expect(queryString).toContain("hello"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("RestXmlDateTimeWithNegativeOffset:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 2019-12-16T22:48:18-01:00 + + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse datetime (timestamps) with offsets + */ +it("RestXmlDateTimeWithPositiveOffset:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 2019-12-17T00:48:18+01:00 + + ` + ), + }); + + const params: any = {}; + const command = new DatetimeOffsetsCommand(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 = [ + { + datetime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty input serializes no payload + */ +it("EmptyInputAndEmptyOutput:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyInputAndEmptyOutputCommand({} 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("/EmptyInputAndEmptyOutput"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Empty output serializes no payload + */ +it("EmptyInputAndEmptyOutput:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new EmptyInputAndEmptyOutputCommand(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); +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait. + */ +it("RestXmlEndpointTrait:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointOperationCommand({}); + 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("/EndpointOperation"); + + expect(r.headers["host"]).toBe("foo.example.com"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait, and can use the host label trait to define + * further customization based on user input. The label must also + * be serialized in into any other location it is bound to, such + * as the body or in this case an http header. + */ +it("RestXmlEndpointTraitWithHostLabelAndHttpBinding:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointWithHostLabelHeaderOperationCommand({ + accountId: "bar", + } 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("/EndpointWithHostLabelHeaderOperation"); + + expect(r.headers["x-amz-account-id"]).toBe("bar"); + + expect(r.headers["host"]).toBe("bar.example.com"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Operations can prepend to the given host if they define the + * endpoint trait, and can use the host label trait to define + * further customization based on user input. + */ +it("RestXmlEndpointTraitWithHostLabel:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + endpoint: "https://example.com", + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EndpointWithHostLabelOperationCommand({ + label: "bar", + } 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("/EndpointWithHostLabelOperation"); + + expect(r.headers["host"]).toBe("foo.bar.example.com"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes flattened XML maps in requests + */ +it("FlattenedXmlMap:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new FlattenedXmlMapCommand({ + myMap: { + foo: "Foo", + baz: "Baz", + } 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("/FlattenedXmlMap"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + foo + Foo + + + baz + Baz + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes flattened XML maps in responses + */ +it("FlattenedXmlMap:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + foo + Foo + + + baz + Baz + + ` + ), + }); + + const params: any = {}; + const command = new FlattenedXmlMapCommand(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 = [ + { + myMap: { + foo: "Foo", + baz: "Baz", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes flattened XML maps in requests that have xmlName on members + */ +it("FlattenedXmlMapWithXmlName:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new FlattenedXmlMapWithXmlNameCommand({ + myMap: { + a: "A", + b: "B", + } 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("/FlattenedXmlMapWithXmlName"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + a + A + + + b + B + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes flattened XML maps in responses that have xmlName on members + */ +it("FlattenedXmlMapWithXmlName:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + a + A + + + b + B + + ` + ), + }); + + const params: any = {}; + const command = new FlattenedXmlMapWithXmlNameCommand(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 = [ + { + myMap: { + a: "A", + b: "B", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes flattened XML maps in responses that have xmlNamespace and xmlName on members + */ +it("RestXmlFlattenedXmlMapWithXmlNamespace:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + a + A + + + b + B + + ` + ), + }); + + const params: any = {}; + const command = new FlattenedXmlMapWithXmlNamespaceCommand(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 = [ + { + myMap: { + a: "A", + b: "B", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse datetime timestamps with fractional seconds + */ +it("RestXmlDateTimeWithFractionalSeconds:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 2000-01-02T20:34:56.123Z + + ` + ), + }); + + const params: any = {}; + const command = new FractionalSecondsCommand(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 = [ + { + datetime: new Date(9.46845296123e8 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that operations with errors successfully know how to deserialize the successful response + */ +it("GreetingWithErrors:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-greeting": "Hello", + }, + `` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(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 = [ + { + greeting: "Hello", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses simple XML errors + */ +it("InvalidGreetingError:Error:GreetingWithErrors", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "content-type": "application/xml", + }, + ` + + Sender + InvalidGreeting + Hi + setting + + foo-id + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "InvalidGreeting") { + console.log(err); + fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +it("ComplexError:Error:GreetingWithErrors", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 403, + { + "x-header": "Header", + "content-type": "application/xml", + }, + ` + + Sender + ComplexError + Hi + Top level + + bar + + + foo-id + + ` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(403); + const paramsToValidate: any = [ + { + Header: "Header", + TopLevel: "Top level", + Nested: { + Foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Serializes all request headers, using specific when present + */ +it("HttpEmptyPrefixHeadersRequestClient:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpEmptyPrefixHeadersCommand({ + prefixHeaders: { + "x-foo": "Foo", + hello: "Hello", + } as any, + specificHeader: "There", + } 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("GET"); + expect(r.path).toBe("/HttpEmptyPrefixHeaders"); + + expect(r.headers["hello"]).toBe("There"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Deserializes all response headers with the same for prefix and specific + */ +it("HttpEmptyPrefixHeadersResponseClient:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, { + "x-foo": "Foo", + hello: "There", + }), + }); + + const params: any = {}; + const command = new HttpEmptyPrefixHeadersCommand(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 = [ + { + prefixHeaders: { + "x-foo": "Foo", + hello: "There", + }, + specificHeader: "There", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +it("RestXmlEnumPayloadRequest:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpEnumPayloadCommand({ + payload: "enumvalue", + } 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("/EnumPayload"); + + expect(r.headers["content-type"]).toBe("text/plain"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `enumvalue`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +it("RestXmlEnumPayloadResponse:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/plain", + }, + `enumvalue` + ), + }); + + const params: any = {}; + const command = new HttpEnumPayloadCommand(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 = [ + { + payload: "enumvalue", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a blob in the HTTP payload + */ +it("HttpPayloadTraitsWithBlob:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadTraitsCommand({ + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + } 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("/HttpPayloadTraits"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `blobby blob blob`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes an empty blob in the HTTP payload + */ +it("HttpPayloadTraitsWithNoBlobBody:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadTraitsCommand({ + foo: "Foo", + } 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("/HttpPayloadTraits"); + + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a blob in the HTTP payload + */ +it("HttpPayloadTraitsWithBlob:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + }, + `blobby blob blob` + ), + }); + + const params: any = {}; + const command = new HttpPayloadTraitsCommand(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 = [ + { + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes an empty blob in the HTTP payload + */ +it("HttpPayloadTraitsWithNoBlobBody:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + }, + `` + ), + }); + + const params: any = {}; + const command = new HttpPayloadTraitsCommand(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 = [ + { + foo: "Foo", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a blob in the HTTP payload with a content-type + */ +it("HttpPayloadTraitsWithMediaTypeWithBlob:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadTraitsWithMediaTypeCommand({ + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + } 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("/HttpPayloadTraitsWithMediaType"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("text/plain"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `blobby blob blob`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a blob in the HTTP payload with a content-type + */ +it("HttpPayloadTraitsWithMediaTypeWithBlob:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "text/plain", + }, + `blobby blob blob` + ), + }); + + const params: any = {}; + const command = new HttpPayloadTraitsWithMediaTypeCommand(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 = [ + { + foo: "Foo", + blob: Uint8Array.from("blobby blob blob", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a structure in the payload using a wrapper name based on member xmlName + */ +it("HttpPayloadWithMemberXmlName:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithMemberXmlNameCommand({ + nested: { + name: "Phreddy", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithMemberXmlName"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Phreddy`; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure in the payload using a wrapper name based on member xmlName + */ +it("HttpPayloadWithMemberXmlName:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + `Phreddy` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithMemberXmlNameCommand(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 = [ + { + nested: { + name: "Phreddy", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a structure in the payload + */ +it("HttpPayloadWithStructure:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithStructureCommand({ + nested: { + greeting: "hello", + name: "Phreddy", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithStructure"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + hello + Phreddy + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure in the payload + */ +it("HttpPayloadWithStructure:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + hello + Phreddy + + ` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithStructureCommand(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 = [ + { + nested: { + greeting: "hello", + name: "Phreddy", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a union in the payload. + */ +it("RestXmlHttpPayloadWithUnion:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithUnionCommand({ + nested: { + greeting: "hello", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithUnion"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + hello + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * No payload is sent if the union has no value. + */ +it("RestXmlHttpPayloadWithUnsetUnion:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithUnionCommand({} 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithUnion"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes a union in the payload. + */ +it("RestXmlHttpPayloadWithUnion:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + hello + ` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithUnionCommand(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 = [ + { + nested: { + greeting: "hello", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * No payload is sent if the union has no value. + */ +it("RestXmlHttpPayloadWithUnsetUnion:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-length": "0", + }, + `` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithUnionCommand(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); +}); + +/** + * Serializes a structure in the payload using a wrapper name based on xmlName + */ +it("HttpPayloadWithXmlName:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithXmlNameCommand({ + nested: { + name: "Phreddy", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithXmlName"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `Phreddy`; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure in the payload using a wrapper name based on xmlName + */ +it("HttpPayloadWithXmlName:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + `Phreddy` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithXmlNameCommand(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 = [ + { + nested: { + name: "Phreddy", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a structure in the payload using a wrapper with an XML namespace + */ +it("HttpPayloadWithXmlNamespace:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithXmlNamespaceCommand({ + nested: { + name: "Phreddy", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithXmlNamespace"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + Phreddy + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure in the payload using a wrapper with an XML namespace + */ +it("HttpPayloadWithXmlNamespace:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + Phreddy + ` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithXmlNamespaceCommand(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 = [ + { + nested: { + name: "Phreddy", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes a structure in the payload using a wrapper with an XML namespace + */ +it("HttpPayloadWithXmlNamespaceAndPrefix:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPayloadWithXmlNamespaceAndPrefixCommand({ + nested: { + name: "Phreddy", + } 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("PUT"); + expect(r.path).toBe("/HttpPayloadWithXmlNamespaceAndPrefix"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + Phreddy + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes a structure in the payload using a wrapper with an XML namespace + */ +it("HttpPayloadWithXmlNamespaceAndPrefix:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + Phreddy + ` + ), + }); + + const params: any = {}; + const command = new HttpPayloadWithXmlNamespaceAndPrefixCommand(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 = [ + { + nested: { + name: "Phreddy", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Adds headers by prefix + */ +it("HttpPrefixHeadersArePresent:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + foo: "Foo", + fooMap: { + abc: "Abc value", + def: "Def value", + } 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("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo"]).toBe("Foo"); + expect(r.headers["x-foo-abc"]).toBe("Abc value"); + expect(r.headers["x-foo-def"]).toBe("Def value"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * No prefix headers are serialized because the value is not present + */ +it("HttpPrefixHeadersAreNotPresent:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + foo: "Foo", + fooMap: {} 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("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serialize prefix headers were the value is present but empty + */ +it("HttpPrefixEmptyHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + fooMap: { + abc: "", + } 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("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo-abc"]).toBe(""); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Adds headers by prefix + */ +it("HttpPrefixHeadersArePresent:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "x-foo-abc": "Abc value", + "x-foo-def": "Def value", + }, + `` + ), + }); + + const params: any = {}; + const command = new HttpPrefixHeadersCommand(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 = [ + { + foo: "Foo", + fooMap: { + abc: "Abc value", + def: "Def value", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * No prefix headers are serialized because the value is empty + */ +it("HttpPrefixHeadersAreNotPresent:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + }, + `` + ), + }); + + const params: any = {}; + const command = new HttpPrefixHeadersCommand(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 = [ + { + foo: "Foo", + fooMap: {}, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling NaN float label values. + */ +it("RestXmlSupportsNaNFloatLabels:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithFloatLabelsCommand({ + float: NaN, + double: NaN, + } 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("GET"); + expect(r.path).toBe("/FloatHttpLabels/NaN/NaN"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling Infinity float label values. + */ +it("RestXmlSupportsInfinityFloatLabels:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithFloatLabelsCommand({ + float: Infinity, + double: Infinity, + } 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("GET"); + expect(r.path).toBe("/FloatHttpLabels/Infinity/Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling -Infinity float label values. + */ +it("RestXmlSupportsNegativeInfinityFloatLabels:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithFloatLabelsCommand({ + float: -Infinity, + double: -Infinity, + } 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("GET"); + expect(r.path).toBe("/FloatHttpLabels/-Infinity/-Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes greedy labels and normal labels + */ +it("HttpRequestWithGreedyLabelInPath:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithGreedyLabelInPathCommand({ + foo: "hello", + baz: "there/guy", + } 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("GET"); + expect(r.path).toBe("/HttpRequestWithGreedyLabelInPath/foo/hello/baz/there/guy"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Sends a GET request that uses URI label bindings + */ +it("InputWithHeadersAndAllParams:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithLabelsCommand({ + string: "string", + short: 1, + integer: 2, + long: 3, + float: 4.1, + double: 5.1, + boolean: true, + timestamp: new Date(1576540098000), + } 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("GET"); + expect(r.path).toBe("/HttpRequestWithLabels/string/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Sends a GET request that uses URI label bindings + */ +it("HttpRequestLabelEscaping:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithLabelsCommand({ + string: " %:/?#[]@!$&'()*+,;=😹", + short: 1, + integer: 2, + long: 3, + float: 4.1, + double: 5.1, + boolean: true, + timestamp: new Date(1576540098000), + } 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("GET"); + expect(r.path).toBe( + "/HttpRequestWithLabels/%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z" + ); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes different timestamp formats in URI labels + */ +it("HttpRequestWithLabelsAndTimestampFormat:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpRequestWithLabelsAndTimestampFormatCommand({ + memberEpochSeconds: new Date(1576540098000), + memberHttpDate: new Date(1576540098000), + memberDateTime: new Date(1576540098000), + defaultFormat: new Date(1576540098000), + targetEpochSeconds: new Date(1576540098000), + targetHttpDate: new Date(1576540098000), + targetDateTime: new Date(1576540098000), + } 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("GET"); + expect(r.path).toBe( + "/HttpRequestWithLabelsAndTimestampFormat/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z/2019-12-16T23%3A48%3A18Z/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z" + ); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Binds the http response code to an output structure. + */ +it("RestXmlHttpResponseCode:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 201, + { + "content-type": "application/xml", + }, + `` + ), + }); + + const params: any = {}; + const command = new HttpResponseCodeCommand(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(201); + const paramsToValidate: any = [ + { + Status: 201, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +it("RestXmlStringPayloadRequest:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpStringPayloadCommand({ + payload: "rawstring", + } 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("/StringPayload"); + + expect(r.headers["content-type"]).toBe("text/plain"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = `rawstring`; + const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +it("RestXmlStringPayloadResponse:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "text/plain", + }, + `rawstring` + ), + }); + + const params: any = {}; + const command = new HttpStringPayloadCommand(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 = [ + { + payload: "rawstring", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Query parameters must be ignored when serializing the output of an operation + */ +it("IgnoreQueryParamsInResponse:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + `bam` + ), + }); + + const params: any = {}; + const command = new IgnoreQueryParamsInResponseCommand(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 = [ + { + baz: "bam", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests requests with string header bindings + */ +it("InputAndOutputWithStringHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerString: "Hello", + headerStringList: ["a", "b", "c"], + headerStringSet: ["a", "b", "c"], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-string"]).toBe("Hello"); + expect(r.headers["x-stringlist"]).toBe("a, b, c"); + expect(r.headers["x-stringset"]).toBe("a, b, c"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with numeric header bindings + */ +it("InputAndOutputWithNumericHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerByte: 1, + headerShort: 123, + headerInteger: 123, + headerLong: 123, + headerFloat: 1.1, + headerDouble: 1.1, + headerIntegerList: [1, 2, 3], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-byte"]).toBe("1"); + expect(r.headers["x-double"]).toBe("1.1"); + expect(r.headers["x-float"]).toBe("1.1"); + expect(r.headers["x-integer"]).toBe("123"); + expect(r.headers["x-integerlist"]).toBe("1, 2, 3"); + expect(r.headers["x-long"]).toBe("123"); + expect(r.headers["x-short"]).toBe("123"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with boolean header bindings + */ +it("InputAndOutputWithBooleanHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerTrueBool: true, + headerFalseBool: false, + headerBooleanList: [true, false, true], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-boolean1"]).toBe("true"); + expect(r.headers["x-boolean2"]).toBe("false"); + expect(r.headers["x-booleanlist"]).toBe("true, false, true"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with timestamp header bindings + */ +it("InputAndOutputWithTimestampHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerTimestampList: [new Date(1576540098000), new Date(1576540098000)], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-timestamplist"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests requests with enum header bindings + */ +it("InputAndOutputWithEnumHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerEnum: "Foo", + headerEnumList: ["Foo", "Bar", "Baz"], + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-enum"]).toBe("Foo"); + expect(r.headers["x-enumlist"]).toBe("Foo, Bar, Baz"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling NaN float header values. + */ +it("RestXmlSupportsNaNFloatHeaderInputs:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerFloat: NaN, + headerDouble: NaN, + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-double"]).toBe("NaN"); + expect(r.headers["x-float"]).toBe("NaN"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling Infinity float header values. + */ +it("RestXmlSupportsInfinityFloatHeaderInputs:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerFloat: Infinity, + headerDouble: Infinity, + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-double"]).toBe("Infinity"); + expect(r.headers["x-float"]).toBe("Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Supports handling -Infinity float header values. + */ +it("RestXmlSupportsNegativeInfinityFloatHeaderInputs:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new InputAndOutputWithHeadersCommand({ + headerFloat: -Infinity, + headerDouble: -Infinity, + } 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("/InputAndOutputWithHeaders"); + + expect(r.headers["x-double"]).toBe("-Infinity"); + expect(r.headers["x-float"]).toBe("-Infinity"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests responses with string header bindings + */ +it("InputAndOutputWithStringHeaders:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-stringlist": "a, b, c", + "x-stringset": "a, b, c", + "x-string": "Hello", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerString: "Hello", + headerStringList: ["a", "b", "c"], + headerStringSet: ["a", "b", "c"], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with numeric header bindings + */ +it("InputAndOutputWithNumericHeaders:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-float": "1.1", + "x-byte": "1", + "x-long": "123", + "x-integer": "123", + "x-integerlist": "1, 2, 3", + "x-double": "1.1", + "x-short": "123", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerByte: 1, + headerShort: 123, + headerInteger: 123, + headerLong: 123, + headerFloat: 1.1, + headerDouble: 1.1, + headerIntegerList: [1, 2, 3], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with boolean header bindings + */ +it("InputAndOutputWithBooleanHeaders:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-booleanlist": "true, false, true", + "x-boolean1": "true", + "x-boolean2": "false", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerTrueBool: true, + headerFalseBool: false, + headerBooleanList: [true, false, true], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with timestamp header bindings + */ +it("InputAndOutputWithTimestampHeaders:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-timestamplist": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerTimestampList: [new Date(1576540098 * 1000), new Date(1576540098 * 1000)], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with enum header bindings + */ +it("InputAndOutputWithEnumHeaders:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-enumlist": "Foo, Bar, Baz", + "x-enum": "Foo", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerEnum: "Foo", + headerEnumList: ["Foo", "Bar", "Baz"], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling NaN float header values. + */ +it("RestXmlSupportsNaNFloatHeaderOutputs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-float": "NaN", + "x-double": "NaN", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerFloat: NaN, + headerDouble: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float header values. + */ +it("RestXmlSupportsInfinityFloatHeaderOutputs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-float": "Infinity", + "x-double": "Infinity", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerFloat: Infinity, + headerDouble: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float header values. + */ +it("RestXmlSupportsNegativeInfinityFloatHeaderOutputs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-float": "-Infinity", + "x-double": "-Infinity", + }, + `` + ), + }); + + const params: any = {}; + const command = new InputAndOutputWithHeadersCommand(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 = [ + { + headerFloat: -Infinity, + headerDouble: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests requests with nested maps. + */ +it("NestedXmlMapRequest:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NestedXmlMapsCommand({ + nestedMap: { + foo: { + bar: "Bar", + } 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("/NestedXmlMaps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + foo + + + bar + Bar + + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Tests requests with nested flat maps. Since maps can only be + * flattened when they're structure members, only the outer map is flat. + */ +it("FlatNestedXmlMapRequest:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NestedXmlMapsCommand({ + flatNestedMap: { + foo: { + bar: "Bar", + } 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("/NestedXmlMaps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + foo + + + bar + Bar + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Tests responses with nested maps. + */ +it("NestedXmlMapResponse:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + foo + + + bar + Bar + + + + + ` + ), + }); + + const params: any = {}; + const command = new NestedXmlMapsCommand(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 = [ + { + nestedMap: { + foo: { + bar: "Bar", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests responses with nested flat maps. Since maps can only be + * flattened when they're structure members, only the outer map is flat. + */ +it("FlatNestedXmlMapResponse:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + foo + + + bar + Bar + + + + ` + ), + }); + + const params: any = {}; + const command = new NestedXmlMapsCommand(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 = [ + { + flatNestedMap: { + foo: { + bar: "Bar", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes nested XML Maps in requests that have xmlName on members + */ +it.skip("NestedXmlMapWithXmlNameSerializes:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NestedXmlMapWithXmlNameCommand({ + nestedXmlMapWithXmlNameMap: { + foo: { + bar: "Baz", + fizz: "Buzz", + } as any, + qux: { + foobar: "Bar", + fizzbuzz: "Buzz", + } 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("/NestedXmlMapWithXmlName"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + foo + + + bar + Baz + + + fizz + Buzz + + + + + qux + + + foobar + Bar + + + fizzbuzz + Buzz + + + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes nested XML maps in responses that have xmlName on members + */ +it("NestedXmlMapWithXmlNameDeserializes:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + foo + + + bar + Baz + + + fizz + Buzz + + + + + qux + + + foobar + Bar + + + fizzbuzz + Buzz + + + + + + ` + ), + }); + + const params: any = {}; + const command = new NestedXmlMapWithXmlNameCommand(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 = [ + { + nestedXmlMapWithXmlNameMap: { + foo: { + bar: "Baz", + fizz: "Buzz", + }, + qux: { + foobar: "Bar", + fizzbuzz: "Buzz", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * No input serializes no payload + */ +it("NoInputAndNoOutput:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndNoOutputCommand({}); + 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("/NoInputAndNoOutput"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * No output serializes no payload + */ +it("NoInputAndNoOutput:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new NoInputAndNoOutputCommand(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); +}); + +/** + * No input serializes no payload + */ +it("NoInputAndOutput:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputAndOutputCommand({}); + 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("/NoInputAndOutputOutput"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Empty output serializes no payload + */ +it("NoInputAndOutput:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler(true, 200, undefined, ``), + }); + + const params: any = {}; + const command = new NoInputAndOutputCommand(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); +}); + +/** + * Do not send null values, but do send empty strings and empty lists over the wire in headers + */ +it.skip("NullAndEmptyHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NullAndEmptyHeadersClientCommand({ + a: null, + b: "", + c: [], + } 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("GET"); + expect(r.path).toBe("/NullAndEmptyHeadersClient"); + + expect( + r.headers["x-a"], + `Header key "x-a" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(r.headers["x-b"]).toBe(""); + expect(r.headers["x-c"]).toBe(""); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Omits null query values + */ +it("RestXmlOmitsNullQuery:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OmitsNullSerializesEmptyStringCommand({ + nullValue: null, + } 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("GET"); + expect(r.path).toBe("/OmitsNullSerializesEmptyString"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes empty query strings + */ +it("RestXmlSerializesEmptyString:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OmitsNullSerializesEmptyStringCommand({ + emptyString: "", + } 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("GET"); + expect(r.path).toBe("/OmitsNullSerializesEmptyString"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("Empty="); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header. + */ +it("SDKAppliedContentEncoding_restXml:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/requestcompression/putcontentwithencoding"); + + expect(r.headers["content-encoding"]).toBe("gzip"); + } +}); + +/** + * Compression algorithm encoding is appended to the Content-Encoding header, and the + * user-provided content-encoding is in the Content-Encoding header before the + * request compression encoding from the HTTP binding. + * + */ +it("SDKAppendedGzipAfterProvidedEncoding_restXml:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new PutWithContentEncodingCommand({ + encoding: "custom", + data: "RjCEL3kBwqPivZUXGiyA5JCujtWgJAkKRlnTEsNYfBRGOS0f7LT6R3bCSOXeJ4auSHzQ4BEZZTklUyj5\n1HEojihShQC2jkQJrNdGOZNSW49yRO0XbnGmeczUHbZqZRelLFKW4xjru9uTuB8lFCtwoGgciFsgqTF8\n5HYcoqINTRxuAwGuRUMoNO473QT0BtCQoKUkAyVaypG0hBZdGNoJhunBfW0d3HWTYlzz9pXElyZhq3C1\n2PDB17GEoOYXmTxDecysmPOdo5z6T0HFhujfeJFIQQ8dirmXcG4F3v0bZdf6AZ3jsiVh6RnEXIPxPbOi\ngIXDWTMUr4Pg3f2LdYCM01eAb2qTdgsEN0MUDhEIfn68I2tnWvcozyUFpg1ez6pyWP8ssWVfFrckREIM\nMb0cTUVqSVSM8bnFiF9SoXM6ZoGMKfX1mT708OYk7SqZ1JlCTkecDJDoR5ED2q2MWKUGR6jjnEV0GtD8\nWJO6AcF0DptY9Hk16Bav3z6c5FeBvrGDrxTFVgRUk8SychzjrcqJ4qskwN8rL3zslC0oqobQRnLFOvwJ\nprSzBIwdH2yAuxokXAdVRa1u9NGNRvfWJfKkwbbVz8yV76RUF9KNhAUmwyYDrLnxNj8ROl8B7dv8Gans\n7Bit52wcdiJyjBW1pAodB7zqqVwtBx5RaSpF7kEMXexYXp9N0J1jlXzdeg5Wgg4pO7TJNr2joiPVAiFf\nefwMMCNBkYx2z7cRxVxCJZMXXzxSKMGgdTN24bJ5UgE0TxyV52RC0wGWG49S1x5jGrvmxKCIgYPs0w3Z\n0I3XcdB0WEj4x4xRztB9Cx2Mc4qFYQdzS9kOioAgNBti1rBySZ8lFZM2zqxvBsJTTJsmcKPr1crqiXjM\noVWdM4ObOO6QA7Pu4c1hT68CrTmbcecjFcxHkgsqdixnFtN6keMGL9Z2YMjZOjYYzbUEwLJqUVWalkIB\nBkgBRqZpzxx5nB5t0qDH35KjsfKM5cinQaFoRq9y9Z82xdCoKZOsUbxZkk1kVmy1jPDCBhkhixkc5PKS\nFoSKTbeK7kuCEZCtR9OfF2k2MqbygGFsFu2sgb1Zn2YdDbaRwRGeaLhswta09UNSMUo8aTixgoYVHxwy\nvraLB6olPSPegeLOnmBeWyKmEfPdbpdGm4ev4vA2AUFuLIeFz0LkCSN0NgQMrr8ALEm1UNpJLReg1ZAX\nzZh7gtQTZUaBVdMJokaJpLk6FPxSA6zkwB5TegSqhrFIsmvpY3VNWmTUq7H0iADdh3dRQ8Is97bTsbwu\nvAEOjh4FQ9wPSFzEtcSJeYQft5GfWYPisDImjjvHVFshFFkNy2nN18pJmhVPoJc456tgbdfEIdGhIADC\n6UPcSSzE1FxlPpILqZrp3i4NvvKoiOa4a8tnALd2XRHHmsvALn2Wmfu07b86gZlu4yOyuUFNoWI6tFvd\nbHnqSJYNQlFESv13gJw609DBzNnrIgBGYBAcDRrIGAnflRKwVDUnDFrUQmE8xNG6jRlyb1p2Y2RrfBtG\ncKqhuGNiT2DfxpY89ektZ98waPhJrFEPJToNH8EADzBorh3T0h4YP1IeLmaI7SOxeuVrk1kjRqMK0rUB\nlUJgJNtCE35jCyoHMwPQlyi78ZaVv8COVQ24zcGpw0MTy6JUsDzAC3jLNY6xCb40SZV9XzG7nWvXA5Ej\nYC1gTXxF4AtFexIdDZ4RJbtYMyXt8LsEJerwwpkfqvDwsiFuqYC6vIn9RoZO5kI0F35XtUITDQYKZ4eq\nWBV0itxTyyR5Rp6g30pZEmEqOusDaIh96CEmHpOBYAQZ7u1QTfzRdysIGMpzbx5gj9Dxm2PO1glWzY7P\nlVqQiBlXSGDOkBkrB6SkiAxknt9zsPdTTsf3r3nid4hdiPrZmGWNgjOO1khSxZSzBdltrCESNnQmlnP5\nZOHA0eSYXwy8j4od5ZmjA3IpFOEPW2MutMbxIbJpg5dIx2x7WxespftenRLgl3CxcpPDcnb9w8LCHBg7\nSEjrEer6Y8wVLFWsQiv6nTdCPZz9cGqwgtCaiHRy8lTWFgdfWd397vw9rduGld3uUFeFRGjYrphqEmHi\nhiG0GhE6wRFVUsGJtvOCYkVREvbEdxPFeJvlAvOcs9HKbtptlTusvYB86vR2bNcIY4f5JZu2X6sGa354\n7LRk0ps2zqYjat3hMR7XDC8KiKceBteFsXoDjfVxTYKelpedTxqWAafrKhaoAVuNM98PSnkuIWGzjSUC\nNsDJTt6vt1D1afBVPWVmnQ7ZQdtEtLIEwAWYjemAztreELIr1E9fPEILm1Ke4KctP9I0I72Dh4eylNZD\n0DEr2Hg7cWFckuZ0Av5d0IPRARXikEGDHl8uh12TXL9v2Uh0ZVSJMEYvxGSbZvkWz8TjWSk3hKA2a7GL\nJm3Ho7e1C34gE1XRGcEthxvURxt4OKBqN3ZNaMIuDTWinoQAutMcUqtm4MoL7RGPiCHUrvTwQPSirsmA\nQmOEu8nOpnP77Fivh9jLGx5ta7nL6jrsWUsBqiN1lzpdPYLRR4mUIAj6sNWiDEk4pkbHSMEcqbWw6Zl7\npsEyPDHalCNhWMA3RSK3skURzQDZ0oBV5W7vjVIZ4d3uCKsk6zrzEI9u5mx7p9RdNKodXfzqYt0ULdtc\n3RW0hIfw2KvrO3BD2QrtgAkfrFBGVvlJSUoh0MvLz8DeXxfuiuq9Ttu7wvsqVI4Piah6WNEXtHHGPJO3\nGhc75Bnv2To4VS2v8rmyKAPIIVTuYBHZN6sZ4FhFzbrslCIdk0eadaU60naqiNWU3CsxplIYGyeThmJ7\n9u4h6Y2OmiPZjFPS2bAzwgAozYTVefII9aEaWZ0hxHZeu1FW7r79dkdO73ZqRfas9u8Z7LLBPCw5pV0F\n5I0pHDgNb6MogoxF4NZJfVtIX1vCHhhVLrXjrYNJU2fD9Fw8kT8Ie2HDBJnqAvYKmryQ1r9ulo3Me3rH\nq9s2Y5uCDxu9iQNhnpwIm57WYGFeqd2fnQeY2IziD3Jgx0KSrmOH0jgi0RwJyfGXaORPq3bQQqljuACo\nkO6io9t5VI8PbNxSHTRbtYiPciUslbT0g7SpCLrRPOBRJ4DDk56pjghpeoUagJ5xJ4wjBzBuXnAGkNnP\nTfpiuz2r3oSBAi8sB9wiYK2z9sp4gZyQsqdVNzAEgKatOxBRBmJCBYpjO98ZQrF83XApPpfFg0ujB2PW\n1iYF9NkgwIKB5oB6KVTOmSKJk11mVermPgeugHbzdd2zUP6fP8fWbhseqk2t8ahGvqjs2CDHFIWXl5jc\nfCknbykE3ANt7lnAfJQ2ddduLGiqrX4HWx6jcWw08Es6BkleO0IDbaWrb95d5isvFlzJsf0TyDIXF4uq\nbBDCi0XPWqtRJ2iqmnJa2GbBe9GmAOWMkBFSilMyC4sR395WSDpD56fx0NGoU6cHrRu9xF2Bgh7RGSfl\nch2GXEeE02fDpSHFNvJBlOEqqfkIX6oCa6KY9NThqeIjYsT184XR2ZI7akXRaw1gMOGpk4FmUxk6WIuX\n4ei1SLQgSdl7OEdRtJklZ76eFrMbkJQ2TDhu8f7mVuiy53GUMIvCrP9xYGZGmCIDm2e4U2BDi3F7C5xK\n3bDZXwlQp6z4BSqTy2OVEWxXUJfjPMOL5Mc7AvDeKtxAS73pVIv0HgHIa4NBAdC7uLG0zXuu1FF6z2XY\nyUhk03fMZhYe7vVxsul3WE7U01fuN8z2y0eKwBW1RFBE1eKIaR9Y01sIWQWbSrfHfDrdZiElhmhHehfs\n0EfrR4sLYdQshJuvhTeKGJDaEhtPQwwJ9mUYGtuCL9RozWx1XI4bHNlzBTW0BVokYiJGlPe7wdxNzJD7\nJgS7Lwv6jGKngVf86imGZyzqwiteWFPdNUoWdTvUPSMO5xIUK9mo5QpwbBOAmyYzVq42o3Qs90N9khEV\nU36LB99fw8PtGHH5wsCHshfauwnNPj0blGXzke0kQ4JNCVH7Jtn0Y0aeejkSxFtwtxoYs6zHl1Lxxpsd\nsw5vBy49CEtoltDW367lVAwDjWdx20msGB7qJCkEDrzu7EXSO22782QX9NBRcN9ppX0C25I0FMA4Wnhz\n9zIpiXRrsTH35jzM8Cjt4EVLGNU3O0HuEvAer3cENnMJtngdrT86ox3fihMQbiuy4Bh4DEcP5in2VjbT\n3qbnoCNvOi8Fmmf7KlGlWAOceL5OHVE5lljjQEMzEQOCEgrk5mDKgwSBJQBNauIDSC1a5iEQjB8Xxp4C\nqeKyyWY9IOntNrtU5ny4lNprHJd36dKFeBLKcGCOvgHBXdOZloMF0YTRExw7hreEO9IoTGVHJ4teWsNr\nHdtagUHjkeZkdMMfnUGNv5aBNtFMqhcZH6EitEa9lGPkKBbJpoom3u8D8EHSIF1H5EZqqx9TLY5hWAIG\nPwJ4qwkpCGw5rCLVrjw7ARKukIFzNULANqjHUMcJ002TlUosJM4xJ4aAgckpLVGOGuPDhGAAexEcQmbg\nUsZdmqQrtuVUyyLteLbLbqtR6CTlcAIwY3xyMCmPgyefE0FEUODBoxQtRUuYTL9RC5o1sYb2PvcxUQfb\niJFi2CAl99pAzcckU2qVCxniARslIxM5pmMRGsQX9ZzYAfZrbg6ce6S74I8UMlgRQ2QVyvUjKKOE6IrJ\nLng370emHfe5m6LZULD5YiZutkD5ipjL2Bz77DvTE5kNPUhuoKBcTJcUgytfXAKUTWOcRKNlq0GImrxM\nJfr7AWbLFFNKGLeTrVDBwpcokJCv0zcOKWe8fd2xkeXkZTdmM66IgM27cyYmtQ6YF26Kd0qrWJeVZJV9\n3fyLYYvKN5csbRY2BHoYE5ERARRW65IrpkXMf48OrCXMtDIP0Z7wxI9DiTeKKeH4uuguhCJnwzR3WxLA\nVU6eBJEd7ZjS6JA83w7decq8uDI7LGKjcz1FySp3B7fE9DkHRGXxbsL7Fjar6vW2mAv8CuvI20B6jctp\n2yLDs24sPfB3sSxrrlhbuT1m6DZqiN0dl6umKx7NGZhmOTVGr20jfcxhqPQwTJfd7kel4rvxip4BqkvT\n7STy8knJ2BXGyJeNgwo1PXUZRDVy0LCTsSF1RFuRZe8cktHl9lgw8ntdPn1pVFL0MwJkJfdXBNUp5gNv\n50FTkrpo1t6wq4CVbcfj2XOrOzvBUzNH26sXGABI1gGxCdp2jEZrHgqQaWIaTJVTuguZhxqDvdYsrwFW\nYN58uuNcKHIrGdRSigyZInwQDYk0pjcqdSeU0WVU3Y9htzZBR7XRaCJr5YTZvq7fwermb5tuwb37lPLq\nB2IGg0iftkVbXaSyfCwVaRbfLBb88so0QqpmJGirFu8FcDiXOV1zTr8yW9XLdYQuUjh43xrXLdgsuYff\nCagInUk1eU1aLjVZoJRsNmStmOEpAqlYMwTvx7w6j2f421Cxr5cNZBIVlAxlXN2QiDqJ9v3sHhHkTanc\nlQuH8ptUyX8qncpBuXXBn7cSez9N0EoxCBl1GHUagbjstgJo4gzLvTmVIY6MiWYOBitzNUHfyqKwtKUr\nVoSCdZcGeA9lHUPA7PUprRRaT3m1hGKPyshtVS2ikG48w3oVerln1N1qGdtz46gZCrndw3LZ1B362RfW\nzDPuXbpsyLsRMTt1Rz1oKHRXp3iE41hkhQH6pxlvyCW2INnHt5XU8zRamOB3oW0udOhMpQFDjRkOcy06\nb4t0QTHvoRqmBna3WXzIMZyeK3GChF5eF8oDXRbjhk7BB6YKCgqwWUzEJ5K47HMSlhFkBUjaPRjdGM0z\nzOMwhW6b1NvSwP7XM1P5yi1oPvOspts1vr29SXqrMMrBhVogeodWyd69NqrO4jkyBxKmlXifoTowpfiY\n2cUCE0XMZqxUN39LCP09JqZifaEcBEo3mgtm1tWu5QR2GNq7UyQf4RIPSDOpDCAtwoPhRgdT1lJdcj4U\nlnH0wrJ8Uwu7c08L7ErnIrDATqCrOjpSbzGP1xHENABYONC4TknFPrJ8pe40A8fzGT0qBw9mAM1SKcHO\nfoiLcMC9AjHTqJzDG3xplSLPG9or2rMeq7Fzp9r0y7uJRMxgg51EbjfvYlH466A3ggvL2WQlDXjJqPW3\nBJGWAWDNN9LK8f46bADKPxakpkx23S9O47rGSXfDhVSIZsDympxWX1UOzWwMZRHkofVeKqizgbKkGgUT\nWykE9gRoRAOd9wfHZDYKa9i0LaPDiaUMvnU1gdBIqIoiVsdJ9swX47oxvMtOxtcS0zlD6llDkBuIiU5g\nPwRCYmtkkb25c8iRJXwGFPjI1wJ34I1z1ENicPdosPiUe9ZC2jnXIKzEdv01x2ER7DNDF3yxOwOhxNxI\nGqsmC92j25UQQFu9ZstOZ28AoCkuOYs0Uycm5u8jR1T39dMBwrko09rC65ENLnsxM8oebmyFCPiGJ1ED\n5Xqc9qZ237f1OnETAoEOwqUSvrdPTv56U7hV91EMTyC812MLQpr2710E3VVpsUCUMNhIxdt7UXZ1UNFb\njgzpZLXnf4DHrv6B7kq6UI50KMxcw1HZE2GpODfUTzNFLaqdrvzxKe5eUWdcojBaRbD4fFdVYJTElYDH\nNNVh6ofkoeWcs9CWGFmSBe0T4K8phFeygQg0prKMELNEy6qENzVtG9ZDcqj3a7L6ZLtvq50anWp7fAVu\nfwz55g4iM2Z2fA0pnwHDL7tt67zTxGITvsnJsZSpeq1EQsZcwtkBV9liu7Rl7jiVT1IIRtchB8TsTiaA\nwVHIQQ9RIOTiPQdKNqi1kC9iGlUqWK93gblNWlBw1eYB9Wk8FQogutwTf0caNMx8D4nPbANcmOOlskIy\nzALh15OlTrWnhP95rf08AN2J026zDE2DUF9k0eCevYBQIDjqKNW4XCZnjbHoIcKzbY5VzPbMs3ZyMz8K\nSucBmgPg6wrSK5ykbkapS5vuqvXc9GbjQJ8bPNzoxoWGyjbZvDs2OBrIqBmcQb2DLJ8v38McQ4mC4UsS\njf4PyfSCtpk274QZjvLCZbLiCBxQegk7jUU0NmTFJAcYCxd9xMWdlFkiszcltT2YzwuFFz7iA6aa4n5L\nHpBNfUA01GcAi1aCMYhmooS4zSlYcSOZkovMz36U3Fd9WtqIEOJLi7HMgHQDgNMdK6DTzAdHQtxerxVF\nHJnPrfNVG7270r3bp0bPnLNYLhObbAn6zqSAUeLtI2Y4KJDjBKCAh2vvYGbu0e2REYJWRj7MkGevsSSy\nb1kCXLt6tKGWAb7lt5c0xyJgUIJW7pdtnwgT0ZCa24BecCAwNnG5U2EwQbcjZGsFxqNGfaemd3oFEhES\nBaE0Fxms9UKTnMafu8wvZ2xymMrUduuRzOjDeX7oD5YsLC88V8CGMLxbbxIpt94KGykbr6e7L0R4oZl1\ntKMgFwQ2p9Txdbp0Y293LcsJymKizqI0F2xEp7y4SmWOJqHZtsbz80wVV9nv41CvtfxuSoGZJ5cNB7pI\nBgzNcQCeH3Jt0RaGGwboxxpuFbzilmkMFXxJm87tD4WNgu01nHfGCKeQcySEBZpVfJgi6sDFJ8uWnvKm\n9mPLHurtWzEfKqUEa1iC71bXjw5wrvhv9BYW8JSUELHmDquftQyKdq0DZXhULMHGQLf4e95WIaoA14LL\nbThz77kuhKULPTu2MNrBUKGorurhGugo5gs4ZUezSsUOe3KxYdrFMdGgny1GgTxMSMTp2RAZytKjv4kQ\nVx7XgzvpQLIbDjUPAkJv6lScwIRq1W3Ne0Rh0V6Bmn6U5uIuWnJjULmbaQiSODj3z0mAZvak0mSWIGwT\nTX83HztcC4W7e1f6a1thmcc5K61Icehla2hBELWPpixTkyC4eEVmk9Rq0m0ZXtx0JX2ZQXqXDEyePyMe\nJ70sdSzXk72zusqhY4yuOMGgbYNHqxOToK6NxujR7e4dV3Wk5JnSUthym8scjcPeCiKDNY4cHfTMnDXJ\n9zLVy01LtNKYpJ1s8FxVxigmxQNKEbIamxhx6yqwGC4aiISVOOUEjvNOdaUfXfUsE6jEwtwxyGxjlRK1\ncLyxXttq4QWN6PehgHv7jXykzPjInbEysebFvvPOOMdunmJvcCNMSvjUda8fL6xfGo0FDrLg8XZipd6S\noPVdYtyIM1Dg40KbBA3JuumPYtXuJaHrZnjZmdnM5OVo4ZNxktfCVT0c6bnD4bAeyn4bYt1ZPaX6hQHh\nJtvNYfpD0ONYlmqKuToQAMlz52Fh6bj45EbX89L5eLlSpWeyBlGotzriB0EPlclrGi5l2B5oPb1aB1ag\nyyYuu44l0F1oOVYnBIZsxIsHVITxi9lEuVPFkWASOUNuVQXfM4n5hxWR9qtuKnIcPsvbJsv1U10XlKh3\nKisqPhHU15xrCLr5gwFxPUKiNTLUBrkzgBOHXPVsHcLCiSD0YU56TRGfvEom43TWUKPPfl9Z54tgVQuT\njCRlaljAzeniQIcbbHZnn3f0HxbDG3DFYqWSxNrXabHhRsIOhhUHSPENyhGSTVO5t0XX5CdMspJPCd02\n3Oqv32ccbUK4O3YH6LEvp0WO3kSl5n50odVkI9B0i0iq4UPFGMkM8bEQJbgJoOH71P10vtdevJFQE4g2\nyhimiM53ZJRWgSZveHtENZc0Gjo0F9eioak9BnPpY1QxAFPC817svuhEstcU69bLCA4D1rO5R8AuIIBq\nyQJcifFLvbpAEYTLKJqysZrU8EEl3TSdC13A9hZvk4NC8VGEDAxcNrKw313dZp17kZPO5HSd1y6sljAW\nA9M1d6FMYV5SlBWf3WZNCUPS7qKNlda2YBsC6IUVB363f5RLGQOQHwbaijBSRCkrVoRxBHtc0Bd5J9V9\nP5uMTXkpZOxRcCQvImGgcmGuxxLb5zTqfS2xu7v3Sf3IIesSt9tVzcEcdbEvLGVJkLk4mb3G30DbIbri\nPZ09JkweDvMaQ3bxT2nfkz3Ilihkw9jqikkCCCz7E8h6z6KbhQErEW9VzJZzMCgJsyPjFam6iNwpe07S\nhyOvNVw2t9wpzL5xM11DvVzQwDaWEytNRHzDBs4KwEtpI2IpjUyVZHSwA0UGqqkzoCgrJFlNOvPlXqcS\nIcREouUIBmuttkrhPWJtSxOOgpsdvBR3kTOzAXNzSKxoaBAb0c5SDMUc6FIyGA8x5wg5DkUgjFUUodEt\nOYaB2VHVePW9mxHeBTdKWLzJow4ZZvjnoBuVigXljKCNh137ckV2y3Yg3Xi4UzJEI2V5Rw9AfnMs7xUw\nVHOFCg189maD3bmZAe7b4eaGZhyy4HVKjqCXmIH7vsEjRvbnfB0SQxxpuqBDJbHNCtW4vM643ZQQBVPP\na7oXSQIq9w2dHp0A7dtkocCZdQp9FKR9XdJAFIbVSHzIF1ZogeZlc0pXuNE0tagvD57xwDRFkAuoQyMu\nYDdZasXrpSmEE5UjHVkyYsISn8QsfXurzDybX468aoRoks654jjmRY5zi1oB8TcMdC2c3sicNaqfeuhd\nH1nPX7l4RpdqWMR7gGx9slXtG8S3KxpOi4qCD7yg3saD66nun4dzksQURoTUdXyrJR5UpHsfIlTF1aJa\nMdXyQtQnrkl00TeghQd00rRFZsCnhi0qrCSKiBfB2EVrd9RPpbgwJGZHuIQecdBmNetc2ylSEClqVBPR\nGOPPIxrnswEZjmnS0jxKW9VSM1QVxSPJnPFswCqT95SoKD6CP4xdX28WIUGiNaIKodXXJHEIsXBCxLsr\nPwWPCtoplC6hhpKmW5dQo92iCTyY2KioKzO8XR6FKm6qonMKVEwQNtlYE9c97KMtEnp25VOdMP46SQXS\nYsSVp7vm8LP87VYI8SOKcW3s2oedYFtt45rvDzoTF0GmS6wELQ9uo98HhjQAI1Dt91cgjJOwygNmLoZE\nX5K2zQiNA163uMCl5xzaBqY4YTL0wgALg3IFdYSp0RFYLWdt6IxoGI1tnoxcjlUEPo5eGIc3mS3SmaLn\nOdumfUQQ4Jgmgaa5anUVQsfBDrlAN5oaX7O0JO71SSPSWiHBsT9WIPy2J1Cace9ZZLRxblFPSXcvsuHh\nhvnhWQltEDAe7MgvkFQ8lGVFa8jhzijoF9kLmMhMILSzYnfXnZPNP7TlAAwlLHK1RqlpHskJqb6CPpGP\nQvOAhEMsM3zJ2KejZx0esxkjxA0ZufVvGAMN3vTUMplQaF4RiQkp9fzBXf3CMk01dWjOMMIEXTeKzIQe\nEcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr\n", + } 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("/requestcompression/putcontentwithencoding"); + + expect(r.headers["content-encoding"]).toBe("custom, gzip"); + } +}); + +/** + * Automatically adds idempotency token when not set + */ +it("QueryIdempotencyTokenAutoFill:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000000", + } 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("/QueryIdempotencyTokenAutoFill"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("token=00000000-0000-4000-8000-000000000000"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Uses the given idempotency token as-is + */ +it("QueryIdempotencyTokenAutoFillIsSet:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryIdempotencyTokenAutoFillCommand({ + token: "00000000-0000-4000-8000-000000000000", + } 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("/QueryIdempotencyTokenAutoFill"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("token=00000000-0000-4000-8000-000000000000"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serialize query params from map of list strings + */ +it("RestXmlQueryParamsStringListMap:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryParamsAsStringListMapCommand({ + qux: "named", + foo: { + baz: ["bar", "qux"], + } 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("/StringListMap"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("corge=named"); + expect(queryString).toContain("baz=bar"); + expect(queryString).toContain("baz=qux"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Prefer named query parameters when serializing + */ +it("RestXmlQueryPrecedence:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new QueryPrecedenceCommand({ + foo: "named", + baz: { + bar: "fromMap", + qux: "alsoFromMap", + } 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("/Precedence"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("bar=named"); + expect(queryString).toContain("qux=alsoFromMap"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Serializes recursive structures + */ +it("RecursiveShapes:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RecursiveShapesCommand({ + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + } 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("PUT"); + expect(r.path).toBe("/RecursiveShapes"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + Foo1 + + Bar1 + + Foo2 + + Bar2 + + + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes recursive structures + */ +it("RecursiveShapes:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + Foo1 + + Bar1 + + Foo2 + + Bar2 + + + + + + ` + ), + }); + + const params: any = {}; + const command = new RecursiveShapesCommand(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 = [ + { + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + }, + }, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("SimpleScalarProperties:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + foo: "Foo", + stringValue: "string", + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/xml"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + string + true + false + 1 + 2 + 3 + 4 + 5.5 + 6.5 + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes string with escaping + */ +it("SimpleScalarPropertiesWithEscapedCharacter:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + foo: "Foo", + stringValue: "", + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/xml"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + <string> + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes string containing white space + */ +it("SimpleScalarPropertiesWithWhiteSpace:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + foo: "Foo", + stringValue: " string with white space ", + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/xml"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + string with white space + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes string containing exclusively whitespace + */ +it("SimpleScalarPropertiesPureWhiteSpace:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + foo: "Foo", + stringValue: " ", + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/xml"); + expect(r.headers["x-foo"]).toBe("Foo"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling NaN float values. + */ +it("RestXmlSupportsNaNFloatInputs:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: NaN, + doubleValue: NaN, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + NaN + NaN + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("RestXmlSupportsInfinityFloatInputs:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: Infinity, + doubleValue: Infinity, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + Infinity + Infinity + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling -Infinity float values. + */ +it("RestXmlSupportsNegativeInfinityFloatInputs:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + floatValue: -Infinity, + doubleValue: -Infinity, + } 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("PUT"); + expect(r.path).toBe("/SimpleScalarProperties"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + -Infinity + -Infinity + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("SimpleScalarProperties:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/xml", + }, + ` + string + true + false + 1 + 2 + 3 + 4 + 5.5 + 6.5 + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + foo: "Foo", + stringValue: "string", + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes string with escaping. + * + * This validates the three escape types: literal, decimal and hexadecimal. It also validates that unescaping properly + * handles the case where unescaping an & produces a newly formed escape sequence (this should not be re-unescaped). + * + * Servers may produce different output, this test is designed different unescapes clients must handle + * + */ +it("SimpleScalarPropertiesComplexEscapes:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/xml", + }, + ` + escaped data: &lt; + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + foo: "Foo", + stringValue: "escaped data: <\r\n", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes string with escaping + */ +it("SimpleScalarPropertiesWithEscapedCharacter:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/xml", + }, + ` + <string> + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + foo: "Foo", + stringValue: "", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties with xml preamble, comments and CDATA + */ +it("SimpleScalarPropertiesWithXMLPreamble:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/xml", + }, + ` + + + string + + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + foo: "Foo", + stringValue: "string", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes string containing white space + */ +it("SimpleScalarPropertiesWithWhiteSpace:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/xml", + }, + ` + + string with white space + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + foo: "Foo", + stringValue: " string with white space ", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes string containing white space + */ +it("SimpleScalarPropertiesPureWhiteSpace:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-foo": "Foo", + "content-type": "application/xml", + }, + ` + + + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + foo: "Foo", + stringValue: " ", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling NaN float values. + */ +it("RestXmlSupportsNaNFloatOutputs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + NaN + NaN + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: NaN, + doubleValue: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float values. + */ +it("RestXmlSupportsInfinityFloatOutputs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + Infinity + Infinity + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: Infinity, + doubleValue: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling -Infinity float values. + */ +it("RestXmlSupportsNegativeInfinityFloatOutputs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + -Infinity + -Infinity + + ` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + floatValue: -Infinity, + doubleValue: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests how timestamp request headers are serialized + */ +it("TimestampFormatHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new TimestampFormatHeadersCommand({ + memberEpochSeconds: new Date(1576540098000), + memberHttpDate: new Date(1576540098000), + memberDateTime: new Date(1576540098000), + defaultFormat: new Date(1576540098000), + targetEpochSeconds: new Date(1576540098000), + targetHttpDate: new Date(1576540098000), + targetDateTime: new Date(1576540098000), + } 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("/TimestampFormatHeaders"); + + expect(r.headers["x-defaultformat"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); + expect(r.headers["x-memberdatetime"]).toBe("2019-12-16T23:48:18Z"); + expect(r.headers["x-memberepochseconds"]).toBe("1576540098"); + expect(r.headers["x-memberhttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); + expect(r.headers["x-targetdatetime"]).toBe("2019-12-16T23:48:18Z"); + expect(r.headers["x-targetepochseconds"]).toBe("1576540098"); + expect(r.headers["x-targethttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * Tests how timestamp response headers are serialized + */ +it("TimestampFormatHeaders:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "x-targetepochseconds": "1576540098", + "x-memberdatetime": "2019-12-16T23:48:18Z", + "x-defaultformat": "Mon, 16 Dec 2019 23:48:18 GMT", + "x-memberepochseconds": "1576540098", + "x-targethttpdate": "Mon, 16 Dec 2019 23:48:18 GMT", + "x-memberhttpdate": "Mon, 16 Dec 2019 23:48:18 GMT", + "x-targetdatetime": "2019-12-16T23:48:18Z", + }, + `` + ), + }); + + const params: any = {}; + const command = new TimestampFormatHeadersCommand(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 = [ + { + memberEpochSeconds: new Date(1576540098 * 1000), + memberHttpDate: new Date(1576540098 * 1000), + memberDateTime: new Date(1576540098 * 1000), + defaultFormat: new Date(1576540098 * 1000), + targetEpochSeconds: new Date(1576540098 * 1000), + targetHttpDate: new Date(1576540098 * 1000), + targetDateTime: new Date(1576540098 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML attributes on the synthesized document + */ +it("XmlAttributes:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlAttributesCommand({ + foo: "hi", + attr: "test", + } 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("PUT"); + expect(r.path).toBe("/XmlAttributes"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + hi + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes XML attributes with escaped characters on the synthesized document + */ +it("XmlAttributesWithEscaping:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlAttributesCommand({ + foo: "hi", + attr: "", + } 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("PUT"); + expect(r.path).toBe("/XmlAttributes"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + hi + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("XmlAttributes:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + hi + + ` + ), + }); + + const params: any = {}; + const command = new XmlAttributesCommand(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 = [ + { + foo: "hi", + attr: "test", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML attributes on the synthesized document + */ +it("XmlAttributesOnPayload:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlAttributesOnPayloadCommand({ + payload: { + foo: "hi", + attr: "test", + } 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("PUT"); + expect(r.path).toBe("/XmlAttributesOnPayload"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + hi + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("XmlAttributesOnPayload:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + hi + + ` + ), + }); + + const params: any = {}; + const command = new XmlAttributesOnPayloadCommand(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 = [ + { + payload: { + foo: "hi", + attr: "test", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Blobs are base64 encoded + */ +it("XmlBlobs:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlBlobsCommand({ + data: Uint8Array.from("value", (c) => c.charCodeAt(0)), + } 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("/XmlBlobs"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + dmFsdWU= + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Blobs are base64 encoded + */ +it("XmlBlobs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + dmFsdWU= + + ` + ), + }); + + const params: any = {}; + const command = new XmlBlobsCommand(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 = [ + { + data: Uint8Array.from("value", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty blobs are deserialized as empty string + */ +it("XmlEmptyBlobs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyBlobsCommand(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 = [ + { + data: Uint8Array.from("", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty self closed blobs are deserialized as empty string + */ +it("XmlEmptySelfClosedBlobs:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyBlobsCommand(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 = [ + { + data: Uint8Array.from("", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes Empty XML lists + */ +it("XmlEmptyLists:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlEmptyListsCommand({ + stringList: [], + stringSet: [], + } 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("PUT"); + expect(r.path).toBe("/XmlEmptyLists"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes Empty XML lists + */ +it("XmlEmptyLists:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyListsCommand(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 = [ + { + stringList: [], + stringSet: [], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes Empty XML maps + */ +it("XmlEmptyMaps:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlEmptyMapsCommand({ + myMap: {} 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("/XmlEmptyMaps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes Empty XML maps + */ +it("XmlEmptyMaps:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyMapsCommand(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 = [ + { + myMap: {}, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes Empty Self-closed XML maps + */ +it("XmlEmptySelfClosedMaps:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyMapsCommand(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 = [ + { + myMap: {}, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes xml empty strings + */ +it("XmlEmptyStrings:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlEmptyStringsCommand({ + emptyString: "", + } 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("PUT"); + expect(r.path).toBe("/XmlEmptyStrings"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes xml empty strings + */ +it("XmlEmptyStrings:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyStringsCommand(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 = [ + { + emptyString: "", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Empty self closed string are deserialized as empty string + */ +it("XmlEmptySelfClosedStrings:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEmptyStringsCommand(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 = [ + { + emptyString: "", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("XmlEnums:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlEnumsCommand({ + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + } 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("PUT"); + expect(r.path).toBe("/XmlEnums"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + Foo + 0 + 1 + + Foo + 0 + + + Foo + 0 + + + + hi + Foo + + + zero + 0 + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("XmlEnums:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + Foo + 0 + 1 + + Foo + 0 + + + Foo + 0 + + + + hi + Foo + + + zero + 0 + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlEnumsCommand(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 = [ + { + fooEnum1: "Foo", + fooEnum2: "0", + fooEnum3: "1", + fooEnumList: ["Foo", "0"], + fooEnumSet: ["Foo", "0"], + fooEnumMap: { + hi: "Foo", + zero: "0", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("XmlIntEnums:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlIntEnumsCommand({ + intEnum1: 1, + intEnum2: 2, + intEnum3: 3, + intEnumList: [1, 2], + intEnumSet: [1, 2], + intEnumMap: { + a: 1, + b: 2, + } 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("PUT"); + expect(r.path).toBe("/XmlIntEnums"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + 1 + 2 + 3 + + 1 + 2 + + + 1 + 2 + + + + a + 1 + + + b + 2 + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("XmlIntEnums:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 1 + 2 + 3 + + 1 + 2 + + + 1 + 2 + + + + a + 1 + + + b + 2 + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlIntEnumsCommand(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 = [ + { + intEnum1: 1, + intEnum2: 2, + intEnum3: 3, + intEnumList: [1, 2], + intEnumSet: [1, 2], + intEnumMap: { + a: 1, + b: 2, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests for XML list serialization + */ +it("XmlLists:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlListsCommand({ + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238000), new Date(1398796238000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + renamedListMembers: ["foo", "bar"], + flattenedList: ["hi", "bye"], + flattenedList2: ["yep", "nope"], + structureList: [ + { + a: "1", + b: "2", + } as any, + { + a: "3", + b: "4", + } as any, + ], + flattenedStructureList: [ + { + a: "5", + b: "6", + } as any, + { + a: "7", + b: "8", + } 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("PUT"); + expect(r.path).toBe("/XmlLists"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + foo + bar + + + foo + bar + + + 1 + 2 + + + true + false + + + 2014-04-29T18:30:38Z + 2014-04-29T18:30:38Z + + + Foo + 0 + + + 1 + 2 + + + + foo + bar + + + baz + qux + + + + foo + bar + + hi + bye + yep + nope + + + 1 + 2 + + + 3 + 4 + + + + 5 + 6 + + + 7 + 8 + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Tests for XML list serialization + */ +it("XmlLists:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + foo + bar + + + foo + bar + + + 1 + 2 + + + true + false + + + 2014-04-29T18:30:38Z + 2014-04-29T18:30:38Z + + + Foo + 0 + + + 1 + 2 + + + + foo + bar + + + baz + qux + + + + foo + bar + + hi + bye + yep + nope + a + b + a + b + + + 1 + 2 + + + 3 + 4 + + + + 5 + 6 + + + 7 + 8 + + + ` + ), + }); + + const params: any = {}; + const command = new XmlListsCommand(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 = [ + { + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238 * 1000), new Date(1398796238 * 1000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + renamedListMembers: ["foo", "bar"], + flattenedList: ["hi", "bye"], + flattenedList2: ["yep", "nope"], + flattenedListWithMemberNamespace: ["a", "b"], + flattenedListWithNamespace: ["a", "b"], + structureList: [ + { + a: "1", + b: "2", + }, + { + a: "3", + b: "4", + }, + ], + flattenedStructureList: [ + { + a: "5", + b: "6", + }, + { + a: "7", + b: "8", + }, + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests for XML map serialization + */ +it("XmlMaps:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlMapsCommand({ + myMap: { + foo: { + hi: "there", + } as any, + baz: { + hi: "bye", + } 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("/XmlMaps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + foo + + there + + + + baz + + bye + + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Tests for XML map serialization + */ +it("XmlMaps:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + foo + + there + + + + baz + + bye + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlMapsCommand(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 = [ + { + myMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML maps that have xmlName on members + */ +it("XmlMapsXmlName:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlMapsXmlNameCommand({ + myMap: { + foo: { + hi: "there", + } as any, + baz: { + hi: "bye", + } 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("/XmlMapsXmlName"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + foo + + there + + + + baz + + bye + + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes XML lists + */ +it("XmlMapsXmlName:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + foo + + there + + + + baz + + bye + + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlMapsXmlNameCommand(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 = [ + { + myMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML maps in requests that have xmlNamespace and xmlName on members + */ +it("RestXmlXmlMapWithXmlNamespace:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlMapWithXmlNamespaceCommand({ + myMap: { + a: "A", + b: "B", + } 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("/XmlMapWithXmlNamespace"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + a + A + + + b + B + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes XML maps in responses that have xmlNamespace and xmlName on members + */ +it("RestXmlXmlMapWithXmlNamespace:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + a + A + + + b + B + + + ` + ), + }); + + const params: any = {}; + const command = new XmlMapWithXmlNamespaceCommand(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 = [ + { + myMap: { + a: "A", + b: "B", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes XML namespaces + */ +it("XmlNamespaces:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlNamespacesCommand({ + nested: { + foo: "Foo", + values: ["Bar", "Baz"], + } 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("/XmlNamespaces"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + Foo + + Bar + Baz + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes XML namespaces + */ +it("XmlNamespaces:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + Foo + + Bar + Baz + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlNamespacesCommand(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 = [ + { + nested: { + foo: "Foo", + values: ["Bar", "Baz"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Tests how normal timestamps are serialized + */ +it("XmlTimestamps:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlTimestampsCommand({ + normal: new Date(1398796238000), + } 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("/XmlTimestamps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + 2014-04-29T18:30:38Z + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of date-time works like normal timestamps + */ +it("XmlTimestampsWithDateTimeFormat:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlTimestampsCommand({ + dateTime: new Date(1398796238000), + } 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("/XmlTimestamps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + 2014-04-29T18:30:38Z + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of date-time on the target shape works like normal timestamps + */ +it("XmlTimestampsWithDateTimeOnTargetFormat:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlTimestampsCommand({ + dateTimeOnTarget: new Date(1398796238000), + } 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("/XmlTimestamps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + 2014-04-29T18:30:38Z + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of epoch-seconds works + */ +it("XmlTimestampsWithEpochSecondsFormat:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlTimestampsCommand({ + epochSeconds: new Date(1398796238000), + } 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("/XmlTimestamps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + 1398796238 + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of epoch-seconds on the target shape works + */ +it("XmlTimestampsWithEpochSecondsOnTargetFormat:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlTimestampsCommand({ + epochSecondsOnTarget: new Date(1398796238000), + } 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("/XmlTimestamps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + 1398796238 + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of http-date works + */ +it("XmlTimestampsWithHttpDateFormat:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlTimestampsCommand({ + httpDate: new Date(1398796238000), + } 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("/XmlTimestamps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + Tue, 29 Apr 2014 18:30:38 GMT + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensures that the timestampFormat of http-date on the target shape works + */ +it("XmlTimestampsWithHttpDateOnTargetFormat:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlTimestampsCommand({ + httpDateOnTarget: new Date(1398796238000), + } 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("/XmlTimestamps"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + Tue, 29 Apr 2014 18:30:38 GMT + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Tests how normal timestamps are serialized + */ +it("XmlTimestamps:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 2014-04-29T18:30:38Z + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + normal: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time works like normal timestamps + */ +it("XmlTimestampsWithDateTimeFormat:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 2014-04-29T18:30:38Z + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + dateTime: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of date-time on the target shape works like normal timestamps + */ +it("XmlTimestampsWithDateTimeOnTargetFormat:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 2014-04-29T18:30:38Z + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + dateTimeOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds works + */ +it("XmlTimestampsWithEpochSecondsFormat:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 1398796238 + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + epochSeconds: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of epoch-seconds on the target shape works + */ +it("XmlTimestampsWithEpochSecondsOnTargetFormat:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + 1398796238 + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + epochSecondsOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date works + */ +it("XmlTimestampsWithHttpDateFormat:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + Tue, 29 Apr 2014 18:30:38 GMT + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + httpDate: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that the timestampFormat of http-date on the target shape works + */ +it("XmlTimestampsWithHttpDateOnTargetFormat:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + Tue, 29 Apr 2014 18:30:38 GMT + + ` + ), + }); + + const params: any = {}; + const command = new XmlTimestampsCommand(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 = [ + { + httpDateOnTarget: new Date(1398796238 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes union struct member + */ +it("XmlUnionsWithStructMember:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlUnionsCommand({ + unionValue: { + structValue: { + stringValue: "string", + booleanValue: true, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + } 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("PUT"); + expect(r.path).toBe("/XmlUnions"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + string + true + 1 + 2 + 3 + 4 + 5.5 + 6.5 + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * serialize union string member + */ +it("XmlUnionsWithStringMember:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlUnionsCommand({ + unionValue: { + stringValue: "some string", + } 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("PUT"); + expect(r.path).toBe("/XmlUnions"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + some string + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes union boolean member + */ +it("XmlUnionsWithBooleanMember:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlUnionsCommand({ + unionValue: { + booleanValue: true, + } 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("PUT"); + expect(r.path).toBe("/XmlUnions"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + true + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes union member + */ +it("XmlUnionsWithUnionMember:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new XmlUnionsCommand({ + unionValue: { + unionValue: { + booleanValue: true, + } 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("PUT"); + expect(r.path).toBe("/XmlUnions"); + + expect(r.headers["content-type"]).toBe("application/xml"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const utf8Encoder = client.config.utf8Encoder; + const bodyString = ` + + + true + + + + `; + const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes union struct member + */ +it("XmlUnionsWithStructMember:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + string + true + 1 + 2 + 3 + 4 + 5.5 + 6.5 + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlUnionsCommand(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 = [ + { + unionValue: { + structValue: { + stringValue: "string", + booleanValue: true, + byteValue: 1, + shortValue: 2, + integerValue: 3, + longValue: 4, + floatValue: 5.5, + doubleValue: 6.5, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes union string member + */ +it("XmlUnionsWithStringMember:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + some string + + + ` + ), + }); + + const params: any = {}; + const command = new XmlUnionsCommand(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 = [ + { + unionValue: { + stringValue: "some string", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes union boolean member + */ +it("XmlUnionsWithBooleanMember:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + true + + + ` + ), + }); + + const params: any = {}; + const command = new XmlUnionsCommand(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 = [ + { + unionValue: { + booleanValue: true, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes union member + */ +it("XmlUnionsWithUnionMember:Response", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "content-type": "application/xml", + }, + ` + + + true + + + + ` + ), + }); + + const params: any = {}; + const command = new XmlUnionsCommand(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 = [ + { + unionValue: { + unionValue: { + booleanValue: true, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentUnknownTypeBodies = ( + utf8Encoder: __Encoder, + expectedBody: string, + generatedBody: string | Uint8Array +): Object => { + const expectedParts = { Value: expectedBody }; + const generatedParts = { + Value: generatedBody instanceof Uint8Array ? utf8Encoder(generatedBody) : generatedBody, + }; + + return compareParts(expectedParts, generatedParts); +}; + +/** + * Returns a map of key names that were un-equal to value objects showing the + * discrepancies between the components. + */ +const compareEquivalentXmlBodies = (expectedBody: string, generatedBody: string): Object => { + const parseConfig = { + attributeNamePrefix: "", + htmlEntities: true, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_: any, val: any) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + }; + + const parseXmlBody = (body: string) => { + const parser = new XMLParser(parseConfig); + parser.addEntity("#xD", "\r"); + parser.addEntity("#10", "\n"); + const parsedObj = parser.parse(body); + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; + } + return parsedObj; + }; + + const expectedParts = parseXmlBody(expectedBody); + const generatedParts = parseXmlBody(generatedBody); + + return compareParts(expectedParts, generatedParts); +}; diff --git a/private/aws-protocoltests-restxml-schema/tsconfig.cjs.json b/private/aws-protocoltests-restxml-schema/tsconfig.cjs.json new file mode 100644 index 0000000000000..9224176da7f72 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-restxml-schema/tsconfig.es.json b/private/aws-protocoltests-restxml-schema/tsconfig.es.json new file mode 100644 index 0000000000000..5a76fb6593463 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "ESNext", + "moduleResolution": "bundler", + "outDir": "dist-es", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-restxml-schema/tsconfig.json b/private/aws-protocoltests-restxml-schema/tsconfig.json new file mode 100644 index 0000000000000..956bed461a6ce --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/private/aws-protocoltests-restxml-schema/tsconfig.types.json b/private/aws-protocoltests-restxml-schema/tsconfig.types.json new file mode 100644 index 0000000000000..b9a5eb7844868 --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/tsconfig.types.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true, + "noCheck": false + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/private/aws-protocoltests-restxml-schema/vite.config.js b/private/aws-protocoltests-restxml-schema/vite.config.js new file mode 100644 index 0000000000000..e7147d3ac9e1d --- /dev/null +++ b/private/aws-protocoltests-restxml-schema/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/.gitignore b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/.gitignore new file mode 100644 index 0000000000000..54f14c9aef253 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/LICENSE b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/LICENSE new file mode 100644 index 0000000000000..ba9d6d1526906 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/api-extractor.json b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/api-extractor.json new file mode 100644 index 0000000000000..d5bf5ffeee851 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/package.json b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/package.json new file mode 100644 index 0000000000000..bac5b9e08371c --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/package.json @@ -0,0 +1,97 @@ +{ + "name": "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema", + "description": "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema client", + "version": "1.0.0-alpha.1", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "test": "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.5.2", + "@smithy/fetch-http-handler": "^5.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.10", + "@smithy/middleware-retry": "^4.1.11", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.0.6", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.2", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.18", + "@smithy/util-defaults-mode-node": "^4.0.18", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.5", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "devDependencies": { + "@tsconfig/node18": "18.2.4", + "@types/node": "^18.19.69", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~5.8.3", + "vitest": "2.1.8" + }, + "engines": { + "node": ">=18.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "private": true, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-protocoltests-smithy-rpcv2-cbor-schema", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/aws-protocoltests-smithy-rpcv2-cbor-schema" + } +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/RpcV2Protocol.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/RpcV2Protocol.ts new file mode 100644 index 0000000000000..f4d54e91ccf7e --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/RpcV2Protocol.ts @@ -0,0 +1,306 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + EmptyInputOutputCommand, + EmptyInputOutputCommandInput, + EmptyInputOutputCommandOutput, +} from "./commands/EmptyInputOutputCommand"; +import { Float16Command, Float16CommandInput, Float16CommandOutput } from "./commands/Float16Command"; +import { + FractionalSecondsCommand, + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, +} from "./commands/FractionalSecondsCommand"; +import { + GreetingWithErrorsCommand, + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, +} from "./commands/GreetingWithErrorsCommand"; +import { + NoInputOutputCommand, + NoInputOutputCommandInput, + NoInputOutputCommandOutput, +} from "./commands/NoInputOutputCommand"; +import { + OperationWithDefaultsCommand, + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, +} from "./commands/OperationWithDefaultsCommand"; +import { + OptionalInputOutputCommand, + OptionalInputOutputCommandInput, + OptionalInputOutputCommandOutput, +} from "./commands/OptionalInputOutputCommand"; +import { + RecursiveShapesCommand, + RecursiveShapesCommandInput, + RecursiveShapesCommandOutput, +} from "./commands/RecursiveShapesCommand"; +import { + RpcV2CborDenseMapsCommand, + RpcV2CborDenseMapsCommandInput, + RpcV2CborDenseMapsCommandOutput, +} from "./commands/RpcV2CborDenseMapsCommand"; +import { + RpcV2CborListsCommand, + RpcV2CborListsCommandInput, + RpcV2CborListsCommandOutput, +} from "./commands/RpcV2CborListsCommand"; +import { + RpcV2CborSparseMapsCommand, + RpcV2CborSparseMapsCommandInput, + RpcV2CborSparseMapsCommandOutput, +} from "./commands/RpcV2CborSparseMapsCommand"; +import { + SimpleScalarPropertiesCommand, + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + SparseNullsOperationCommand, + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, +} from "./commands/SparseNullsOperationCommand"; +import { RpcV2ProtocolClient, RpcV2ProtocolClientConfig } from "./RpcV2ProtocolClient"; + +const commands = { + EmptyInputOutputCommand, + Float16Command, + FractionalSecondsCommand, + GreetingWithErrorsCommand, + NoInputOutputCommand, + OperationWithDefaultsCommand, + OptionalInputOutputCommand, + RecursiveShapesCommand, + RpcV2CborDenseMapsCommand, + RpcV2CborListsCommand, + RpcV2CborSparseMapsCommand, + SimpleScalarPropertiesCommand, + SparseNullsOperationCommand, +}; + +export interface RpcV2Protocol { + /** + * @see {@link EmptyInputOutputCommand} + */ + emptyInputOutput(): Promise; + emptyInputOutput( + args: EmptyInputOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + emptyInputOutput( + args: EmptyInputOutputCommandInput, + cb: (err: any, data?: EmptyInputOutputCommandOutput) => void + ): void; + emptyInputOutput( + args: EmptyInputOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: EmptyInputOutputCommandOutput) => void + ): void; + + /** + * @see {@link Float16Command} + */ + float16(): Promise; + float16(args: Float16CommandInput, options?: __HttpHandlerOptions): Promise; + float16(args: Float16CommandInput, cb: (err: any, data?: Float16CommandOutput) => void): void; + float16( + args: Float16CommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: Float16CommandOutput) => void + ): void; + + /** + * @see {@link FractionalSecondsCommand} + */ + fractionalSeconds(): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + fractionalSeconds( + args: FractionalSecondsCommandInput, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + fractionalSeconds( + args: FractionalSecondsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: FractionalSecondsCommandOutput) => void + ): void; + + /** + * @see {@link GreetingWithErrorsCommand} + */ + greetingWithErrors(): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + greetingWithErrors( + args: GreetingWithErrorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void + ): void; + + /** + * @see {@link NoInputOutputCommand} + */ + noInputOutput(): Promise; + noInputOutput(args: NoInputOutputCommandInput, options?: __HttpHandlerOptions): Promise; + noInputOutput(args: NoInputOutputCommandInput, cb: (err: any, data?: NoInputOutputCommandOutput) => void): void; + noInputOutput( + args: NoInputOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: NoInputOutputCommandOutput) => void + ): void; + + /** + * @see {@link OperationWithDefaultsCommand} + */ + operationWithDefaults(): Promise; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void + ): void; + operationWithDefaults( + args: OperationWithDefaultsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void + ): void; + + /** + * @see {@link OptionalInputOutputCommand} + */ + optionalInputOutput(): Promise; + optionalInputOutput( + args: OptionalInputOutputCommandInput, + options?: __HttpHandlerOptions + ): Promise; + optionalInputOutput( + args: OptionalInputOutputCommandInput, + cb: (err: any, data?: OptionalInputOutputCommandOutput) => void + ): void; + optionalInputOutput( + args: OptionalInputOutputCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OptionalInputOutputCommandOutput) => void + ): void; + + /** + * @see {@link RecursiveShapesCommand} + */ + recursiveShapes(): Promise; + recursiveShapes( + args: RecursiveShapesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + recursiveShapes(args: RecursiveShapesCommandInput, cb: (err: any, data?: RecursiveShapesCommandOutput) => void): void; + recursiveShapes( + args: RecursiveShapesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RecursiveShapesCommandOutput) => void + ): void; + + /** + * @see {@link RpcV2CborDenseMapsCommand} + */ + rpcV2CborDenseMaps(): Promise; + rpcV2CborDenseMaps( + args: RpcV2CborDenseMapsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + rpcV2CborDenseMaps( + args: RpcV2CborDenseMapsCommandInput, + cb: (err: any, data?: RpcV2CborDenseMapsCommandOutput) => void + ): void; + rpcV2CborDenseMaps( + args: RpcV2CborDenseMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RpcV2CborDenseMapsCommandOutput) => void + ): void; + + /** + * @see {@link RpcV2CborListsCommand} + */ + rpcV2CborLists(): Promise; + rpcV2CborLists( + args: RpcV2CborListsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + rpcV2CborLists(args: RpcV2CborListsCommandInput, cb: (err: any, data?: RpcV2CborListsCommandOutput) => void): void; + rpcV2CborLists( + args: RpcV2CborListsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RpcV2CborListsCommandOutput) => void + ): void; + + /** + * @see {@link RpcV2CborSparseMapsCommand} + */ + rpcV2CborSparseMaps(): Promise; + rpcV2CborSparseMaps( + args: RpcV2CborSparseMapsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + rpcV2CborSparseMaps( + args: RpcV2CborSparseMapsCommandInput, + cb: (err: any, data?: RpcV2CborSparseMapsCommandOutput) => void + ): void; + rpcV2CborSparseMaps( + args: RpcV2CborSparseMapsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RpcV2CborSparseMapsCommandOutput) => void + ): void; + + /** + * @see {@link SimpleScalarPropertiesCommand} + */ + simpleScalarProperties(): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + simpleScalarProperties( + args: SimpleScalarPropertiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void + ): void; + + /** + * @see {@link SparseNullsOperationCommand} + */ + sparseNullsOperation(): Promise; + sparseNullsOperation( + args: SparseNullsOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + sparseNullsOperation( + args: SparseNullsOperationCommandInput, + cb: (err: any, data?: SparseNullsOperationCommandOutput) => void + ): void; + sparseNullsOperation( + args: SparseNullsOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SparseNullsOperationCommandOutput) => void + ): void; +} + +/** + * @public + */ +export class RpcV2Protocol extends RpcV2ProtocolClient implements RpcV2Protocol {} +createAggregatedClient(commands, RpcV2Protocol); diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/RpcV2ProtocolClient.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/RpcV2ProtocolClient.ts new file mode 100644 index 0000000000000..b433ce7feb463 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/RpcV2ProtocolClient.ts @@ -0,0 +1,353 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { + DefaultIdentityProviderConfig, + getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpSigningPlugin, +} from "@smithy/core"; +import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + ClientProtocol, + Decoder as __Decoder, + Encoder as __Encoder, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + HttpRequest, + HttpResponse, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + defaultRpcV2ProtocolHttpAuthSchemeParametersProvider, + HttpAuthSchemeInputConfig, + HttpAuthSchemeResolvedConfig, + resolveHttpAuthSchemeConfig, +} from "./auth/httpAuthSchemeProvider"; +import { EmptyInputOutputCommandInput, EmptyInputOutputCommandOutput } from "./commands/EmptyInputOutputCommand"; +import { Float16CommandInput, Float16CommandOutput } from "./commands/Float16Command"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "./commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "./commands/GreetingWithErrorsCommand"; +import { NoInputOutputCommandInput, NoInputOutputCommandOutput } from "./commands/NoInputOutputCommand"; +import { + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, +} from "./commands/OperationWithDefaultsCommand"; +import { + OptionalInputOutputCommandInput, + OptionalInputOutputCommandOutput, +} from "./commands/OptionalInputOutputCommand"; +import { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from "./commands/RecursiveShapesCommand"; +import { RpcV2CborDenseMapsCommandInput, RpcV2CborDenseMapsCommandOutput } from "./commands/RpcV2CborDenseMapsCommand"; +import { RpcV2CborListsCommandInput, RpcV2CborListsCommandOutput } from "./commands/RpcV2CborListsCommand"; +import { + RpcV2CborSparseMapsCommandInput, + RpcV2CborSparseMapsCommandOutput, +} from "./commands/RpcV2CborSparseMapsCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "./commands/SimpleScalarPropertiesCommand"; +import { + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, +} from "./commands/SparseNullsOperationCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | EmptyInputOutputCommandInput + | Float16CommandInput + | FractionalSecondsCommandInput + | GreetingWithErrorsCommandInput + | NoInputOutputCommandInput + | OperationWithDefaultsCommandInput + | OptionalInputOutputCommandInput + | RecursiveShapesCommandInput + | RpcV2CborDenseMapsCommandInput + | RpcV2CborListsCommandInput + | RpcV2CborSparseMapsCommandInput + | SimpleScalarPropertiesCommandInput + | SparseNullsOperationCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | EmptyInputOutputCommandOutput + | Float16CommandOutput + | FractionalSecondsCommandOutput + | GreetingWithErrorsCommandOutput + | NoInputOutputCommandOutput + | OperationWithDefaultsCommandOutput + | OptionalInputOutputCommandOutput + | RecursiveShapesCommandOutput + | RpcV2CborDenseMapsCommandOutput + | RpcV2CborListsCommandOutput + | RpcV2CborSparseMapsCommandOutput + | SimpleScalarPropertiesCommandOutput + | SparseNullsOperationCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandlerUserInput; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON) + * may be overridden. A default will always be set by the client. + * Available options depend on the service's supported protocols and will not be validated by + * the client. + * @alpha + * + */ + protocol?: ClientProtocol; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type RpcV2ProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + UserAgentInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + EndpointInputConfig & + HttpAuthSchemeInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of RpcV2ProtocolClient class constructor that set the region, credentials and other options. + */ +export interface RpcV2ProtocolClientConfig extends RpcV2ProtocolClientConfigType {} + +/** + * @public + */ +export type RpcV2ProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + UserAgentResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + EndpointResolvedConfig & + HttpAuthSchemeResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of RpcV2ProtocolClient class. This is resolved and normalized from the {@link RpcV2ProtocolClientConfig | constructor configuration interface}. + */ +export interface RpcV2ProtocolClientResolvedConfig extends RpcV2ProtocolClientResolvedConfigType {} + +/** + * @public + */ +export class RpcV2ProtocolClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + RpcV2ProtocolClientResolvedConfig +> { + /** + * The resolved configuration of RpcV2ProtocolClient class. This is resolved and normalized from the {@link RpcV2ProtocolClientConfig | constructor configuration interface}. + */ + readonly config: RpcV2ProtocolClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + super(_config_0 as any); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveUserAgentConfig(_config_1); + const _config_3 = resolveRetryConfig(_config_2); + const _config_4 = resolveHostHeaderConfig(_config_3); + const _config_5 = resolveEndpointConfig(_config_4); + const _config_6 = resolveHttpAuthSchemeConfig(_config_5); + const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []); + this.config = _config_7; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use( + getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultRpcV2ProtocolHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config: RpcV2ProtocolClientResolvedConfig) => + new DefaultIdentityProviderConfig({}), + }) + ); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/auth/httpAuthExtensionConfiguration.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/auth/httpAuthExtensionConfiguration.ts new file mode 100644 index 0000000000000..12b4fd7b6b194 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/auth/httpAuthExtensionConfiguration.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +import { HttpAuthScheme } from "@smithy/types"; + +import { RpcV2ProtocolHttpAuthSchemeProvider } from "./httpAuthSchemeProvider"; + +/** + * @internal + */ +export interface HttpAuthExtensionConfiguration { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void; + httpAuthSchemes(): HttpAuthScheme[]; + setHttpAuthSchemeProvider(httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider): void; + httpAuthSchemeProvider(): RpcV2ProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export type HttpAuthRuntimeConfig = Partial<{ + httpAuthSchemes: HttpAuthScheme[]; + httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider; +}>; + +/** + * @internal + */ +export const getHttpAuthExtensionConfiguration = ( + runtimeConfig: HttpAuthRuntimeConfig +): HttpAuthExtensionConfiguration => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!; + return { + setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes(): HttpAuthScheme[] { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider): void { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider(): RpcV2ProtocolHttpAuthSchemeProvider { + return _httpAuthSchemeProvider; + }, + }; +}; + +/** + * @internal + */ +export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + }; +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/auth/httpAuthSchemeProvider.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/auth/httpAuthSchemeProvider.ts new file mode 100644 index 0000000000000..89287e645f2de --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/auth/httpAuthSchemeProvider.ts @@ -0,0 +1,128 @@ +// smithy-typescript generated code +import { + HandlerExecutionContext, + HttpAuthOption, + HttpAuthScheme, + HttpAuthSchemeParameters, + HttpAuthSchemeParametersProvider, + HttpAuthSchemeProvider, + Provider, +} from "@smithy/types"; +import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware"; + +import { RpcV2ProtocolClientResolvedConfig } from "../RpcV2ProtocolClient"; + +/** + * @internal + */ +export interface RpcV2ProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters {} + +/** + * @internal + */ +export interface RpcV2ProtocolHttpAuthSchemeParametersProvider + extends HttpAuthSchemeParametersProvider< + RpcV2ProtocolClientResolvedConfig, + HandlerExecutionContext, + RpcV2ProtocolHttpAuthSchemeParameters, + object + > {} + +/** + * @internal + */ +export const defaultRpcV2ProtocolHttpAuthSchemeParametersProvider = async ( + config: RpcV2ProtocolClientResolvedConfig, + context: HandlerExecutionContext, + input: object +): Promise => { + return { + operation: getSmithyContext(context).operation as string, + }; +}; + +function createSmithyApiNoAuthHttpAuthOption(authParameters: RpcV2ProtocolHttpAuthSchemeParameters): HttpAuthOption { + return { + schemeId: "smithy.api#noAuth", + }; +} + +/** + * @internal + */ +export interface RpcV2ProtocolHttpAuthSchemeProvider + extends HttpAuthSchemeProvider {} + +/** + * @internal + */ +export const defaultRpcV2ProtocolHttpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider = (authParameters) => { + const options: HttpAuthOption[] = []; + switch (authParameters.operation) { + default: { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + } + } + return options; +}; + +/** + * @internal + */ +export interface HttpAuthSchemeInputConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + authSchemePreference?: string[] | Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + httpAuthSchemes?: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + httpAuthSchemeProvider?: RpcV2ProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export interface HttpAuthSchemeResolvedConfig { + /** + * A comma-separated list of case-sensitive auth scheme names. + * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. + * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. + * @public + */ + readonly authSchemePreference: Provider; + + /** + * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme. + * @internal + */ + readonly httpAuthSchemes: HttpAuthScheme[]; + + /** + * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use. + * @internal + */ + readonly httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider; +} + +/** + * @internal + */ +export const resolveHttpAuthSchemeConfig = ( + config: T & HttpAuthSchemeInputConfig +): T & HttpAuthSchemeResolvedConfig => { + return Object.assign(config, { + authSchemePreference: normalizeProvider(config.authSchemePreference ?? []), + }) as T & HttpAuthSchemeResolvedConfig; +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts new file mode 100644 index 0000000000000..369b50b19a22e --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts @@ -0,0 +1,84 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { EmptyStructure } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { EmptyInputOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link EmptyInputOutputCommand}. + */ +export interface EmptyInputOutputCommandInput extends EmptyStructure {} +/** + * @public + * + * The output of {@link EmptyInputOutputCommand}. + */ +export interface EmptyInputOutputCommandOutput extends EmptyStructure, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, EmptyInputOutputCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, EmptyInputOutputCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = {}; + * const command = new EmptyInputOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param EmptyInputOutputCommandInput - {@link EmptyInputOutputCommandInput} + * @returns {@link EmptyInputOutputCommandOutput} + * @see {@link EmptyInputOutputCommandInput} for command's `input` shape. + * @see {@link EmptyInputOutputCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class EmptyInputOutputCommand extends $Command + .classBuilder< + EmptyInputOutputCommandInput, + EmptyInputOutputCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "EmptyInputOutput", {}) + .n("RpcV2ProtocolClient", "EmptyInputOutputCommand") + .f(void 0, void 0) + .sc(EmptyInputOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: EmptyInputOutputCommandInput; + output: EmptyInputOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts new file mode 100644 index 0000000000000..b729913400812 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { Float16Output } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { Float16 } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link Float16Command}. + */ +export interface Float16CommandInput {} +/** + * @public + * + * The output of {@link Float16Command}. + */ +export interface Float16CommandOutput extends Float16Output, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, Float16Command } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, Float16Command } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = {}; + * const command = new Float16Command(input); + * const response = await client.send(command); + * // { // Float16Output + * // value: Number("double"), + * // }; + * + * ``` + * + * @param Float16CommandInput - {@link Float16CommandInput} + * @returns {@link Float16CommandOutput} + * @see {@link Float16CommandInput} for command's `input` shape. + * @see {@link Float16CommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class Float16Command extends $Command + .classBuilder< + Float16CommandInput, + Float16CommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "Float16", {}) + .n("RpcV2ProtocolClient", "Float16Command") + .f(void 0, void 0) + .sc(Float16) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: Float16Output; + }; + sdk: { + input: Float16CommandInput; + output: Float16CommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts new file mode 100644 index 0000000000000..11a01932332e9 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts @@ -0,0 +1,86 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { FractionalSecondsOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { FractionalSeconds } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandInput {} +/** + * @public + * + * The output of {@link FractionalSecondsCommand}. + */ +export interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, FractionalSecondsCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, FractionalSecondsCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = {}; + * const command = new FractionalSecondsCommand(input); + * const response = await client.send(command); + * // { // FractionalSecondsOutput + * // datetime: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput} + * @returns {@link FractionalSecondsCommandOutput} + * @see {@link FractionalSecondsCommandInput} for command's `input` shape. + * @see {@link FractionalSecondsCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class FractionalSecondsCommand extends $Command + .classBuilder< + FractionalSecondsCommandInput, + FractionalSecondsCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "FractionalSeconds", {}) + .n("RpcV2ProtocolClient", "FractionalSecondsCommand") + .f(void 0, void 0) + .sc(FractionalSeconds) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: FractionalSecondsOutput; + }; + sdk: { + input: FractionalSecondsCommandInput; + output: FractionalSecondsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts new file mode 100644 index 0000000000000..8fce3fb9f443c --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts @@ -0,0 +1,99 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { GreetingWithErrorsOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { GreetingWithErrors } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandInput {} +/** + * @public + * + * The output of {@link GreetingWithErrorsCommand}. + */ +export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {} + +/** + * This operation has three possible return values: + * + * 1. A successful response in the form of GreetingWithErrorsOutput + * 2. An InvalidGreeting error. + * 3. A ComplexError error. + * + * Implementations must be able to successfully take a response and + * properly deserialize successful and error responses. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, GreetingWithErrorsCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, GreetingWithErrorsCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = {}; + * const command = new GreetingWithErrorsCommand(input); + * const response = await client.send(command); + * // { // GreetingWithErrorsOutput + * // greeting: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput} + * @returns {@link GreetingWithErrorsCommandOutput} + * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape. + * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link InvalidGreeting} (client fault) + * This error is thrown when an invalid greeting value is provided. + * + * @throws {@link ComplexError} (client fault) + * This error is thrown when a request is invalid. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + * @public + */ +export class GreetingWithErrorsCommand extends $Command + .classBuilder< + GreetingWithErrorsCommandInput, + GreetingWithErrorsCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "GreetingWithErrors", {}) + .n("RpcV2ProtocolClient", "GreetingWithErrorsCommand") + .f(void 0, void 0) + .sc(GreetingWithErrors) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: GreetingWithErrorsOutput; + }; + sdk: { + input: GreetingWithErrorsCommandInput; + output: GreetingWithErrorsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts new file mode 100644 index 0000000000000..182d9236a175d --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts @@ -0,0 +1,83 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { NoInputOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link NoInputOutputCommand}. + */ +export interface NoInputOutputCommandInput {} +/** + * @public + * + * The output of {@link NoInputOutputCommand}. + */ +export interface NoInputOutputCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, NoInputOutputCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, NoInputOutputCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = {}; + * const command = new NoInputOutputCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param NoInputOutputCommandInput - {@link NoInputOutputCommandInput} + * @returns {@link NoInputOutputCommandOutput} + * @see {@link NoInputOutputCommandInput} for command's `input` shape. + * @see {@link NoInputOutputCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class NoInputOutputCommand extends $Command + .classBuilder< + NoInputOutputCommandInput, + NoInputOutputCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "NoInputOutput", {}) + .n("RpcV2ProtocolClient", "NoInputOutputCommand") + .f(void 0, void 0) + .sc(NoInputOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: {}; + }; + sdk: { + input: NoInputOutputCommandInput; + output: NoInputOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts new file mode 100644 index 0000000000000..fa7f36065faa3 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts @@ -0,0 +1,152 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { OperationWithDefaultsInput, OperationWithDefaultsOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { OperationWithDefaults } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OperationWithDefaultsCommand}. + */ +export interface OperationWithDefaultsCommandInput extends OperationWithDefaultsInput {} +/** + * @public + * + * The output of {@link OperationWithDefaultsCommand}. + */ +export interface OperationWithDefaultsCommandOutput extends OperationWithDefaultsOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, OperationWithDefaultsCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, OperationWithDefaultsCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // OperationWithDefaultsInput + * defaults: { // Defaults + * defaultString: "STRING_VALUE", + * defaultBoolean: true || false, + * defaultList: [ // TestStringList + * "STRING_VALUE", + * ], + * defaultTimestamp: new Date("TIMESTAMP"), + * defaultBlob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * defaultByte: 0, // BYTE_VALUE + * defaultShort: Number("short"), + * defaultInteger: Number("int"), + * defaultLong: Number("long"), + * defaultFloat: Number("float"), + * defaultDouble: Number("double"), + * defaultMap: { // TestStringMap + * "": "STRING_VALUE", + * }, + * defaultEnum: "FOO" || "BAR" || "BAZ", + * defaultIntEnum: 1 || 2, + * emptyString: "STRING_VALUE", + * falseBoolean: true || false, + * emptyBlob: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * zeroByte: 0, // BYTE_VALUE + * zeroShort: Number("short"), + * zeroInteger: Number("int"), + * zeroLong: Number("long"), + * zeroFloat: Number("float"), + * zeroDouble: Number("double"), + * }, + * clientOptionalDefaults: { // ClientOptionalDefaults + * member: Number("int"), + * }, + * topLevelDefault: "STRING_VALUE", + * otherTopLevelDefault: Number("int"), + * }; + * const command = new OperationWithDefaultsCommand(input); + * const response = await client.send(command); + * // { // OperationWithDefaultsOutput + * // defaultString: "STRING_VALUE", + * // defaultBoolean: true || false, + * // defaultList: [ // TestStringList + * // "STRING_VALUE", + * // ], + * // defaultTimestamp: new Date("TIMESTAMP"), + * // defaultBlob: new Uint8Array(), + * // defaultByte: 0, // BYTE_VALUE + * // defaultShort: Number("short"), + * // defaultInteger: Number("int"), + * // defaultLong: Number("long"), + * // defaultFloat: Number("float"), + * // defaultDouble: Number("double"), + * // defaultMap: { // TestStringMap + * // "": "STRING_VALUE", + * // }, + * // defaultEnum: "FOO" || "BAR" || "BAZ", + * // defaultIntEnum: 1 || 2, + * // emptyString: "STRING_VALUE", + * // falseBoolean: true || false, + * // emptyBlob: new Uint8Array(), + * // zeroByte: 0, // BYTE_VALUE + * // zeroShort: Number("short"), + * // zeroInteger: Number("int"), + * // zeroLong: Number("long"), + * // zeroFloat: Number("float"), + * // zeroDouble: Number("double"), + * // }; + * + * ``` + * + * @param OperationWithDefaultsCommandInput - {@link OperationWithDefaultsCommandInput} + * @returns {@link OperationWithDefaultsCommandOutput} + * @see {@link OperationWithDefaultsCommandInput} for command's `input` shape. + * @see {@link OperationWithDefaultsCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link ValidationException} (client fault) + * A standard error for input validation failures. + * This should be thrown by services when a member of the input structure + * falls outside of the modeled or documented constraints. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class OperationWithDefaultsCommand extends $Command + .classBuilder< + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "OperationWithDefaults", {}) + .n("RpcV2ProtocolClient", "OperationWithDefaultsCommand") + .f(void 0, void 0) + .sc(OperationWithDefaults) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OperationWithDefaultsInput; + output: OperationWithDefaultsOutput; + }; + sdk: { + input: OperationWithDefaultsCommandInput; + output: OperationWithDefaultsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts new file mode 100644 index 0000000000000..fc6a3ffdfa515 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts @@ -0,0 +1,88 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleStructure } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { OptionalInputOutput } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OptionalInputOutputCommand}. + */ +export interface OptionalInputOutputCommandInput extends SimpleStructure {} +/** + * @public + * + * The output of {@link OptionalInputOutputCommand}. + */ +export interface OptionalInputOutputCommandOutput extends SimpleStructure, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, OptionalInputOutputCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, OptionalInputOutputCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // SimpleStructure + * value: "STRING_VALUE", + * }; + * const command = new OptionalInputOutputCommand(input); + * const response = await client.send(command); + * // { // SimpleStructure + * // value: "STRING_VALUE", + * // }; + * + * ``` + * + * @param OptionalInputOutputCommandInput - {@link OptionalInputOutputCommandInput} + * @returns {@link OptionalInputOutputCommandOutput} + * @see {@link OptionalInputOutputCommandInput} for command's `input` shape. + * @see {@link OptionalInputOutputCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class OptionalInputOutputCommand extends $Command + .classBuilder< + OptionalInputOutputCommandInput, + OptionalInputOutputCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "OptionalInputOutput", {}) + .n("RpcV2ProtocolClient", "OptionalInputOutputCommand") + .f(void 0, void 0) + .sc(OptionalInputOutput) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleStructure; + output: SimpleStructure; + }; + sdk: { + input: OptionalInputOutputCommandInput; + output: OptionalInputOutputCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts new file mode 100644 index 0000000000000..529471d8f0e1e --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts @@ -0,0 +1,112 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RecursiveShapesInputOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { RecursiveShapes } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RecursiveShapesCommand}. + */ +export interface RecursiveShapesCommandInput extends RecursiveShapesInputOutput {} +/** + * @public + * + * The output of {@link RecursiveShapesCommand}. + */ +export interface RecursiveShapesCommandOutput extends RecursiveShapesInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, RecursiveShapesCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, RecursiveShapesCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // RecursiveShapesInputOutput + * nested: { // RecursiveShapesInputOutputNested1 + * foo: "STRING_VALUE", + * nested: { // RecursiveShapesInputOutputNested2 + * bar: "STRING_VALUE", + * recursiveMember: { + * foo: "STRING_VALUE", + * nested: { + * bar: "STRING_VALUE", + * recursiveMember: "", + * }, + * }, + * }, + * }, + * }; + * const command = new RecursiveShapesCommand(input); + * const response = await client.send(command); + * // { // RecursiveShapesInputOutput + * // nested: { // RecursiveShapesInputOutputNested1 + * // foo: "STRING_VALUE", + * // nested: { // RecursiveShapesInputOutputNested2 + * // bar: "STRING_VALUE", + * // recursiveMember: { + * // foo: "STRING_VALUE", + * // nested: { + * // bar: "STRING_VALUE", + * // recursiveMember: "", + * // }, + * // }, + * // }, + * // }, + * // }; + * + * ``` + * + * @param RecursiveShapesCommandInput - {@link RecursiveShapesCommandInput} + * @returns {@link RecursiveShapesCommandOutput} + * @see {@link RecursiveShapesCommandInput} for command's `input` shape. + * @see {@link RecursiveShapesCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class RecursiveShapesCommand extends $Command + .classBuilder< + RecursiveShapesCommandInput, + RecursiveShapesCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "RecursiveShapes", {}) + .n("RpcV2ProtocolClient", "RecursiveShapesCommand") + .f(void 0, void 0) + .sc(RecursiveShapes) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: RecursiveShapesInputOutput; + output: RecursiveShapesInputOutput; + }; + sdk: { + input: RecursiveShapesCommandInput; + output: RecursiveShapesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts new file mode 100644 index 0000000000000..1a27489c3c636 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts @@ -0,0 +1,129 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RpcV2CborDenseMapsInputOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { RpcV2CborDenseMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RpcV2CborDenseMapsCommand}. + */ +export interface RpcV2CborDenseMapsCommandInput extends RpcV2CborDenseMapsInputOutput {} +/** + * @public + * + * The output of {@link RpcV2CborDenseMapsCommand}. + */ +export interface RpcV2CborDenseMapsCommandOutput extends RpcV2CborDenseMapsInputOutput, __MetadataBearer {} + +/** + * The example tests basic map serialization. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, RpcV2CborDenseMapsCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, RpcV2CborDenseMapsCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // RpcV2CborDenseMapsInputOutput + * denseStructMap: { // DenseStructMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * denseNumberMap: { // DenseNumberMap + * "": Number("int"), + * }, + * denseBooleanMap: { // DenseBooleanMap + * "": true || false, + * }, + * denseStringMap: { // DenseStringMap + * "": "STRING_VALUE", + * }, + * denseSetMap: { // DenseSetMap + * "": [ // StringSet + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new RpcV2CborDenseMapsCommand(input); + * const response = await client.send(command); + * // { // RpcV2CborDenseMapsInputOutput + * // denseStructMap: { // DenseStructMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // denseNumberMap: { // DenseNumberMap + * // "": Number("int"), + * // }, + * // denseBooleanMap: { // DenseBooleanMap + * // "": true || false, + * // }, + * // denseStringMap: { // DenseStringMap + * // "": "STRING_VALUE", + * // }, + * // denseSetMap: { // DenseSetMap + * // "": [ // StringSet + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param RpcV2CborDenseMapsCommandInput - {@link RpcV2CborDenseMapsCommandInput} + * @returns {@link RpcV2CborDenseMapsCommandOutput} + * @see {@link RpcV2CborDenseMapsCommandInput} for command's `input` shape. + * @see {@link RpcV2CborDenseMapsCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link ValidationException} (client fault) + * A standard error for input validation failures. + * This should be thrown by services when a member of the input structure + * falls outside of the modeled or documented constraints. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + * @public + */ +export class RpcV2CborDenseMapsCommand extends $Command + .classBuilder< + RpcV2CborDenseMapsCommandInput, + RpcV2CborDenseMapsCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "RpcV2CborDenseMaps", {}) + .n("RpcV2ProtocolClient", "RpcV2CborDenseMapsCommand") + .f(void 0, void 0) + .sc(RpcV2CborDenseMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: RpcV2CborDenseMapsInputOutput; + output: RpcV2CborDenseMapsInputOutput; + }; + sdk: { + input: RpcV2CborDenseMapsCommandInput; + output: RpcV2CborDenseMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts new file mode 100644 index 0000000000000..9fff1cac7ced0 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts @@ -0,0 +1,167 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RpcV2CborListInputOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { RpcV2CborLists } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RpcV2CborListsCommand}. + */ +export interface RpcV2CborListsCommandInput extends RpcV2CborListInputOutput {} +/** + * @public + * + * The output of {@link RpcV2CborListsCommand}. + */ +export interface RpcV2CborListsCommandOutput extends RpcV2CborListInputOutput, __MetadataBearer {} + +/** + * This test case serializes JSON lists for the following cases for both + * input and output: + * + * 1. Normal lists. + * 2. Normal sets. + * 3. Lists of lists. + * 4. Lists of structures. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, RpcV2CborListsCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, RpcV2CborListsCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // RpcV2CborListInputOutput + * stringList: [ // StringList + * "STRING_VALUE", + * ], + * stringSet: [ // StringSet + * "STRING_VALUE", + * ], + * integerList: [ // IntegerList + * Number("int"), + * ], + * booleanList: [ // BooleanList + * true || false, + * ], + * timestampList: [ // TimestampList + * new Date("TIMESTAMP"), + * ], + * enumList: [ // FooEnumList + * "Foo" || "Baz" || "Bar" || "1" || "0", + * ], + * intEnumList: [ // IntegerEnumList + * 1 || 2 || 3, + * ], + * nestedStringList: [ // NestedStringList + * [ + * "STRING_VALUE", + * ], + * ], + * structureList: [ // StructureList + * { // StructureListMember + * a: "STRING_VALUE", + * b: "STRING_VALUE", + * }, + * ], + * blobList: [ // BlobList + * new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * ], + * }; + * const command = new RpcV2CborListsCommand(input); + * const response = await client.send(command); + * // { // RpcV2CborListInputOutput + * // stringList: [ // StringList + * // "STRING_VALUE", + * // ], + * // stringSet: [ // StringSet + * // "STRING_VALUE", + * // ], + * // integerList: [ // IntegerList + * // Number("int"), + * // ], + * // booleanList: [ // BooleanList + * // true || false, + * // ], + * // timestampList: [ // TimestampList + * // new Date("TIMESTAMP"), + * // ], + * // enumList: [ // FooEnumList + * // "Foo" || "Baz" || "Bar" || "1" || "0", + * // ], + * // intEnumList: [ // IntegerEnumList + * // 1 || 2 || 3, + * // ], + * // nestedStringList: [ // NestedStringList + * // [ + * // "STRING_VALUE", + * // ], + * // ], + * // structureList: [ // StructureList + * // { // StructureListMember + * // a: "STRING_VALUE", + * // b: "STRING_VALUE", + * // }, + * // ], + * // blobList: [ // BlobList + * // new Uint8Array(), + * // ], + * // }; + * + * ``` + * + * @param RpcV2CborListsCommandInput - {@link RpcV2CborListsCommandInput} + * @returns {@link RpcV2CborListsCommandOutput} + * @see {@link RpcV2CborListsCommandInput} for command's `input` shape. + * @see {@link RpcV2CborListsCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link ValidationException} (client fault) + * A standard error for input validation failures. + * This should be thrown by services when a member of the input structure + * falls outside of the modeled or documented constraints. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + * @public + */ +export class RpcV2CborListsCommand extends $Command + .classBuilder< + RpcV2CborListsCommandInput, + RpcV2CborListsCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "RpcV2CborLists", {}) + .n("RpcV2ProtocolClient", "RpcV2CborListsCommand") + .f(void 0, void 0) + .sc(RpcV2CborLists) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: RpcV2CborListInputOutput; + output: RpcV2CborListInputOutput; + }; + sdk: { + input: RpcV2CborListsCommandInput; + output: RpcV2CborListsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts new file mode 100644 index 0000000000000..faef2c61e3fe9 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts @@ -0,0 +1,129 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { RpcV2CborSparseMapsInputOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { RpcV2CborSparseMaps } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link RpcV2CborSparseMapsCommand}. + */ +export interface RpcV2CborSparseMapsCommandInput extends RpcV2CborSparseMapsInputOutput {} +/** + * @public + * + * The output of {@link RpcV2CborSparseMapsCommand}. + */ +export interface RpcV2CborSparseMapsCommandOutput extends RpcV2CborSparseMapsInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, RpcV2CborSparseMapsCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, RpcV2CborSparseMapsCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // RpcV2CborSparseMapsInputOutput + * sparseStructMap: { // SparseStructMap + * "": { // GreetingStruct + * hi: "STRING_VALUE", + * }, + * }, + * sparseNumberMap: { // SparseNumberMap + * "": Number("int"), + * }, + * sparseBooleanMap: { // SparseBooleanMap + * "": true || false, + * }, + * sparseStringMap: { // SparseStringMap + * "": "STRING_VALUE", + * }, + * sparseSetMap: { // SparseSetMap + * "": [ // StringSet + * "STRING_VALUE", + * ], + * }, + * }; + * const command = new RpcV2CborSparseMapsCommand(input); + * const response = await client.send(command); + * // { // RpcV2CborSparseMapsInputOutput + * // sparseStructMap: { // SparseStructMap + * // "": { // GreetingStruct + * // hi: "STRING_VALUE", + * // }, + * // }, + * // sparseNumberMap: { // SparseNumberMap + * // "": Number("int"), + * // }, + * // sparseBooleanMap: { // SparseBooleanMap + * // "": true || false, + * // }, + * // sparseStringMap: { // SparseStringMap + * // "": "STRING_VALUE", + * // }, + * // sparseSetMap: { // SparseSetMap + * // "": [ // StringSet + * // "STRING_VALUE", + * // ], + * // }, + * // }; + * + * ``` + * + * @param RpcV2CborSparseMapsCommandInput - {@link RpcV2CborSparseMapsCommandInput} + * @returns {@link RpcV2CborSparseMapsCommandOutput} + * @see {@link RpcV2CborSparseMapsCommandInput} for command's `input` shape. + * @see {@link RpcV2CborSparseMapsCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link ValidationException} (client fault) + * A standard error for input validation failures. + * This should be thrown by services when a member of the input structure + * falls outside of the modeled or documented constraints. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class RpcV2CborSparseMapsCommand extends $Command + .classBuilder< + RpcV2CborSparseMapsCommandInput, + RpcV2CborSparseMapsCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "RpcV2CborSparseMaps", {}) + .n("RpcV2ProtocolClient", "RpcV2CborSparseMapsCommand") + .f(void 0, void 0) + .sc(RpcV2CborSparseMaps) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: RpcV2CborSparseMapsInputOutput; + output: RpcV2CborSparseMapsInputOutput; + }; + sdk: { + input: RpcV2CborSparseMapsCommandInput; + output: RpcV2CborSparseMapsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts new file mode 100644 index 0000000000000..4b1d01ed30a95 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts @@ -0,0 +1,106 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SimpleScalarStructure } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { SimpleScalarProperties } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandInput extends SimpleScalarStructure {} +/** + * @public + * + * The output of {@link SimpleScalarPropertiesCommand}. + */ +export interface SimpleScalarPropertiesCommandOutput extends SimpleScalarStructure, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, SimpleScalarPropertiesCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, SimpleScalarPropertiesCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // SimpleScalarStructure + * trueBooleanValue: true || false, + * falseBooleanValue: true || false, + * byteValue: 0, // BYTE_VALUE + * doubleValue: Number("double"), + * floatValue: Number("float"), + * integerValue: Number("int"), + * longValue: Number("long"), + * shortValue: Number("short"), + * stringValue: "STRING_VALUE", + * blobValue: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }; + * const command = new SimpleScalarPropertiesCommand(input); + * const response = await client.send(command); + * // { // SimpleScalarStructure + * // trueBooleanValue: true || false, + * // falseBooleanValue: true || false, + * // byteValue: 0, // BYTE_VALUE + * // doubleValue: Number("double"), + * // floatValue: Number("float"), + * // integerValue: Number("int"), + * // longValue: Number("long"), + * // shortValue: Number("short"), + * // stringValue: "STRING_VALUE", + * // blobValue: new Uint8Array(), + * // }; + * + * ``` + * + * @param SimpleScalarPropertiesCommandInput - {@link SimpleScalarPropertiesCommandInput} + * @returns {@link SimpleScalarPropertiesCommandOutput} + * @see {@link SimpleScalarPropertiesCommandInput} for command's `input` shape. + * @see {@link SimpleScalarPropertiesCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class SimpleScalarPropertiesCommand extends $Command + .classBuilder< + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "SimpleScalarProperties", {}) + .n("RpcV2ProtocolClient", "SimpleScalarPropertiesCommand") + .f(void 0, void 0) + .sc(SimpleScalarProperties) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SimpleScalarStructure; + output: SimpleScalarStructure; + }; + sdk: { + input: SimpleScalarPropertiesCommandInput; + output: SimpleScalarPropertiesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts new file mode 100644 index 0000000000000..70e58ba1acd54 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { SparseNullsOperationInputOutput } from "../models/models_0"; +import { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; +import { SparseNullsOperation } from "../schemas/schemas"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link SparseNullsOperationCommand}. + */ +export interface SparseNullsOperationCommandInput extends SparseNullsOperationInputOutput {} +/** + * @public + * + * The output of {@link SparseNullsOperationCommand}. + */ +export interface SparseNullsOperationCommandOutput extends SparseNullsOperationInputOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RpcV2ProtocolClient, SparseNullsOperationCommand } from "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"; // ES Modules import + * // const { RpcV2ProtocolClient, SparseNullsOperationCommand } = require("@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema"); // CommonJS import + * const client = new RpcV2ProtocolClient(config); + * const input = { // SparseNullsOperationInputOutput + * sparseStringList: [ // SparseStringList + * "STRING_VALUE", + * ], + * sparseStringMap: { // SparseStringMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new SparseNullsOperationCommand(input); + * const response = await client.send(command); + * // { // SparseNullsOperationInputOutput + * // sparseStringList: [ // SparseStringList + * // "STRING_VALUE", + * // ], + * // sparseStringMap: { // SparseStringMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param SparseNullsOperationCommandInput - {@link SparseNullsOperationCommandInput} + * @returns {@link SparseNullsOperationCommandOutput} + * @see {@link SparseNullsOperationCommandInput} for command's `input` shape. + * @see {@link SparseNullsOperationCommandOutput} for command's `response` shape. + * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape. + * + * @throws {@link RpcV2ProtocolServiceException} + *

Base exception class for all service exceptions from RpcV2Protocol service.

+ * + * + */ +export class SparseNullsOperationCommand extends $Command + .classBuilder< + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, + RpcV2ProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RpcV2Protocol", "SparseNullsOperation", {}) + .n("RpcV2ProtocolClient", "SparseNullsOperationCommand") + .f(void 0, void 0) + .sc(SparseNullsOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: SparseNullsOperationInputOutput; + output: SparseNullsOperationInputOutput; + }; + sdk: { + input: SparseNullsOperationCommandInput; + output: SparseNullsOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/index.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/index.ts new file mode 100644 index 0000000000000..d9a8bbfef7069 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/commands/index.ts @@ -0,0 +1,14 @@ +// smithy-typescript generated code +export * from "./EmptyInputOutputCommand"; +export * from "./Float16Command"; +export * from "./FractionalSecondsCommand"; +export * from "./GreetingWithErrorsCommand"; +export * from "./NoInputOutputCommand"; +export * from "./OperationWithDefaultsCommand"; +export * from "./OptionalInputOutputCommand"; +export * from "./RecursiveShapesCommand"; +export * from "./RpcV2CborDenseMapsCommand"; +export * from "./RpcV2CborListsCommand"; +export * from "./RpcV2CborSparseMapsCommand"; +export * from "./SimpleScalarPropertiesCommand"; +export * from "./SparseNullsOperationCommand"; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/EndpointParameters.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/EndpointParameters.ts new file mode 100644 index 0000000000000..63349195db780 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/EndpointParameters.ts @@ -0,0 +1,29 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return Object.assign(options, { + defaultSigningName: "", + }); +}; + +export const commonParams = { + endpoint: { type: "builtInParams", name: "endpoint" }, +} as const; + +export interface EndpointParameters extends __EndpointParameters { + endpoint?: string; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/endpointResolver.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/endpointResolver.ts new file mode 100644 index 0000000000000..92254ad194deb --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/endpointResolver.ts @@ -0,0 +1,23 @@ +// smithy-typescript generated code +import { EndpointV2, Logger } from "@smithy/types"; +import { EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +const cache = new EndpointCache({ + size: 50, + params: ["endpoint"], +}); + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return cache.get(endpointParams as EndpointParams, () => + resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }) + ); +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/ruleset.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/ruleset.ts new file mode 100644 index 0000000000000..14416a50b2697 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/endpoint/ruleset.ts @@ -0,0 +1,38 @@ +// smithy-typescript generated code +import { RuleSetObject } from "@smithy/types"; + +export const ruleSet: RuleSetObject = { + version: "1.0", + parameters: { + endpoint: { + type: "string", + builtIn: "SDK::Endpoint", + documentation: "Endpoint used for making requests. Should be formatted as a URI.", + }, + }, + rules: [ + { + conditions: [ + { + fn: "isSet", + argv: [ + { + ref: "endpoint", + }, + ], + }, + ], + endpoint: { + url: { + ref: "endpoint", + }, + }, + type: "endpoint", + }, + { + conditions: [], + error: "(default endpointRuleSet) endpoint is not set - you must configure an endpoint.", + type: "error", + }, + ], +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/extensionConfiguration.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/extensionConfiguration.ts new file mode 100644 index 0000000000000..6a42e6afa8418 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/extensionConfiguration.ts @@ -0,0 +1,13 @@ +// smithy-typescript generated code +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration"; + +/** + * @internal + */ +export interface RpcV2ProtocolExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + HttpAuthExtensionConfiguration {} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/index.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/index.ts new file mode 100644 index 0000000000000..8a7113aa6bd01 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/index.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +/* eslint-disable */ +export * from "./RpcV2ProtocolClient"; +export * from "./RpcV2Protocol"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export type { RuntimeExtension } from "./runtimeExtensions"; +export type { RpcV2ProtocolExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./models"; + +export { RpcV2ProtocolServiceException } from "./models/RpcV2ProtocolServiceException"; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/RpcV2ProtocolServiceException.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/RpcV2ProtocolServiceException.ts new file mode 100644 index 0000000000000..792f7ba0caf44 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/RpcV2ProtocolServiceException.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export type { __ServiceExceptionOptions }; + +export { __ServiceException }; + +/** + * @public + * + * Base exception class for all service exceptions from RpcV2Protocol service. + */ +export class RpcV2ProtocolServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, RpcV2ProtocolServiceException.prototype); + } +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/index.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/index.ts new file mode 100644 index 0000000000000..9eaceb12865f8 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/models_0.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/models_0.ts new file mode 100644 index 0000000000000..698c6204f77f6 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/models/models_0.ts @@ -0,0 +1,359 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +import { RpcV2ProtocolServiceException as __BaseException } from "./RpcV2ProtocolServiceException"; + +/** + * Describes one specific validation failure for an input member. + * @public + */ +export interface ValidationExceptionField { + /** + * A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints. + * @public + */ + path: string | undefined; + + /** + * A detailed description of the validation failure. + * @public + */ + message: string | undefined; +} + +/** + * A standard error for input validation failures. + * This should be thrown by services when a member of the input structure + * falls outside of the modeled or documented constraints. + * @public + */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + * A list of specific failures encountered while validating the input. + * A member can appear in this list more than once if it failed to satisfy multiple constraints. + * @public + */ + fieldList?: ValidationExceptionField[] | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.fieldList = opts.fieldList; + } +} + +/** + * @public + */ +export interface ClientOptionalDefaults { + member?: number | undefined; +} + +/** + * @public + */ +export interface ComplexNestedErrorData { + Foo?: string | undefined; +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name: "ComplexError" = "ComplexError"; + readonly $fault: "client" = "client"; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * @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 | undefined; + defaultBoolean?: boolean | undefined; + defaultList?: string[] | undefined; + defaultTimestamp?: Date | undefined; + defaultBlob?: Uint8Array | undefined; + defaultByte?: number | undefined; + defaultShort?: number | undefined; + defaultInteger?: number | undefined; + defaultLong?: number | undefined; + defaultFloat?: number | undefined; + defaultDouble?: number | undefined; + defaultMap?: Record | undefined; + defaultEnum?: TestEnum | undefined; + defaultIntEnum?: TestIntEnum | undefined; + emptyString?: string | undefined; + falseBoolean?: boolean | undefined; + emptyBlob?: Uint8Array | undefined; + zeroByte?: number | undefined; + zeroShort?: number | undefined; + zeroInteger?: number | undefined; + zeroLong?: number | undefined; + zeroFloat?: number | undefined; + zeroDouble?: number | undefined; +} + +/** + * @public + */ +export interface GreetingStruct { + hi?: string | undefined; +} + +/** + * @public + */ +export interface EmptyStructure {} + +/** + * @public + */ +export interface Float16Output { + value?: number | undefined; +} + +/** + * @public + */ +export interface FractionalSecondsOutput { + datetime?: Date | undefined; +} + +/** + * @public + */ +export interface GreetingWithErrorsOutput { + greeting?: string | undefined; +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name: "InvalidGreeting" = "InvalidGreeting"; + readonly $fault: "client" = "client"; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} + +/** + * @public + */ +export interface OperationWithDefaultsInput { + defaults?: Defaults | undefined; + clientOptionalDefaults?: ClientOptionalDefaults | undefined; + topLevelDefault?: string | undefined; + otherTopLevelDefault?: number | undefined; +} + +/** + * @public + */ +export interface OperationWithDefaultsOutput { + defaultString?: string | undefined; + defaultBoolean?: boolean | undefined; + defaultList?: string[] | undefined; + defaultTimestamp?: Date | undefined; + defaultBlob?: Uint8Array | undefined; + defaultByte?: number | undefined; + defaultShort?: number | undefined; + defaultInteger?: number | undefined; + defaultLong?: number | undefined; + defaultFloat?: number | undefined; + defaultDouble?: number | undefined; + defaultMap?: Record | undefined; + defaultEnum?: TestEnum | undefined; + defaultIntEnum?: TestIntEnum | undefined; + emptyString?: string | undefined; + falseBoolean?: boolean | undefined; + emptyBlob?: Uint8Array | undefined; + zeroByte?: number | undefined; + zeroShort?: number | undefined; + zeroInteger?: number | undefined; + zeroLong?: number | undefined; + zeroFloat?: number | undefined; + zeroDouble?: number | undefined; +} + +/** + * @public + */ +export interface SimpleStructure { + value?: string | undefined; +} + +/** + * @public + */ +export interface RpcV2CborDenseMapsInputOutput { + denseStructMap?: Record | undefined; + denseNumberMap?: Record | undefined; + denseBooleanMap?: Record | undefined; + denseStringMap?: Record | undefined; + denseSetMap?: Record | undefined; +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} + +/** + * @public + */ +export interface StructureListMember { + a?: string | undefined; + b?: string | undefined; +} + +/** + * @public + */ +export interface RpcV2CborListInputOutput { + stringList?: string[] | undefined; + stringSet?: string[] | undefined; + integerList?: number[] | undefined; + booleanList?: boolean[] | undefined; + timestampList?: Date[] | undefined; + enumList?: FooEnum[] | undefined; + intEnumList?: IntegerEnum[] | undefined; + /** + * A list of lists of strings. + * @public + */ + nestedStringList?: string[][] | undefined; + + structureList?: StructureListMember[] | undefined; + blobList?: Uint8Array[] | undefined; +} + +/** + * @public + */ +export interface RpcV2CborSparseMapsInputOutput { + sparseStructMap?: Record | undefined; + sparseNumberMap?: Record | undefined; + sparseBooleanMap?: Record | undefined; + sparseStringMap?: Record | undefined; + sparseSetMap?: Record | undefined; +} + +/** + * @public + */ +export interface SimpleScalarStructure { + trueBooleanValue?: boolean | undefined; + falseBooleanValue?: boolean | undefined; + byteValue?: number | undefined; + doubleValue?: number | undefined; + floatValue?: number | undefined; + integerValue?: number | undefined; + longValue?: number | undefined; + shortValue?: number | undefined; + stringValue?: string | undefined; + blobValue?: Uint8Array | undefined; +} + +/** + * @public + */ +export interface SparseNullsOperationInputOutput { + sparseStringList?: string[] | undefined; + sparseStringMap?: Record | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutputNested1 { + foo?: string | undefined; + nested?: RecursiveShapesInputOutputNested2 | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutputNested2 { + bar?: string | undefined; + recursiveMember?: RecursiveShapesInputOutputNested1 | undefined; +} + +/** + * @public + */ +export interface RecursiveShapesInputOutput { + nested?: RecursiveShapesInputOutputNested1 | undefined; +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/protocols/Rpcv2cbor.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/protocols/Rpcv2cbor.ts new file mode 100644 index 0000000000000..d77f4b991b403 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/protocols/Rpcv2cbor.ts @@ -0,0 +1,1233 @@ +// smithy-typescript generated code +import { + buildHttpRpcRequest, + cbor, + checkCborResponse as cr, + dateToTag as __dateToTag, + loadSmithyRpcV2CborErrorCode, + parseCborBody as parseBody, + parseCborErrorBody as parseErrorBody, +} from "@smithy/core/cbor"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, + expectByte as __expectByte, + expectInt32 as __expectInt32, + expectLong as __expectLong, + expectNonNull as __expectNonNull, + expectShort as __expectShort, + expectString as __expectString, + limitedParseDouble as __limitedParseDouble, + limitedParseFloat32 as __limitedParseFloat32, + parseEpochTimestamp as __parseEpochTimestamp, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + HeaderBag as __HeaderBag, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; + +import { EmptyInputOutputCommandInput, EmptyInputOutputCommandOutput } from "../commands/EmptyInputOutputCommand"; +import { Float16CommandInput, Float16CommandOutput } from "../commands/Float16Command"; +import { FractionalSecondsCommandInput, FractionalSecondsCommandOutput } from "../commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommandInput, GreetingWithErrorsCommandOutput } from "../commands/GreetingWithErrorsCommand"; +import { NoInputOutputCommandInput, NoInputOutputCommandOutput } from "../commands/NoInputOutputCommand"; +import { + OperationWithDefaultsCommandInput, + OperationWithDefaultsCommandOutput, +} from "../commands/OperationWithDefaultsCommand"; +import { + OptionalInputOutputCommandInput, + OptionalInputOutputCommandOutput, +} from "../commands/OptionalInputOutputCommand"; +import { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from "../commands/RecursiveShapesCommand"; +import { RpcV2CborDenseMapsCommandInput, RpcV2CborDenseMapsCommandOutput } from "../commands/RpcV2CborDenseMapsCommand"; +import { RpcV2CborListsCommandInput, RpcV2CborListsCommandOutput } from "../commands/RpcV2CborListsCommand"; +import { + RpcV2CborSparseMapsCommandInput, + RpcV2CborSparseMapsCommandOutput, +} from "../commands/RpcV2CborSparseMapsCommand"; +import { + SimpleScalarPropertiesCommandInput, + SimpleScalarPropertiesCommandOutput, +} from "../commands/SimpleScalarPropertiesCommand"; +import { + SparseNullsOperationCommandInput, + SparseNullsOperationCommandOutput, +} from "../commands/SparseNullsOperationCommand"; +import { + ClientOptionalDefaults, + ComplexError, + Defaults, + EmptyStructure, + Float16Output, + FooEnum, + FractionalSecondsOutput, + GreetingStruct, + IntegerEnum, + InvalidGreeting, + OperationWithDefaultsInput, + OperationWithDefaultsOutput, + RecursiveShapesInputOutput, + RecursiveShapesInputOutputNested1, + RecursiveShapesInputOutputNested2, + RpcV2CborDenseMapsInputOutput, + RpcV2CborListInputOutput, + RpcV2CborSparseMapsInputOutput, + SimpleScalarStructure, + SimpleStructure, + SparseNullsOperationInputOutput, + StructureListMember, + ValidationException, +} from "../models/models_0"; +import { RpcV2ProtocolServiceException as __BaseException } from "../models/RpcV2ProtocolServiceException"; + +/** + * serializeRpcv2cborEmptyInputOutputCommand + */ +export const se_EmptyInputOutputCommand = async ( + input: EmptyInputOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(_json(input)); + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/EmptyInputOutput", undefined, body); +}; + +/** + * serializeRpcv2cborFloat16Command + */ +export const se_Float16Command = async ( + input: Float16CommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { ...SHARED_HEADERS }; + delete headers["content-type"]; + + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/Float16", undefined, undefined); +}; + +/** + * serializeRpcv2cborFractionalSecondsCommand + */ +export const se_FractionalSecondsCommand = async ( + input: FractionalSecondsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { ...SHARED_HEADERS }; + delete headers["content-type"]; + + return buildHttpRpcRequest( + context, + headers, + "/service/RpcV2Protocol/operation/FractionalSeconds", + undefined, + undefined + ); +}; + +/** + * serializeRpcv2cborGreetingWithErrorsCommand + */ +export const se_GreetingWithErrorsCommand = async ( + input: GreetingWithErrorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { ...SHARED_HEADERS }; + delete headers["content-type"]; + + return buildHttpRpcRequest( + context, + headers, + "/service/RpcV2Protocol/operation/GreetingWithErrors", + undefined, + undefined + ); +}; + +/** + * serializeRpcv2cborNoInputOutputCommand + */ +export const se_NoInputOutputCommand = async ( + input: NoInputOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { ...SHARED_HEADERS }; + delete headers["content-type"]; + + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/NoInputOutput", undefined, undefined); +}; + +/** + * serializeRpcv2cborOperationWithDefaultsCommand + */ +export const se_OperationWithDefaultsCommand = async ( + input: OperationWithDefaultsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(se_OperationWithDefaultsInput(input, context)); + return buildHttpRpcRequest( + context, + headers, + "/service/RpcV2Protocol/operation/OperationWithDefaults", + undefined, + body + ); +}; + +/** + * serializeRpcv2cborOptionalInputOutputCommand + */ +export const se_OptionalInputOutputCommand = async ( + input: OptionalInputOutputCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(_json(input)); + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/OptionalInputOutput", undefined, body); +}; + +/** + * serializeRpcv2cborRecursiveShapesCommand + */ +export const se_RecursiveShapesCommand = async ( + input: RecursiveShapesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(se_RecursiveShapesInputOutput(input, context)); + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/RecursiveShapes", undefined, body); +}; + +/** + * serializeRpcv2cborRpcV2CborDenseMapsCommand + */ +export const se_RpcV2CborDenseMapsCommand = async ( + input: RpcV2CborDenseMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(_json(input)); + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/RpcV2CborDenseMaps", undefined, body); +}; + +/** + * serializeRpcv2cborRpcV2CborListsCommand + */ +export const se_RpcV2CborListsCommand = async ( + input: RpcV2CborListsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(se_RpcV2CborListInputOutput(input, context)); + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/RpcV2CborLists", undefined, body); +}; + +/** + * serializeRpcv2cborRpcV2CborSparseMapsCommand + */ +export const se_RpcV2CborSparseMapsCommand = async ( + input: RpcV2CborSparseMapsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(se_RpcV2CborSparseMapsInputOutput(input, context)); + return buildHttpRpcRequest(context, headers, "/service/RpcV2Protocol/operation/RpcV2CborSparseMaps", undefined, body); +}; + +/** + * serializeRpcv2cborSimpleScalarPropertiesCommand + */ +export const se_SimpleScalarPropertiesCommand = async ( + input: SimpleScalarPropertiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(se_SimpleScalarStructure(input, context)); + return buildHttpRpcRequest( + context, + headers, + "/service/RpcV2Protocol/operation/SimpleScalarProperties", + undefined, + body + ); +}; + +/** + * serializeRpcv2cborSparseNullsOperationCommand + */ +export const se_SparseNullsOperationCommand = async ( + input: SparseNullsOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = SHARED_HEADERS; + let body: any; + body = cbor.serialize(se_SparseNullsOperationInputOutput(input, context)); + return buildHttpRpcRequest( + context, + headers, + "/service/RpcV2Protocol/operation/SparseNullsOperation", + undefined, + body + ); +}; + +/** + * deserializeRpcv2cborEmptyInputOutputCommand + */ +export const de_EmptyInputOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: EmptyInputOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborFloat16Command + */ +export const de_Float16Command = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_Float16Output(data, context); + const response: Float16CommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborFractionalSecondsCommand + */ +export const de_FractionalSecondsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FractionalSecondsOutput(data, context); + const response: FractionalSecondsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborGreetingWithErrorsCommand + */ +export const de_GreetingWithErrorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GreetingWithErrorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborNoInputOutputCommand + */ +export const de_NoInputOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + await collectBody(output.body, context); + const response: NoInputOutputCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeRpcv2cborOperationWithDefaultsCommand + */ +export const de_OperationWithDefaultsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OperationWithDefaultsOutput(data, context); + const response: OperationWithDefaultsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborOptionalInputOutputCommand + */ +export const de_OptionalInputOutputCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: OptionalInputOutputCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborRecursiveShapesCommand + */ +export const de_RecursiveShapesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RecursiveShapesInputOutput(data, context); + const response: RecursiveShapesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborRpcV2CborDenseMapsCommand + */ +export const de_RpcV2CborDenseMapsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RpcV2CborDenseMapsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborRpcV2CborListsCommand + */ +export const de_RpcV2CborListsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RpcV2CborListInputOutput(data, context); + const response: RpcV2CborListsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborRpcV2CborSparseMapsCommand + */ +export const de_RpcV2CborSparseMapsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RpcV2CborSparseMapsInputOutput(data, context); + const response: RpcV2CborSparseMapsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborSimpleScalarPropertiesCommand + */ +export const de_SimpleScalarPropertiesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SimpleScalarStructure(data, context); + const response: SimpleScalarPropertiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeRpcv2cborSparseNullsOperationCommand + */ +export const de_SparseNullsOperationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + cr(output); + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SparseNullsOperationInputOutput(data, context); + const response: SparseNullsOperationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Rpcv2cborCommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadSmithyRpcV2CborErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ComplexError": + case "smithy.protocoltests.rpcv2Cbor#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "smithy.protocoltests.rpcv2Cbor#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + case "ValidationException": + case "smithy.framework#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } +}; + +/** + * deserializeRpcv2cborValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeRpcv2cborComplexErrorRes + */ +const de_ComplexErrorRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ComplexError({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeRpcv2cborInvalidGreetingRes + */ +const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new InvalidGreeting({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +// se_ClientOptionalDefaults omitted. + +/** + * serializeRpcv2cborDefaults + */ +const se_Defaults = (input: Defaults, context: __SerdeContext): any => { + return take(input, { + defaultBlob: [], + defaultBoolean: [], + defaultByte: [], + defaultDouble: [], + defaultEnum: [], + defaultFloat: [], + defaultIntEnum: [], + defaultInteger: [], + defaultList: _json, + defaultLong: [], + defaultMap: _json, + defaultShort: [], + defaultString: [], + defaultTimestamp: __dateToTag, + emptyBlob: [], + emptyString: [], + falseBoolean: [], + zeroByte: [], + zeroDouble: [], + zeroFloat: [], + zeroInteger: [], + zeroLong: [], + zeroShort: [], + }); +}; + +// se_DenseBooleanMap omitted. + +// se_DenseNumberMap omitted. + +// se_DenseSetMap omitted. + +// se_DenseStringMap omitted. + +// se_DenseStructMap omitted. + +// se_EmptyStructure omitted. + +/** + * serializeRpcv2cborOperationWithDefaultsInput + */ +const se_OperationWithDefaultsInput = (input: OperationWithDefaultsInput, context: __SerdeContext): any => { + return take(input, { + clientOptionalDefaults: _json, + defaults: (_) => se_Defaults(_, context), + otherTopLevelDefault: [], + topLevelDefault: [], + }); +}; + +/** + * serializeRpcv2cborRecursiveShapesInputOutput + */ +const se_RecursiveShapesInputOutput = (input: RecursiveShapesInputOutput, context: __SerdeContext): any => { + return take(input, { + nested: (_) => se_RecursiveShapesInputOutputNested1(_, context), + }); +}; + +/** + * serializeRpcv2cborRecursiveShapesInputOutputNested1 + */ +const se_RecursiveShapesInputOutputNested1 = ( + input: RecursiveShapesInputOutputNested1, + context: __SerdeContext +): any => { + return take(input, { + foo: [], + nested: (_) => se_RecursiveShapesInputOutputNested2(_, context), + }); +}; + +/** + * serializeRpcv2cborRecursiveShapesInputOutputNested2 + */ +const se_RecursiveShapesInputOutputNested2 = ( + input: RecursiveShapesInputOutputNested2, + context: __SerdeContext +): any => { + return take(input, { + bar: [], + recursiveMember: (_) => se_RecursiveShapesInputOutputNested1(_, context), + }); +}; + +// se_RpcV2CborDenseMapsInputOutput omitted. + +/** + * serializeRpcv2cborRpcV2CborListInputOutput + */ +const se_RpcV2CborListInputOutput = (input: RpcV2CborListInputOutput, context: __SerdeContext): any => { + return take(input, { + blobList: (_) => se_BlobList(_, context), + booleanList: _json, + enumList: _json, + intEnumList: _json, + integerList: _json, + nestedStringList: _json, + stringList: _json, + stringSet: _json, + structureList: _json, + timestampList: (_) => se_TimestampList(_, context), + }); +}; + +/** + * serializeRpcv2cborRpcV2CborSparseMapsInputOutput + */ +const se_RpcV2CborSparseMapsInputOutput = (input: RpcV2CborSparseMapsInputOutput, context: __SerdeContext): any => { + return take(input, { + sparseBooleanMap: (_) => se_SparseBooleanMap(_, context), + sparseNumberMap: (_) => se_SparseNumberMap(_, context), + sparseSetMap: (_) => se_SparseSetMap(_, context), + sparseStringMap: (_) => se_SparseStringMap(_, context), + sparseStructMap: (_) => se_SparseStructMap(_, context), + }); +}; + +/** + * serializeRpcv2cborSimpleScalarStructure + */ +const se_SimpleScalarStructure = (input: SimpleScalarStructure, context: __SerdeContext): any => { + return take(input, { + blobValue: [], + byteValue: [], + doubleValue: [], + falseBooleanValue: [], + floatValue: [], + integerValue: [], + longValue: [], + shortValue: [], + stringValue: [], + trueBooleanValue: [], + }); +}; + +// se_SimpleStructure omitted. + +/** + * serializeRpcv2cborSparseBooleanMap + */ +const se_SparseBooleanMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key] = value; + } else { + acc[key] = null as any; + } + + return acc; + }, {}); +}; + +/** + * serializeRpcv2cborSparseNullsOperationInputOutput + */ +const se_SparseNullsOperationInputOutput = (input: SparseNullsOperationInputOutput, context: __SerdeContext): any => { + return take(input, { + sparseStringList: (_) => se_SparseStringList(_, context), + sparseStringMap: (_) => se_SparseStringMap(_, context), + }); +}; + +/** + * serializeRpcv2cborSparseNumberMap + */ +const se_SparseNumberMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key] = value; + } else { + acc[key] = null as any; + } + + return acc; + }, {}); +}; + +/** + * serializeRpcv2cborSparseSetMap + */ +const se_SparseSetMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key] = _json(value); + } else { + acc[key] = null as any; + } + + return acc; + }, {}); +}; + +/** + * serializeRpcv2cborSparseStructMap + */ +const se_SparseStructMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key] = _json(value); + } else { + acc[key] = null as any; + } + + return acc; + }, {}); +}; + +// se_StructureList omitted. + +// se_StructureListMember omitted. + +// se_TestStringList omitted. + +// se_TestStringMap omitted. + +/** + * serializeRpcv2cborBlobList + */ +const se_BlobList = (input: Uint8Array[], context: __SerdeContext): any => { + return input.filter((e: any) => e != null); +}; + +// se_BooleanList omitted. + +// se_FooEnumList omitted. + +// se_GreetingStruct omitted. + +// se_IntegerEnumList omitted. + +// se_IntegerList omitted. + +// se_NestedStringList omitted. + +/** + * serializeRpcv2cborSparseStringList + */ +const se_SparseStringList = (input: string[], context: __SerdeContext): any => { + return input; +}; + +/** + * serializeRpcv2cborSparseStringMap + */ +const se_SparseStringMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key] = value; + } else { + acc[key] = null as any; + } + + return acc; + }, {}); +}; + +// se_StringList omitted. + +// se_StringSet omitted. + +/** + * serializeRpcv2cborTimestampList + */ +const se_TimestampList = (input: Date[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return __dateToTag(entry); + }); +}; + +// de_ValidationException omitted. + +// de_ValidationExceptionField omitted. + +// de_ValidationExceptionFieldList omitted. + +// de_ComplexError omitted. + +// de_ComplexNestedErrorData omitted. + +// de_DenseBooleanMap omitted. + +// de_DenseNumberMap omitted. + +// de_DenseSetMap omitted. + +// de_DenseStringMap omitted. + +// de_DenseStructMap omitted. + +// de_EmptyStructure omitted. + +/** + * deserializeRpcv2cborFloat16Output + */ +const de_Float16Output = (output: any, context: __SerdeContext): Float16Output => { + return take(output, { + value: __limitedParseDouble, + }) as any; +}; + +/** + * deserializeRpcv2cborFractionalSecondsOutput + */ +const de_FractionalSecondsOutput = (output: any, context: __SerdeContext): FractionalSecondsOutput => { + return take(output, { + datetime: (_: any) => __expectNonNull(__parseEpochTimestamp(_)), + }) as any; +}; + +// de_GreetingWithErrorsOutput omitted. + +// de_InvalidGreeting omitted. + +/** + * deserializeRpcv2cborOperationWithDefaultsOutput + */ +const de_OperationWithDefaultsOutput = (output: any, context: __SerdeContext): OperationWithDefaultsOutput => { + return take(output, { + defaultBlob: [], + defaultBoolean: __expectBoolean, + defaultByte: __expectByte, + defaultDouble: __limitedParseDouble, + defaultEnum: __expectString, + defaultFloat: __limitedParseFloat32, + defaultIntEnum: __expectInt32, + defaultInteger: __expectInt32, + defaultList: _json, + defaultLong: __expectLong, + defaultMap: _json, + defaultShort: __expectShort, + defaultString: __expectString, + defaultTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(_)), + emptyBlob: [], + emptyString: __expectString, + falseBoolean: __expectBoolean, + zeroByte: __expectByte, + zeroDouble: __limitedParseDouble, + zeroFloat: __limitedParseFloat32, + zeroInteger: __expectInt32, + zeroLong: __expectLong, + zeroShort: __expectShort, + }) as any; +}; + +/** + * deserializeRpcv2cborRecursiveShapesInputOutput + */ +const de_RecursiveShapesInputOutput = (output: any, context: __SerdeContext): RecursiveShapesInputOutput => { + return take(output, { + nested: (_: any) => de_RecursiveShapesInputOutputNested1(_, context), + }) as any; +}; + +/** + * deserializeRpcv2cborRecursiveShapesInputOutputNested1 + */ +const de_RecursiveShapesInputOutputNested1 = ( + output: any, + context: __SerdeContext +): RecursiveShapesInputOutputNested1 => { + return take(output, { + foo: __expectString, + nested: (_: any) => de_RecursiveShapesInputOutputNested2(_, context), + }) as any; +}; + +/** + * deserializeRpcv2cborRecursiveShapesInputOutputNested2 + */ +const de_RecursiveShapesInputOutputNested2 = ( + output: any, + context: __SerdeContext +): RecursiveShapesInputOutputNested2 => { + return take(output, { + bar: __expectString, + recursiveMember: (_: any) => de_RecursiveShapesInputOutputNested1(_, context), + }) as any; +}; + +// de_RpcV2CborDenseMapsInputOutput omitted. + +/** + * deserializeRpcv2cborRpcV2CborListInputOutput + */ +const de_RpcV2CborListInputOutput = (output: any, context: __SerdeContext): RpcV2CborListInputOutput => { + return take(output, { + blobList: (_: any) => de_BlobList(_, context), + booleanList: _json, + enumList: _json, + intEnumList: _json, + integerList: _json, + nestedStringList: _json, + stringList: _json, + stringSet: _json, + structureList: _json, + timestampList: (_: any) => de_TimestampList(_, context), + }) as any; +}; + +/** + * deserializeRpcv2cborRpcV2CborSparseMapsInputOutput + */ +const de_RpcV2CborSparseMapsInputOutput = (output: any, context: __SerdeContext): RpcV2CborSparseMapsInputOutput => { + return take(output, { + sparseBooleanMap: (_: any) => de_SparseBooleanMap(_, context), + sparseNumberMap: (_: any) => de_SparseNumberMap(_, context), + sparseSetMap: (_: any) => de_SparseSetMap(_, context), + sparseStringMap: (_: any) => de_SparseStringMap(_, context), + sparseStructMap: (_: any) => de_SparseStructMap(_, context), + }) as any; +}; + +/** + * deserializeRpcv2cborSimpleScalarStructure + */ +const de_SimpleScalarStructure = (output: any, context: __SerdeContext): SimpleScalarStructure => { + return take(output, { + blobValue: [], + byteValue: __expectByte, + doubleValue: __limitedParseDouble, + falseBooleanValue: __expectBoolean, + floatValue: __limitedParseFloat32, + integerValue: __expectInt32, + longValue: __expectLong, + shortValue: __expectShort, + stringValue: __expectString, + trueBooleanValue: __expectBoolean, + }) as any; +}; + +// de_SimpleStructure omitted. + +/** + * deserializeRpcv2cborSparseBooleanMap + */ +const de_SparseBooleanMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key as string] = __expectBoolean(value) as any; + } else { + acc[key as string] = null as any; + } + return acc; + }, {} as Record); +}; + +/** + * deserializeRpcv2cborSparseNullsOperationInputOutput + */ +const de_SparseNullsOperationInputOutput = (output: any, context: __SerdeContext): SparseNullsOperationInputOutput => { + return take(output, { + sparseStringList: (_: any) => de_SparseStringList(_, context), + sparseStringMap: (_: any) => de_SparseStringMap(_, context), + }) as any; +}; + +/** + * deserializeRpcv2cborSparseNumberMap + */ +const de_SparseNumberMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key as string] = __expectInt32(value) as any; + } else { + acc[key as string] = null as any; + } + return acc; + }, {} as Record); +}; + +/** + * deserializeRpcv2cborSparseSetMap + */ +const de_SparseSetMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key as string] = _json(value); + } else { + acc[key as string] = null as any; + } + return acc; + }, {} as Record); +}; + +/** + * deserializeRpcv2cborSparseStructMap + */ +const de_SparseStructMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key as string] = _json(value); + } else { + acc[key as string] = null as any; + } + return acc; + }, {} as Record); +}; + +// de_StructureList omitted. + +// de_StructureListMember omitted. + +// de_TestStringList omitted. + +// de_TestStringMap omitted. + +/** + * deserializeRpcv2cborBlobList + */ +const de_BlobList = (output: any, context: __SerdeContext): Uint8Array[] => { + const collection = (output || []).filter((e: any) => e != null); + return collection; +}; + +// de_BooleanList omitted. + +// de_FooEnumList omitted. + +// de_GreetingStruct omitted. + +// de_IntegerEnumList omitted. + +// de_IntegerList omitted. + +// de_NestedStringList omitted. + +/** + * deserializeRpcv2cborSparseStringList + */ +const de_SparseStringList = (output: any, context: __SerdeContext): string[] => { + const collection = (output || []).map((entry: any) => { + if (entry === null) { + return null as any; + } + return __expectString(entry) as any; + }); + return collection; +}; + +/** + * deserializeRpcv2cborSparseStringMap + */ +const de_SparseStringMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value !== null) { + acc[key as string] = __expectString(value) as any; + } else { + acc[key as string] = null as any; + } + return acc; + }, {} as Record); +}; + +// de_StringList omitted. + +// de_StringSet omitted. + +/** + * deserializeRpcv2cborTimestampList + */ +const de_TimestampList = (output: any, context: __SerdeContext): Date[] => { + const collection = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return __expectNonNull(__parseEpochTimestamp(entry)); + }); + return collection; +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +const throwDefaultError = withBaseException(__BaseException); +const SHARED_HEADERS: __HeaderBag = { + "content-type": "application/cbor", + "smithy-protocol": "rpc-v2-cbor", + accept: "application/cbor", +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.browser.ts new file mode 100644 index 0000000000000..cd010cea5807e --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.browser.ts @@ -0,0 +1,36 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { RpcV2ProtocolClientConfig } from "./RpcV2ProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + }; +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.native.ts new file mode 100644 index 0000000000000..4d13602e29ac0 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { RpcV2ProtocolClientConfig } from "./RpcV2ProtocolClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.shared.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.shared.ts new file mode 100644 index 0000000000000..059f0767556ab --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.shared.ts @@ -0,0 +1,40 @@ +// smithy-typescript generated code +import { NoAuthSigner } from "@smithy/core"; +import { SmithyRpcV2CborProtocol } from "@smithy/core/cbor"; +import { NoOpLogger } from "@smithy/smithy-client"; +import { IdentityProviderConfig } from "@smithy/types"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultRpcV2ProtocolHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { RpcV2ProtocolClientConfig } from "./RpcV2ProtocolClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => { + return { + apiVersion: "2020-07-14", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultRpcV2ProtocolHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc: IdentityProviderConfig) => + ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new NoAuthSigner(), + }, + ], + logger: config?.logger ?? new NoOpLogger(), + protocol: config?.protocol ?? new SmithyRpcV2CborProtocol({ defaultNamespace: "smithy.protocoltests.rpcv2Cbor" }), + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.ts new file mode 100644 index 0000000000000..63dc0dab37a54 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeConfig.ts @@ -0,0 +1,53 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; +import { Hash } from "@smithy/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { RpcV2ProtocolClientConfig } from "./RpcV2ProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger, + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: + config?.retryMode ?? + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig), + }; +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeExtensions.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeExtensions.ts new file mode 100644 index 0000000000000..56bb8c70d8021 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/runtimeExtensions.ts @@ -0,0 +1,40 @@ +// smithy-typescript generated code +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration"; +import { RpcV2ProtocolExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: RpcV2ProtocolExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: RpcV2ProtocolExtensionConfiguration = Object.assign( + getDefaultExtensionConfiguration(runtimeConfig), + getHttpHandlerExtensionConfiguration(runtimeConfig), + getHttpAuthExtensionConfiguration(runtimeConfig) + ); + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return Object.assign( + runtimeConfig, + resolveDefaultRuntimeConfig(extensionConfiguration), + resolveHttpHandlerRuntimeConfig(extensionConfiguration), + resolveHttpAuthRuntimeConfig(extensionConfiguration) + ); +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/schemas/schemas.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/schemas/schemas.ts new file mode 100644 index 0000000000000..d38881b49dce4 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/src/schemas/schemas.ts @@ -0,0 +1,527 @@ +const _B = "Blob"; +const _BL = "BooleanList"; +const _BLl = "BlobList"; +const _Bo = "Boolean"; +const _By = "Byte"; +const _CE = "ComplexError"; +const _CNED = "ComplexNestedErrorData"; +const _COD = "ClientOptionalDefaults"; +const _D = "Double"; +const _DBM = "DenseBooleanMap"; +const _DNM = "DenseNumberMap"; +const _DSM = "DenseStringMap"; +const _DSMe = "DenseSetMap"; +const _DSMen = "DenseStructMap"; +const _DT = "DateTime"; +const _De = "Defaults"; +const _EIO = "EmptyInputOutput"; +const _ES = "EmptyStructure"; +const _F = "Float"; +const _FE = "FooEnum"; +const _FEL = "FooEnumList"; +const _FO = "Float16Output"; +const _FS = "FractionalSeconds"; +const _FSO = "FractionalSecondsOutput"; +const _Fl = "Float16"; +const _Fo = "Foo"; +const _GS = "GreetingStruct"; +const _GWE = "GreetingWithErrors"; +const _GWEO = "GreetingWithErrorsOutput"; +const _I = "Integer"; +const _IE = "IntegerEnum"; +const _IEL = "IntegerEnumList"; +const _IG = "InvalidGreeting"; +const _IL = "IntegerList"; +const _L = "Long"; +const _M = "Message"; +const _N = "Nested"; +const _NIO = "NoInputOutput"; +const _NSL = "NestedStringList"; +const _OIO = "OptionalInputOutput"; +const _OWD = "OperationWithDefaults"; +const _OWDI = "OperationWithDefaultsInput"; +const _OWDO = "OperationWithDefaultsOutput"; +const _RS = "RecursiveShapes"; +const _RSIO = "RecursiveShapesInputOutput"; +const _RSION = "RecursiveShapesInputOutputNested1"; +const _RSIONe = "RecursiveShapesInputOutputNested2"; +const _RVCDM = "RpcV2CborDenseMaps"; +const _RVCDMIO = "RpcV2CborDenseMapsInputOutput"; +const _RVCL = "RpcV2CborLists"; +const _RVCLIO = "RpcV2CborListInputOutput"; +const _RVCSM = "RpcV2CborSparseMaps"; +const _RVCSMIO = "RpcV2CborSparseMapsInputOutput"; +const _S = "String"; +const _SBM = "SparseBooleanMap"; +const _SL = "StringList"; +const _SLM = "StructureListMember"; +const _SLt = "StructureList"; +const _SNM = "SparseNumberMap"; +const _SNO = "SparseNullsOperation"; +const _SNOIO = "SparseNullsOperationInputOutput"; +const _SS = "StringSet"; +const _SSL = "SparseStringList"; +const _SSM = "SparseStringMap"; +const _SSMp = "SparseSetMap"; +const _SSMpa = "SparseStructMap"; +const _SSP = "SimpleScalarProperties"; +const _SSS = "SimpleScalarStructure"; +const _SSi = "SimpleStructure"; +const _Sh = "Short"; +const _T = "Timestamp"; +const _TE = "TestEnum"; +const _TIE = "TestIntEnum"; +const _TL = "TimestampList"; +const _TLo = "TopLevel"; +const _TSL = "TestStringList"; +const _TSM = "TestStringMap"; +const _VE = "ValidationException"; +const _VEF = "ValidationExceptionField"; +const _VEFL = "ValidationExceptionFieldList"; +const _a = "a"; +const _b = "bar"; +const _bL = "booleanList"; +const _bLl = "blobList"; +const _bV = "byteValue"; +const _bVl = "blobValue"; +const _b_ = "b"; +const _c = "client"; +const _cOD = "clientOptionalDefaults"; +const _d = "datetime"; +const _dB = "defaultBoolean"; +const _dBM = "denseBooleanMap"; +const _dBe = "defaultBlob"; +const _dBef = "defaultByte"; +const _dD = "defaultDouble"; +const _dE = "defaultEnum"; +const _dF = "defaultFloat"; +const _dI = "defaultInteger"; +const _dIE = "defaultIntEnum"; +const _dL = "defaultList"; +const _dLe = "defaultLong"; +const _dM = "defaultMap"; +const _dNM = "denseNumberMap"; +const _dS = "defaultString"; +const _dSM = "denseStructMap"; +const _dSMe = "denseStringMap"; +const _dSMen = "denseSetMap"; +const _dSe = "defaultShort"; +const _dT = "defaultTimestamp"; +const _dV = "doubleValue"; +const _de = "defaults"; +const _e = "error"; +const _eB = "emptyBlob"; +const _eL = "enumList"; +const _eS = "emptyString"; +const _f = "foo"; +const _fB = "falseBoolean"; +const _fBV = "falseBooleanValue"; +const _fL = "fieldList"; +const _fV = "floatValue"; +const _g = "greeting"; +const _h = "hi"; +const _iEL = "intEnumList"; +const _iL = "integerList"; +const _iV = "integerValue"; +const _lV = "longValue"; +const _m = "message"; +const _me = "member"; +const _n = "nested"; +const _nSL = "nestedStringList"; +const _oTLD = "otherTopLevelDefault"; +const _p = "path"; +const _rM = "recursiveMember"; +const _s = "sparse"; +const _sBM = "sparseBooleanMap"; +const _sL = "stringList"; +const _sLt = "structureList"; +const _sNM = "sparseNumberMap"; +const _sS = "stringSet"; +const _sSL = "sparseStringList"; +const _sSM = "sparseStructMap"; +const _sSMp = "sparseStringMap"; +const _sSMpa = "sparseSetMap"; +const _sV = "shortValue"; +const _sVt = "stringValue"; +const _tBV = "trueBooleanValue"; +const _tL = "timestampList"; +const _tLD = "topLevelDefault"; +const _v = "value"; +const _zB = "zeroByte"; +const _zD = "zeroDouble"; +const _zF = "zeroFloat"; +const _zI = "zeroInteger"; +const _zL = "zeroLong"; +const _zS = "zeroShort"; +const n0 = "smithy.framework"; +const n1 = "smithy.protocoltests.rpcv2Cbor"; +const n2 = "smithy.protocoltests.shared"; + +// smithy-typescript generated code +import { error, list, map, op, struct } from "@smithy/core/schema"; + +import { + ComplexError as __ComplexError, + InvalidGreeting as __InvalidGreeting, + ValidationException as __ValidationException, +} from "../models/index"; +import { RpcV2ProtocolServiceException as __RpcV2ProtocolServiceException } from "../models/RpcV2ProtocolServiceException"; + +/* eslint no-var: 0 */ + +export var Unit = "unit" as const; + +export var ValidationException = error( + n0, + _VE, + { + [_e]: _c, + }, + [_m, _fL], + [0, () => ValidationExceptionFieldList], + + __ValidationException +); +export var ValidationExceptionField = struct(n0, _VEF, 0, [_p, _m], [0, 0]); +export var ClientOptionalDefaults = struct(n1, _COD, 0, [_me], [1]); +export var ComplexError = error( + n1, + _CE, + { + [_e]: _c, + }, + [_TLo, _N], + [0, () => ComplexNestedErrorData], + + __ComplexError +); +export var ComplexNestedErrorData = struct(n1, _CNED, 0, [_Fo], [0]); +export var Defaults = struct( + n1, + _De, + 0, + [ + _dS, + _dB, + _dL, + _dT, + _dBe, + _dBef, + _dSe, + _dI, + _dLe, + _dF, + _dD, + _dM, + _dE, + _dIE, + _eS, + _fB, + _eB, + _zB, + _zS, + _zI, + _zL, + _zF, + _zD, + ], + [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] +); +export var EmptyStructure = struct(n1, _ES, 0, [], []); +export var Float16Output = struct(n1, _FO, 0, [_v], [1]); +export var FractionalSecondsOutput = struct(n1, _FSO, 0, [_d], [5]); +export var GreetingWithErrorsOutput = struct(n1, _GWEO, 0, [_g], [0]); +export var InvalidGreeting = error( + n1, + _IG, + { + [_e]: _c, + }, + [_M], + [0], + + __InvalidGreeting +); +export var OperationWithDefaultsInput = struct( + n1, + _OWDI, + 0, + [_de, _cOD, _tLD, _oTLD], + [() => Defaults, () => ClientOptionalDefaults, 0, 1] +); +export var OperationWithDefaultsOutput = struct( + n1, + _OWDO, + 0, + [ + _dS, + _dB, + _dL, + _dT, + _dBe, + _dBef, + _dSe, + _dI, + _dLe, + _dF, + _dD, + _dM, + _dE, + _dIE, + _eS, + _fB, + _eB, + _zB, + _zS, + _zI, + _zL, + _zF, + _zD, + ], + [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] +); +export var RecursiveShapesInputOutput = struct(n1, _RSIO, 0, [_n], [() => RecursiveShapesInputOutputNested1]); +export var RecursiveShapesInputOutputNested1 = struct( + n1, + _RSION, + 0, + [_f, _n], + [0, () => RecursiveShapesInputOutputNested2] +); +export var RecursiveShapesInputOutputNested2 = struct( + n1, + _RSIONe, + 0, + [_b, _rM], + [0, () => RecursiveShapesInputOutputNested1] +); +export var RpcV2CborDenseMapsInputOutput = struct( + n1, + _RVCDMIO, + 0, + [_dSM, _dNM, _dBM, _dSMe, _dSMen], + [() => DenseStructMap, 128 | 1, 128 | 2, 128 | 0, map(n1, _DSMe, 0, 0, 64 | 0)] +); +export var RpcV2CborListInputOutput = struct( + n1, + _RVCLIO, + 0, + [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _sLt, _bLl], + [64 | 0, 64 | 0, 64 | 1, 64 | 2, 64 | 4, 64 | 0, 64 | 1, list(n2, _NSL, 0, 64 | 0), () => StructureList, 64 | 21] +); +export var RpcV2CborSparseMapsInputOutput = struct( + n1, + _RVCSMIO, + 0, + [_sSM, _sNM, _sBM, _sSMp, _sSMpa], + [ + [() => SparseStructMap, 0], + [() => SparseNumberMap, 0], + [() => SparseBooleanMap, 0], + [() => SparseStringMap, 0], + [() => SparseSetMap, 0], + ] +); +export var SimpleScalarStructure = struct( + n1, + _SSS, + 0, + [_tBV, _fBV, _bV, _dV, _fV, _iV, _lV, _sV, _sVt, _bVl], + [2, 2, 1, 1, 1, 1, 1, 1, 0, 21] +); +export var SimpleStructure = struct(n1, _SSi, 0, [_v], [0]); +export var SparseNullsOperationInputOutput = struct( + n1, + _SNOIO, + 0, + [_sSL, _sSMp], + [ + [() => SparseStringList, 0], + [() => SparseStringMap, 0], + ] +); +export var StructureListMember = struct(n1, _SLM, 0, [_a, _b_], [0, 0]); +export var GreetingStruct = struct(n2, _GS, 0, [_h], [0]); +export var RpcV2ProtocolServiceException = error( + "smithy.ts.sdk.synthetic.smithy.protocoltests.rpcv2Cbor", + "RpcV2ProtocolServiceException", + 0, + [], + [], + __RpcV2ProtocolServiceException +); +export var ValidationExceptionFieldList = list(n0, _VEFL, 0, () => ValidationExceptionField); +export var StructureList = list(n1, _SLt, 0, () => StructureListMember); +export var TestStringList = 64 | 0; + +export var BlobList = 64 | 21; + +export var BooleanList = 64 | 2; + +export var FooEnumList = 64 | 0; + +export var IntegerEnumList = 64 | 1; + +export var IntegerList = 64 | 1; + +export var NestedStringList = list(n2, _NSL, 0, 64 | 0); +export var SparseStringList = list( + n2, + _SSL, + { + [_s]: 1, + }, + 0 +); +export var StringList = 64 | 0; + +export var StringSet = 64 | 0; + +export var TimestampList = 64 | 4; + +export var DenseBooleanMap = 128 | 2; + +export var DenseNumberMap = 128 | 1; + +export var DenseSetMap = map(n1, _DSMe, 0, 0, 64 | 0); +export var DenseStringMap = 128 | 0; + +export var DenseStructMap = map(n1, _DSMen, 0, 0, () => GreetingStruct); +export var SparseBooleanMap = map( + n1, + _SBM, + { + [_s]: 1, + }, + 0, + 2 +); +export var SparseNumberMap = map( + n1, + _SNM, + { + [_s]: 1, + }, + 0, + 1 +); +export var SparseSetMap = map( + n1, + _SSMp, + { + [_s]: 1, + }, + 0, + 64 | 0 +); +export var SparseStructMap = map( + n1, + _SSMpa, + { + [_s]: 1, + }, + 0, + () => GreetingStruct +); +export var TestStringMap = 128 | 0; + +export var SparseStringMap = map( + n2, + _SSM, + { + [_s]: 1, + }, + 0, + 0 +); +export var EmptyInputOutput = op( + n1, + _EIO, + 0, + () => EmptyStructure, + () => EmptyStructure +); +export var Float16 = op( + n1, + _Fl, + 0, + () => Unit, + () => Float16Output +); +export var FractionalSeconds = op( + n1, + _FS, + 0, + () => Unit, + () => FractionalSecondsOutput +); +export var GreetingWithErrors = op( + n1, + _GWE, + 2, + () => Unit, + () => GreetingWithErrorsOutput +); +export var NoInputOutput = op( + n1, + _NIO, + 0, + () => Unit, + () => Unit +); +export var OperationWithDefaults = op( + n1, + _OWD, + 0, + () => OperationWithDefaultsInput, + () => OperationWithDefaultsOutput +); +export var OptionalInputOutput = op( + n1, + _OIO, + 0, + () => SimpleStructure, + () => SimpleStructure +); +export var RecursiveShapes = op( + n1, + _RS, + 0, + () => RecursiveShapesInputOutput, + () => RecursiveShapesInputOutput +); +export var RpcV2CborDenseMaps = op( + n1, + _RVCDM, + 0, + () => RpcV2CborDenseMapsInputOutput, + () => RpcV2CborDenseMapsInputOutput +); +export var RpcV2CborLists = op( + n1, + _RVCL, + 2, + () => RpcV2CborListInputOutput, + () => RpcV2CborListInputOutput +); +export var RpcV2CborSparseMaps = op( + n1, + _RVCSM, + 0, + () => RpcV2CborSparseMapsInputOutput, + () => RpcV2CborSparseMapsInputOutput +); +export var SimpleScalarProperties = op( + n1, + _SSP, + 0, + () => SimpleScalarStructure, + () => SimpleScalarStructure +); +export var SparseNullsOperation = op( + n1, + _SNO, + 0, + () => SparseNullsOperationInputOutput, + () => SparseNullsOperationInputOutput +); diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/test/functional/rpcv2cbor.spec.ts b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/test/functional/rpcv2cbor.spec.ts new file mode 100644 index 0000000000000..619081d669791 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/test/functional/rpcv2cbor.spec.ts @@ -0,0 +1,3285 @@ +// smithy-typescript generated code +import { cbor } from "@smithy/core/cbor"; +import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; +import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; +import { Readable } from "stream"; +import { expect, test as it } from "vitest"; + +import { EmptyInputOutputCommand } from "../../src/commands/EmptyInputOutputCommand"; +import { Float16Command } from "../../src/commands/Float16Command"; +import { FractionalSecondsCommand } from "../../src/commands/FractionalSecondsCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { NoInputOutputCommand } from "../../src/commands/NoInputOutputCommand"; +import { OperationWithDefaultsCommand } from "../../src/commands/OperationWithDefaultsCommand"; +import { OptionalInputOutputCommand } from "../../src/commands/OptionalInputOutputCommand"; +import { RecursiveShapesCommand } from "../../src/commands/RecursiveShapesCommand"; +import { RpcV2CborDenseMapsCommand } from "../../src/commands/RpcV2CborDenseMapsCommand"; +import { RpcV2CborListsCommand } from "../../src/commands/RpcV2CborListsCommand"; +import { RpcV2CborSparseMapsCommand } from "../../src/commands/RpcV2CborSparseMapsCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { SparseNullsOperationCommand } from "../../src/commands/SparseNullsOperationCommand"; +import { RpcV2ProtocolClient } from "../../src/RpcV2ProtocolClient"; + +/** + * Throws an expected exception that contains the serialized request. + */ +class EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error { + constructor(readonly request: HttpRequest) { + super(); + } +} + +/** + * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a + * request. The thrown exception contains the serialized request. + */ +class RequestSerializationTestHandler implements HttpHandler { + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request)); + } + updateHttpClientConfig(key: never, value: never): void {} + httpHandlerConfigs() { + return {}; + } +} + +/** + * Returns a resolved Promise of the specified response contents. + */ +class ResponseDeserializationTestHandler implements HttpHandler { + isSuccess: boolean; + code: number; + headers: HeaderBag; + body: string | Uint8Array; + isBase64Body: boolean; + + constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) { + this.isSuccess = isSuccess; + this.code = code; + if (headers === undefined) { + this.headers = {}; + } else { + this.headers = headers; + } + if (body === undefined) { + body = ""; + } + this.body = body; + this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), "base64").toString("base64") === body; + } + + handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> { + return Promise.resolve({ + response: new HttpResponse({ + statusCode: this.code, + headers: this.headers, + body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]), + }), + }); + } + + updateHttpClientConfig(key: never, value: never): void {} + + httpHandlerConfigs() { + return {}; + } +} + +interface comparableParts { + [key: string]: string; +} + +/** + * Generates a standard map of un-equal values given input parts. + */ +const compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => { + const unequalParts: any = {}; + Object.keys(expectedParts).forEach((key) => { + if (generatedParts[key] === undefined) { + unequalParts[key] = { exp: expectedParts[key], gen: undefined }; + } else if (!equivalentContents(expectedParts[key], generatedParts[key])) { + unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] }; + } + }); + + Object.keys(generatedParts).forEach((key) => { + if (expectedParts[key] === undefined) { + unequalParts[key] = { exp: undefined, gen: generatedParts[key] }; + } + }); + + if (Object.keys(unequalParts).length !== 0) { + return unequalParts; + } + return undefined; +}; + +/** + * Compares all types for equivalent contents, doing nested + * equality checks based on non-`$metadata` + * properties that have defined values. + */ +const equivalentContents = (expected: any, generated: any): boolean => { + if (typeof (global as any).expect === "function") { + expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected)); + return true; + } + + const localExpected = expected; + + // Short circuit on equality. + if (localExpected == generated) { + return true; + } + + if (typeof expected !== "object") { + return expected === generated; + } + + // If a test fails with an issue in the below 6 lines, it's likely + // due to an issue in the nestedness or existence of the property + // being compared. + delete localExpected["$metadata"]; + delete generated["$metadata"]; + Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]); + Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]); + + const expectedProperties = Object.getOwnPropertyNames(localExpected); + const generatedProperties = Object.getOwnPropertyNames(generated); + + // Short circuit on different property counts. + if (expectedProperties.length != generatedProperties.length) { + return false; + } + + // Compare properties directly. + for (let index = 0; index < expectedProperties.length; index++) { + const propertyName = expectedProperties[index]; + if (!equivalentContents(localExpected[propertyName], generated[propertyName])) { + return false; + } + } + + return true; +}; + +const clientParams = { + region: "us-west-2", + credentials: { accessKeyId: "key", secretAccessKey: "secret" }, + endpoint: () => { + const url = new URL("https://localhost/"); + return Promise.resolve({ + hostname: url.hostname, + protocol: url.protocol, + path: url.pathname, + }) as Promise; + }, +}; + +/** + * A wrapper function that shadows `fail` from jest-jasmine2 + * (jasmine2 was replaced with circus in > v27 as the default test runner) + */ +const fail = (error?: any): never => { + throw new Error(error); +}; + +/** + * Hexadecimal to byteArray. + */ +const toBytes = (hex: string) => { + return Buffer.from(hex, "base64"); +}; + +function normalizeByteArrayType(data: any) { + // normalize float32 errors + if (typeof data === "number") { + const u = new Uint8Array(4); + const dv = new DataView(u.buffer, u.byteOffset, u.byteLength); + dv.setFloat32(0, data); + return dv.getFloat32(0); + } + if (!data || typeof data !== "object") { + return data; + } + if (data instanceof Uint8Array) { + return Uint8Array.from(data); + } + if (data instanceof String || data instanceof Boolean || data instanceof Number) { + return data.valueOf(); + } + const output = {} as any; + for (const key of Object.getOwnPropertyNames(data)) { + output[key] = normalizeByteArrayType(data[key]); + } + return output; +} + +/** + * When Input structure is empty we write CBOR equivalent of {} + */ +it("empty_input:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new EmptyInputOutputCommand({} 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("/service/RpcV2Protocol/operation/EmptyInputOutput"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect( + r.headers["x-amz-target"], + `Header key "x-amz-target" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v/8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * When output structure is empty we write CBOR equivalent of {} + */ +it("empty_output:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v/8=` + ), + }); + + const params: any = {}; + const command = new EmptyInputOutputCommand(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); +}); + +/** + * When output structure is empty the client should accept an empty body + */ +it("empty_output_no_body:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `` + ), + }); + + const params: any = {}; + const command = new EmptyInputOutputCommand(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); +}); + +/** + * Ensures that clients can correctly parse float16 +Inf. + */ +it("RpcV2CborFloat16Inf:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWV2YWx1Zfl8AA==` + ), + }); + + const params: any = {}; + const command = new Float16Command(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: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse float16 -Inf. + */ +it("RpcV2CborFloat16NegInf:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWV2YWx1Zfn8AA==` + ), + }); + + const params: any = {}; + const command = new Float16Command(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: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse float16 NaN with high LSB. + */ +it("RpcV2CborFloat16LSBNaN:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWV2YWx1Zfl8AQ==` + ), + }); + + const params: any = {}; + const command = new Float16Command(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: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse float16 NaN with high MSB. + */ +it("RpcV2CborFloat16MSBNaN:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWV2YWx1Zfl+AA==` + ), + }); + + const params: any = {}; + const command = new Float16Command(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: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse a subnormal float16. + */ +it("RpcV2CborFloat16Subnormal:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWV2YWx1ZfkAUA==` + ), + }); + + const params: any = {}; + const command = new Float16Command(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: 4.76837158203125e-6, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensures that clients can correctly parse timestamps with fractional seconds + */ +it("RpcV2CborDateTimeWithFractionalSeconds:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2hkYXRldGltZcH7Qcw32zgPvnf/` + ), + }); + + const params: any = {}; + const command = new FractionalSecondsCommand(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 = [ + { + datetime: new Date(9.46845296123e8 * 1000), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Parses simple RpcV2 Cbor errors + */ +it("RpcV2CborInvalidGreetingError:Error:GreetingWithErrors", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2ZfX3R5cGV4LnNtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNJbnZhbGlkR3JlZXRpbmdnTWVzc2FnZWJIaf8=` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "InvalidGreeting") { + console.log(err); + fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + message: "Hi", + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Parses a complex error with no message member + */ +it("RpcV2CborComplexError:Error:GreetingWithErrors", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3JoVG9wTGV2ZWxpVG9wIGxldmVsZk5lc3RlZL9jRm9vY2Jhcv//` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + const paramsToValidate: any = [ + { + TopLevel: "Top level", + Nested: { + Foo: "bar", + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +it("RpcV2CborEmptyComplexError:Error:GreetingWithErrors", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + false, + 400, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3L/` + ), + }); + + const params: any = {}; + const command = new GreetingWithErrorsCommand(params); + + try { + await client.send(command); + } catch (err) { + if (err.name !== "ComplexError") { + console.log(err); + fail(`Expected a ComplexError to be thrown, got ${err.name} instead`); + return; + } + const r: any = err; + expect(r["$metadata"].httpStatusCode).toBe(400); + return; + } + fail("Expected an exception to be thrown from response"); +}); + +/** + * Body is empty and no Content-Type header if no input + */ +it("no_input:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new NoInputOutputCommand({}); + 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("/service/RpcV2Protocol/operation/NoInputOutput"); + + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["x-amz-target"], + `Header key "x-amz-target" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + +/** + * A `Content-Type` header should not be set if the response body is empty. + */ +it("no_output:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + }, + `` + ), + }); + + const params: any = {}; + const command = new NoInputOutputCommand(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); +}); + +/** + * Clients should accept a CBOR empty struct if there is no output. + */ +it("NoOutputClientAllowsEmptyCbor:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v/8=` + ), + }); + + const params: any = {}; + const command = new NoInputOutputCommand(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); +}); + +/** + * Clients should accept an empty body if there is no output and + * should not raise an error if the `Content-Type` header is set. + */ +it("NoOutputClientAllowsEmptyBody:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `` + ), + }); + + const params: any = {}; + const command = new NoInputOutputCommand(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); +}); + +/** + * Client populates default values in input. + */ +it.skip("RpcV2CborClientPopulatesDefaultValuesInInput:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + defaults: {} 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("/service/RpcV2Protocol/operation/OperationWithDefaults"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2hkZWZhdWx0c79tZGVmYXVsdFN0cmluZ2JoaW5kZWZhdWx0Qm9vbGVhbvVrZGVmYXVsdExpc3Sf/3BkZWZhdWx0VGltZXN0YW1wwQBrZGVmYXVsdEJsb2JDYWJja2RlZmF1bHRCeXRlAWxkZWZhdWx0U2hvcnQBbmRlZmF1bHRJbnRlZ2VyCmtkZWZhdWx0TG9uZxhkbGRlZmF1bHRGbG9hdPo/gAAAbWRlZmF1bHREb3VibGX6P4AAAGpkZWZhdWx0TWFwv/9rZGVmYXVsdEVudW1jRk9PbmRlZmF1bHRJbnRFbnVtAWtlbXB0eVN0cmluZ2BsZmFsc2VCb29sZWFu9GllbXB0eUJsb2JAaHplcm9CeXRlAGl6ZXJvU2hvcnQAa3plcm9JbnRlZ2VyAGh6ZXJvTG9uZwBpemVyb0Zsb2F0+gAAAABqemVyb0RvdWJsZfoAAAAA//8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client skips top level default values in input. + */ +it.skip("RpcV2CborClientSkipsTopLevelDefaultValuesInInput:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({} 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("/service/RpcV2Protocol/operation/OperationWithDefaults"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v/8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client uses explicitly provided member values over defaults + */ +it.skip("RpcV2CborClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + defaults: { + defaultString: "bye", + defaultBoolean: true, + defaultList: ["a"], + 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 { + 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("/service/RpcV2Protocol/operation/OperationWithDefaults"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2hkZWZhdWx0c7dtZGVmYXVsdFN0cmluZ2NieWVuZGVmYXVsdEJvb2xlYW71a2RlZmF1bHRMaXN0gWFhcGRlZmF1bHRUaW1lc3RhbXDB+z/wAAAAAAAAa2RlZmF1bHRCbG9iQmhpa2RlZmF1bHRCeXRlAmxkZWZhdWx0U2hvcnQCbmRlZmF1bHRJbnRlZ2VyFGtkZWZhdWx0TG9uZxjIbGRlZmF1bHRGbG9hdPpAAAAAbWRlZmF1bHREb3VibGX7QAAAAAAAAABqZGVmYXVsdE1hcKFkbmFtZWRKYWNra2RlZmF1bHRFbnVtY0JBUm5kZWZhdWx0SW50RW51bQJrZW1wdHlTdHJpbmdjZm9vbGZhbHNlQm9vbGVhbvVpZW1wdHlCbG9iQmhpaHplcm9CeXRlAWl6ZXJvU2hvcnQBa3plcm9JbnRlZ2VyAWh6ZXJvTG9uZwFpemVyb0Zsb2F0+j+AAABqemVyb0RvdWJsZfs/8AAAAAAAAP8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * 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.skip("RpcV2CborClientUsesExplicitlyProvidedValuesInTopLevel:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + topLevelDefault: "hi", + otherTopLevelDefault: 0, + } 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("/service/RpcV2Protocol/operation/OperationWithDefaults"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v290b3BMZXZlbERlZmF1bHRiaGl0b3RoZXJUb3BMZXZlbERlZmF1bHQA/w==`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored. + */ +it.skip("RpcV2CborClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OperationWithDefaultsCommand({ + clientOptionalDefaults: {} 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("/service/RpcV2Protocol/operation/OperationWithDefaults"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v3ZjbGllbnRPcHRpb25hbERlZmF1bHRzoP8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Client populates default values when missing in response. + */ +it.skip("RpcV2CborClientPopulatesDefaultsValuesWhenMissingInResponse:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v/8=` + ), + }); + + const params: any = {}; + const command = new OperationWithDefaultsCommand(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 = [ + { + defaultString: "hi", + defaultBoolean: true, + defaultList: [], + 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) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Client ignores default values if member values are present in the response. + */ +it.skip("RpcV2CborClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v21kZWZhdWx0U3RyaW5nY2J5ZW5kZWZhdWx0Qm9vbGVhbvRrZGVmYXVsdExpc3SBYWFwZGVmYXVsdFRpbWVzdGFtcMH7QAAAAAAAAABrZGVmYXVsdEJsb2JCaGlrZGVmYXVsdEJ5dGUCbGRlZmF1bHRTaG9ydAJuZGVmYXVsdEludGVnZXIUa2RlZmF1bHRMb25nGMhsZGVmYXVsdEZsb2F0+kAAAABtZGVmYXVsdERvdWJsZftAAAAAAAAAAGpkZWZhdWx0TWFwoWRuYW1lZEphY2trZGVmYXVsdEVudW1jQkFSbmRlZmF1bHRJbnRFbnVtAmtlbXB0eVN0cmluZ2Nmb29sZmFsc2VCb29sZWFu9WllbXB0eUJsb2JCaGloemVyb0J5dGUBaXplcm9TaG9ydAFremVyb0ludGVnZXIBaHplcm9Mb25nAWl6ZXJvRmxvYXT6P4AAAGp6ZXJvRG91Ymxl+z/wAAAAAAAA/w==` + ), + }); + + const params: any = {}; + const command = new OperationWithDefaultsCommand(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 = [ + { + defaultString: "bye", + defaultBoolean: false, + defaultList: ["a"], + defaultTimestamp: new Date(2 * 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) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * When input is empty we write CBOR equivalent of {} + */ +it("optional_input:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new OptionalInputOutputCommand({} 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("/service/RpcV2Protocol/operation/OptionalInputOutput"); + + expect( + r.headers["x-amz-target"], + `Header key "x-amz-target" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v/8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * When output is empty we write CBOR equivalent of {} + */ +it("optional_output:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v/8=` + ), + }); + + const params: any = {}; + const command = new OptionalInputOutputCommand(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); +}); + +/** + * Serializes recursive structures + */ +it("RpcV2CborRecursiveShapes:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RecursiveShapesCommand({ + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + } 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("/service/RpcV2Protocol/operation/RecursiveShapes"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes recursive structures + */ +it("RpcV2CborRecursiveShapes:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=` + ), + }); + + const params: any = {}; + const command = new RecursiveShapesCommand(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 = [ + { + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + }, + }, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes recursive structures encoded using a map with definite length + */ +it("RpcV2CborRecursiveShapesUsingDefiniteLength:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWZuZXN0ZWSiY2Zvb2RGb28xZm5lc3RlZKJjYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyomNmb29kRm9vMmZuZXN0ZWShY2JhcmRCYXIy` + ), + }); + + const params: any = {}; + const command = new RecursiveShapesCommand(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 = [ + { + nested: { + foo: "Foo1", + nested: { + bar: "Bar1", + recursiveMember: { + foo: "Foo2", + nested: { + bar: "Bar2", + }, + }, + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes maps + */ +it("RpcV2CborMaps:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborDenseMapsCommand({ + denseStructMap: { + foo: { + hi: "there", + } as any, + baz: { + hi: "bye", + } 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("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RpcV2CborSerializesZeroValuesInMaps:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborDenseMapsCommand({ + denseNumberMap: { + x: 0, + } as any, + denseBooleanMap: { + x: false, + } 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("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * A request that contains a dense map of sets. + */ +it("RpcV2CborSerializesDenseSetMap:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborDenseMapsCommand({ + denseSetMap: { + x: [], + y: ["a", "b"], + } 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("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `oWtkZW5zZVNldE1hcKJheIBheYJhYWFi`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes maps + */ +it("RpcV2CborMaps:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==` + ), + }); + + const params: any = {}; + const command = new RpcV2CborDenseMapsCommand(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 = [ + { + denseStructMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RpcV2CborDeserializesZeroValuesInMaps:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==` + ), + }); + + const params: any = {}; + const command = new RpcV2CborDenseMapsCommand(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 = [ + { + denseNumberMap: { + x: 0, + }, + denseBooleanMap: { + x: false, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * A response that contains a dense map of sets + */ +it("RpcV2CborDeserializesDenseSetMap:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWtkZW5zZVNldE1hcKJheIBheYJhYWFi` + ), + }); + + const params: any = {}; + const command = new RpcV2CborDenseMapsCommand(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 = [ + { + denseSetMap: { + x: [], + y: ["a", "b"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Clients SHOULD tolerate seeing a null value in a dense map, and they SHOULD + * drop the null key-value pair. + */ +it.skip("RpcV2CborDeserializesDenseSetMapAndSkipsNull:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWtkZW5zZVNldE1hcKNheIBheYJhYWFiYXr2` + ), + }); + + const params: any = {}; + const command = new RpcV2CborDenseMapsCommand(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 = [ + { + denseSetMap: { + x: [], + y: ["a", "b"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes RpcV2 Cbor lists + */ +it("RpcV2CborLists:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborListsCommand({ + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238000), new Date(1398796238000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + structureList: [ + { + a: "1", + b: "2", + } as any, + { + a: "3", + b: "4", + } as any, + ], + blobList: [Uint8Array.from("foo", (c) => c.charCodeAt(0)), Uint8Array.from("bar", (c) => c.charCodeAt(0))], + } 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("/service/RpcV2Protocol/operation/RpcV2CborLists"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2pzdHJpbmdMaXN0gmNmb29jYmFyaXN0cmluZ1NldIJjZm9vY2JhcmtpbnRlZ2VyTGlzdIIBAmtib29sZWFuTGlzdIL19G10aW1lc3RhbXBMaXN0gsH7QdTX+/OAAADB+0HU1/vzgAAAaGVudW1MaXN0gmNGb29hMGtpbnRFbnVtTGlzdIIBAnBuZXN0ZWRTdHJpbmdMaXN0goJjZm9vY2JhcoJjYmF6Y3F1eG1zdHJ1Y3R1cmVMaXN0gqJhYWExYWJhMqJhYWEzYWJhNGhibG9iTGlzdIJDZm9vQ2Jhcv8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes empty JSON lists + */ +it("RpcV2CborListsEmpty:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborListsCommand({ + stringList: [], + } 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("/service/RpcV2Protocol/operation/RpcV2CborLists"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2pzdHJpbmdMaXN0n///`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes empty JSON definite length lists + */ +it("RpcV2CborListsEmptyUsingDefiniteLength:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborListsCommand({ + stringList: [], + } 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("/service/RpcV2Protocol/operation/RpcV2CborLists"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `oWpzdHJpbmdMaXN0gA==`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes RpcV2 Cbor lists + */ +it("RpcV2CborLists:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2pzdHJpbmdMaXN0n2Nmb29jYmFy/2lzdHJpbmdTZXSfY2Zvb2NiYXL/a2ludGVnZXJMaXN0nwEC/2tib29sZWFuTGlzdJ/19P9tdGltZXN0YW1wTGlzdJ/B+0HU1/vzgAAAwftB1Nf784AAAP9oZW51bUxpc3SfY0Zvb2Ew/2tpbnRFbnVtTGlzdJ8BAv9wbmVzdGVkU3RyaW5nTGlzdJ+fY2Zvb2NiYXL/n2NiYXpjcXV4//9tc3RydWN0dXJlTGlzdJ+/YWFhMWFiYTL/v2FhYTNhYmE0//9oYmxvYkxpc3SfQ2Zvb0NiYXL//w==` + ), + }); + + const params: any = {}; + const command = new RpcV2CborListsCommand(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 = [ + { + stringList: ["foo", "bar"], + stringSet: ["foo", "bar"], + integerList: [1, 2], + booleanList: [true, false], + timestampList: [new Date(1398796238 * 1000), new Date(1398796238 * 1000)], + enumList: ["Foo", "0"], + intEnumList: [1, 2], + nestedStringList: [ + ["foo", "bar"], + ["baz", "qux"], + ], + structureList: [ + { + a: "1", + b: "2", + }, + { + a: "3", + b: "4", + }, + ], + blobList: [Uint8Array.from("foo", (c) => c.charCodeAt(0)), Uint8Array.from("bar", (c) => c.charCodeAt(0))], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes empty RpcV2 Cbor lists + */ +it("RpcV2CborListsEmpty:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2pzdHJpbmdMaXN0n///` + ), + }); + + const params: any = {}; + const command = new RpcV2CborListsCommand(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 = [ + { + stringList: [], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Can deserialize indefinite length text strings inside an indefinite length list + */ +it("RpcV2CborIndefiniteStringInsideIndefiniteListCanDeserialize:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2pzdHJpbmdMaXN0n394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n//8=` + ), + }); + + const params: any = {}; + const command = new RpcV2CborListsCommand(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 = [ + { + stringList: [ + "An example indefinite string, which will be chunked, on each comma", + "Another example indefinite string with only one chunk", + "This is a plain string", + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Can deserialize indefinite length text strings inside a definite length list + */ +it("RpcV2CborIndefiniteStringInsideDefiniteListCanDeserialize:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `oWpzdHJpbmdMaXN0g394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n` + ), + }); + + const params: any = {}; + const command = new RpcV2CborListsCommand(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 = [ + { + stringList: [ + "An example indefinite string, which will be chunked, on each comma", + "Another example indefinite string with only one chunk", + "This is a plain string", + ], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes sparse maps + */ +it("RpcV2CborSparseMaps:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborSparseMapsCommand({ + sparseStructMap: { + foo: { + hi: "there", + } as any, + baz: { + hi: "bye", + } 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("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes null map values in sparse maps + */ +it("RpcV2CborSerializesNullMapValues:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborSparseMapsCommand({ + sparseBooleanMap: { + x: null, + } as any, + sparseNumberMap: { + x: null, + } as any, + sparseStringMap: { + x: null, + } as any, + sparseStructMap: { + x: null, + } 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("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * A request that contains a sparse map of sets + */ +it("RpcV2CborSerializesSparseSetMap:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborSparseMapsCommand({ + sparseSetMap: { + x: [], + y: ["a", "b"], + } 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("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL///8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * A request that contains a sparse map of sets. + */ +it("RpcV2CborSerializesSparseSetMapAndRetainsNull:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborSparseMapsCommand({ + sparseSetMap: { + x: [], + y: ["a", "b"], + z: null, + } 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("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RpcV2CborSerializesZeroValuesInSparseMaps:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new RpcV2CborSparseMapsCommand({ + sparseNumberMap: { + x: 0, + } as any, + sparseBooleanMap: { + x: false, + } 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("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes sparse maps + */ +it("RpcV2CborSparseJsonMaps:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////` + ), + }); + + const params: any = {}; + const command = new RpcV2CborSparseMapsCommand(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 = [ + { + sparseStructMap: { + foo: { + hi: "there", + }, + baz: { + hi: "bye", + }, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes null map values + */ +it("RpcV2CborDeserializesNullMapValues:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//` + ), + }); + + const params: any = {}; + const command = new RpcV2CborSparseMapsCommand(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 = [ + { + sparseBooleanMap: { + x: null, + }, + sparseNumberMap: { + x: null, + }, + sparseStringMap: { + x: null, + }, + sparseStructMap: { + x: null, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * A response that contains a sparse map of sets + */ +it("RpcV2CborDeserializesSparseSetMap:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2xzcGFyc2VTZXRNYXC/YXmfYWFhYv9heJ////8=` + ), + }); + + const params: any = {}; + const command = new RpcV2CborSparseMapsCommand(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 = [ + { + sparseSetMap: { + x: [], + y: ["a", "b"], + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * A response that contains a sparse map of sets with a null + */ +it("RpcV2CborDeserializesSparseSetMapAndRetainsNull:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=` + ), + }); + + const params: any = {}; + const command = new RpcV2CborSparseMapsCommand(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 = [ + { + sparseSetMap: { + x: [], + y: ["a", "b"], + z: null, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Ensure that 0 and false are sent over the wire in all maps and lists + */ +it("RpcV2CborDeserializesZeroValuesInSparseMaps:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//` + ), + }); + + const params: any = {}; + const command = new RpcV2CborSparseMapsCommand(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 = [ + { + sparseNumberMap: { + x: 0, + }, + sparseBooleanMap: { + x: false, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes simple scalar properties + */ +it("RpcV2CborSimpleScalarProperties:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + byteValue: 5, + doubleValue: 1.889, + falseBooleanValue: false, + floatValue: 7.625, + integerValue: 256, + longValue: 9873, + shortValue: 9898, + stringValue: "simple", + trueBooleanValue: true, + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + } 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("/service/RpcV2Protocol/operation/SimpleScalarProperties"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * RpcV2 Cbor should not serialize null structure values + */ +it("RpcV2CborClientDoesntSerializeNullStructureValues:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + stringValue: null, + } 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("/service/RpcV2Protocol/operation/SimpleScalarProperties"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v/8=`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling NaN float values. + */ +it("RpcV2CborSupportsNaNFloatInputs:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + doubleValue: NaN, + floatValue: NaN, + } 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("/service/RpcV2Protocol/operation/SimpleScalarProperties"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("RpcV2CborSupportsInfinityFloatInputs:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + doubleValue: Infinity, + floatValue: Infinity, + } 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("/service/RpcV2Protocol/operation/SimpleScalarProperties"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Supports handling Infinity float values. + */ +it("RpcV2CborSupportsNegativeInfinityFloatInputs:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SimpleScalarPropertiesCommand({ + doubleValue: -Infinity, + floatValue: -Infinity, + } 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("/service/RpcV2Protocol/operation/SimpleScalarProperties"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes simple scalar properties + */ +it("RpcV2CborSimpleScalarProperties:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v3B0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb2//` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 5, + doubleValue: 1.889, + floatValue: 7.625, + integerValue: 256, + shortValue: 9898, + stringValue: "simple", + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes simple scalar properties encoded using a map with definite length + */ +it("RpcV2CborSimpleScalarPropertiesUsingDefiniteLength:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `qXB0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb28=` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + trueBooleanValue: true, + falseBooleanValue: false, + byteValue: 5, + doubleValue: 1.889, + floatValue: 7.625, + integerValue: 256, + shortValue: 9898, + stringValue: "simple", + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * RpcV2 Cbor should not deserialize null structure values + */ +it("RpcV2CborClientDoesntDeserializeNullStructureValues:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2tzdHJpbmdWYWx1Zfb/` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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); +}); + +/** + * Supports handling NaN float values. + */ +it("RpcV2CborSupportsNaNFloatOutputs:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + doubleValue: NaN, + floatValue: NaN, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Infinity float values. + */ +it("RpcV2CborSupportsInfinityFloatOutputs:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + doubleValue: Infinity, + floatValue: Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports handling Negative Infinity float values. + */ +it("RpcV2CborSupportsNegativeInfinityFloatOutputs:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + doubleValue: -Infinity, + floatValue: -Infinity, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Supports upcasting from a smaller byte representation of the same data type. + */ +it("RpcV2CborSupportsUpcastingDataOnDeserialize:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2tkb3VibGVWYWx1Zfk+AGpmbG9hdFZhbHVl+UegbGludGVnZXJWYWx1ZRg4aWxvbmdWYWx1ZRkBAGpzaG9ydFZhbHVlCv8=` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + doubleValue: 1.5, + floatValue: 7.625, + integerValue: 56, + longValue: 256, + shortValue: 10, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * The client should skip over additional fields that are not part of the structure. This allows a + * client generated against an older Smithy model to be able to communicate with a server that is + * generated against a newer Smithy model. + */ +it("RpcV2CborExtraFieldsInTheBodyShouldBeSkippedByClients:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABrZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==` + ), + }); + + const params: any = {}; + const command = new SimpleScalarPropertiesCommand(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 = [ + { + byteValue: 5, + doubleValue: 1.889, + falseBooleanValue: false, + floatValue: 7.625, + integerValue: 256, + longValue: 9873, + shortValue: 9898, + stringValue: "simple", + trueBooleanValue: true, + blobValue: Uint8Array.from("foo", (c) => c.charCodeAt(0)), + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Serializes null values in maps + */ +it("RpcV2CborSparseMapsSerializeNullValues:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseNullsOperationCommand({ + sparseStringMap: { + foo: null, + } 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("/service/RpcV2Protocol/operation/SparseNullsOperation"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Serializes null values in lists + */ +it("RpcV2CborSparseListsSerializeNull:Request", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new SparseNullsOperationCommand({ + sparseStringList: [null], + } 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("/service/RpcV2Protocol/operation/SparseNullsOperation"); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); + + expect(r.headers["accept"]).toBe("application/cbor"); + expect(r.headers["content-type"]).toBe("application/cbor"); + expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); + + expect(r.body, `Body was undefined.`).toBeDefined(); + const bodyString = `v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==`; + const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); + expect(unequalParts).toBeUndefined(); + } +}); + +/** + * Deserializes null values in maps + */ +it("RpcV2CborSparseMapsDeserializeNullValues:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==` + ), + }); + + const params: any = {}; + const command = new SparseNullsOperationCommand(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 = [ + { + sparseStringMap: { + foo: null, + }, + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +/** + * Deserializes null values in lists + */ +it("RpcV2CborSparseListsDeserializeNull:Response", async () => { + const client = new RpcV2ProtocolClient({ + ...clientParams, + requestHandler: new ResponseDeserializationTestHandler( + true, + 200, + { + "smithy-protocol": "rpc-v2-cbor", + "content-type": "application/cbor", + }, + `v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==` + ), + }); + + const params: any = {}; + const command = new SparseNullsOperationCommand(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 = [ + { + sparseStringList: [null], + }, + ][0]; + Object.keys(paramsToValidate).forEach((param) => { + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); + expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); + }); +}); + +const compareEquivalentCborBodies = (expectedBody: string, generatedBody: string | Uint8Array): undefined => { + expect( + normalizeByteArrayType(cbor.deserialize(typeof generatedBody === "string" ? toBytes(generatedBody) : generatedBody)) + ).toEqual(normalizeByteArrayType(cbor.deserialize(toBytes(expectedBody)))); + return undefined; +}; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.cjs.json b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.cjs.json new file mode 100644 index 0000000000000..9224176da7f72 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.es.json b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.es.json new file mode 100644 index 0000000000000..5a76fb6593463 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.es.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "ESNext", + "moduleResolution": "bundler", + "outDir": "dist-es", + "noCheck": true + } +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.json b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.json new file mode 100644 index 0000000000000..956bed461a6ce --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.types.json b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.types.json new file mode 100644 index 0000000000000..b9a5eb7844868 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/tsconfig.types.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true, + "noCheck": false + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor-schema/vite.config.js b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/vite.config.js new file mode 100644 index 0000000000000..e7147d3ac9e1d --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor-schema/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/vitest.config.protocols-schema.integ.ts b/vitest.config.protocols-schema.integ.ts new file mode 100644 index 0000000000000..ae1a2587b5535 --- /dev/null +++ b/vitest.config.protocols-schema.integ.ts @@ -0,0 +1,10 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + exclude: ["**/*/node_modules/**/*.spec.ts", "**/*.{integ,e2e,browser}.spec.ts"], + include: ["private/**-schema/**/*.spec.ts"], + environment: "node", + globals: true, + }, +}); diff --git a/yarn.lock b/yarn.lock index a68bc74470443..67e018e81a651 100644 --- a/yarn.lock +++ b/yarn.lock @@ -235,6 +235,62 @@ __metadata: languageName: unknown linkType: soft +"@aws-sdk/aws-protocoltests-ec2-schema@workspace:private/aws-protocoltests-ec2-schema": + version: 0.0.0-use.local + resolution: "@aws-sdk/aws-protocoltests-ec2-schema@workspace:private/aws-protocoltests-ec2-schema" + dependencies: + "@aws-crypto/sha256-browser": "npm:5.2.0" + "@aws-crypto/sha256-js": "npm:5.2.0" + "@aws-sdk/core": "npm:*" + "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/middleware-host-header": "npm:*" + "@aws-sdk/middleware-logger": "npm:*" + "@aws-sdk/middleware-recursion-detection": "npm:*" + "@aws-sdk/middleware-user-agent": "npm:*" + "@aws-sdk/region-config-resolver": "npm:*" + "@aws-sdk/types": "npm:*" + "@aws-sdk/util-endpoints": "npm:*" + "@aws-sdk/util-user-agent-browser": "npm:*" + "@aws-sdk/util-user-agent-node": "npm:*" + "@smithy/config-resolver": "npm:^4.1.4" + "@smithy/core": "npm:^3.5.2" + "@smithy/fetch-http-handler": "npm:^5.0.4" + "@smithy/hash-node": "npm:^4.0.4" + "@smithy/invalid-dependency": "npm:^4.0.4" + "@smithy/middleware-compression": "npm:^4.1.10" + "@smithy/middleware-content-length": "npm:^4.0.4" + "@smithy/middleware-endpoint": "npm:^4.1.10" + "@smithy/middleware-retry": "npm:^4.1.11" + "@smithy/middleware-serde": "npm:^4.0.8" + "@smithy/middleware-stack": "npm:^4.0.4" + "@smithy/node-config-provider": "npm:^4.1.3" + "@smithy/node-http-handler": "npm:^4.0.6" + "@smithy/protocol-http": "npm:^5.1.2" + "@smithy/smithy-client": "npm:^4.4.2" + "@smithy/types": "npm:^4.3.1" + "@smithy/url-parser": "npm:^4.0.4" + "@smithy/util-base64": "npm:^4.0.0" + "@smithy/util-body-length-browser": "npm:^4.0.0" + "@smithy/util-body-length-node": "npm:^4.0.0" + "@smithy/util-defaults-mode-browser": "npm:^4.0.18" + "@smithy/util-defaults-mode-node": "npm:^4.0.18" + "@smithy/util-endpoints": "npm:^3.0.6" + "@smithy/util-middleware": "npm:^4.0.4" + "@smithy/util-retry": "npm:^4.0.5" + "@smithy/util-utf8": "npm:^4.0.0" + "@tsconfig/node18": "npm:18.2.4" + "@types/node": "npm:^18.19.69" + "@types/uuid": "npm:^9.0.1" + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + typescript: "npm:~5.8.3" + uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" + languageName: unknown + linkType: soft + "@aws-sdk/aws-protocoltests-ec2@workspace:private/aws-protocoltests-ec2": version: 0.0.0-use.local resolution: "@aws-sdk/aws-protocoltests-ec2@workspace:private/aws-protocoltests-ec2" @@ -291,6 +347,62 @@ __metadata: languageName: unknown linkType: soft +"@aws-sdk/aws-protocoltests-json-10-schema@workspace:private/aws-protocoltests-json-10-schema": + version: 0.0.0-use.local + resolution: "@aws-sdk/aws-protocoltests-json-10-schema@workspace:private/aws-protocoltests-json-10-schema" + dependencies: + "@aws-crypto/sha256-browser": "npm:5.2.0" + "@aws-crypto/sha256-js": "npm:5.2.0" + "@aws-sdk/core": "npm:*" + "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/middleware-host-header": "npm:*" + "@aws-sdk/middleware-logger": "npm:*" + "@aws-sdk/middleware-recursion-detection": "npm:*" + "@aws-sdk/middleware-user-agent": "npm:*" + "@aws-sdk/region-config-resolver": "npm:*" + "@aws-sdk/types": "npm:*" + "@aws-sdk/util-endpoints": "npm:*" + "@aws-sdk/util-user-agent-browser": "npm:*" + "@aws-sdk/util-user-agent-node": "npm:*" + "@smithy/config-resolver": "npm:^4.1.4" + "@smithy/core": "npm:^3.5.2" + "@smithy/fetch-http-handler": "npm:^5.0.4" + "@smithy/hash-node": "npm:^4.0.4" + "@smithy/invalid-dependency": "npm:^4.0.4" + "@smithy/middleware-compression": "npm:^4.1.10" + "@smithy/middleware-content-length": "npm:^4.0.4" + "@smithy/middleware-endpoint": "npm:^4.1.10" + "@smithy/middleware-retry": "npm:^4.1.11" + "@smithy/middleware-serde": "npm:^4.0.8" + "@smithy/middleware-stack": "npm:^4.0.4" + "@smithy/node-config-provider": "npm:^4.1.3" + "@smithy/node-http-handler": "npm:^4.0.6" + "@smithy/protocol-http": "npm:^5.1.2" + "@smithy/smithy-client": "npm:^4.4.2" + "@smithy/types": "npm:^4.3.1" + "@smithy/url-parser": "npm:^4.0.4" + "@smithy/util-base64": "npm:^4.0.0" + "@smithy/util-body-length-browser": "npm:^4.0.0" + "@smithy/util-body-length-node": "npm:^4.0.0" + "@smithy/util-defaults-mode-browser": "npm:^4.0.18" + "@smithy/util-defaults-mode-node": "npm:^4.0.18" + "@smithy/util-endpoints": "npm:^3.0.6" + "@smithy/util-middleware": "npm:^4.0.4" + "@smithy/util-retry": "npm:^4.0.5" + "@smithy/util-utf8": "npm:^4.0.0" + "@tsconfig/node18": "npm:18.2.4" + "@types/node": "npm:^18.19.69" + "@types/uuid": "npm:^9.0.1" + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + typescript: "npm:~5.8.3" + uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" + languageName: unknown + linkType: soft + "@aws-sdk/aws-protocoltests-json-10@workspace:private/aws-protocoltests-json-10": version: 0.0.0-use.local resolution: "@aws-sdk/aws-protocoltests-json-10@workspace:private/aws-protocoltests-json-10" @@ -403,6 +515,62 @@ __metadata: languageName: unknown linkType: soft +"@aws-sdk/aws-protocoltests-json-schema@workspace:private/aws-protocoltests-json-schema": + version: 0.0.0-use.local + resolution: "@aws-sdk/aws-protocoltests-json-schema@workspace:private/aws-protocoltests-json-schema" + dependencies: + "@aws-crypto/sha256-browser": "npm:5.2.0" + "@aws-crypto/sha256-js": "npm:5.2.0" + "@aws-sdk/core": "npm:*" + "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/middleware-host-header": "npm:*" + "@aws-sdk/middleware-logger": "npm:*" + "@aws-sdk/middleware-recursion-detection": "npm:*" + "@aws-sdk/middleware-user-agent": "npm:*" + "@aws-sdk/region-config-resolver": "npm:*" + "@aws-sdk/types": "npm:*" + "@aws-sdk/util-endpoints": "npm:*" + "@aws-sdk/util-user-agent-browser": "npm:*" + "@aws-sdk/util-user-agent-node": "npm:*" + "@smithy/config-resolver": "npm:^4.1.4" + "@smithy/core": "npm:^3.5.2" + "@smithy/fetch-http-handler": "npm:^5.0.4" + "@smithy/hash-node": "npm:^4.0.4" + "@smithy/invalid-dependency": "npm:^4.0.4" + "@smithy/middleware-compression": "npm:^4.1.10" + "@smithy/middleware-content-length": "npm:^4.0.4" + "@smithy/middleware-endpoint": "npm:^4.1.10" + "@smithy/middleware-retry": "npm:^4.1.11" + "@smithy/middleware-serde": "npm:^4.0.8" + "@smithy/middleware-stack": "npm:^4.0.4" + "@smithy/node-config-provider": "npm:^4.1.3" + "@smithy/node-http-handler": "npm:^4.0.6" + "@smithy/protocol-http": "npm:^5.1.2" + "@smithy/smithy-client": "npm:^4.4.2" + "@smithy/types": "npm:^4.3.1" + "@smithy/url-parser": "npm:^4.0.4" + "@smithy/util-base64": "npm:^4.0.0" + "@smithy/util-body-length-browser": "npm:^4.0.0" + "@smithy/util-body-length-node": "npm:^4.0.0" + "@smithy/util-defaults-mode-browser": "npm:^4.0.18" + "@smithy/util-defaults-mode-node": "npm:^4.0.18" + "@smithy/util-endpoints": "npm:^3.0.6" + "@smithy/util-middleware": "npm:^4.0.4" + "@smithy/util-retry": "npm:^4.0.5" + "@smithy/util-utf8": "npm:^4.0.0" + "@tsconfig/node18": "npm:18.2.4" + "@types/node": "npm:^18.19.69" + "@types/uuid": "npm:^9.0.1" + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + typescript: "npm:~5.8.3" + uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" + languageName: unknown + linkType: soft + "@aws-sdk/aws-protocoltests-json@npm:*, @aws-sdk/aws-protocoltests-json@workspace:private/aws-protocoltests-json": version: 0.0.0-use.local resolution: "@aws-sdk/aws-protocoltests-json@workspace:private/aws-protocoltests-json" @@ -459,6 +627,62 @@ __metadata: languageName: unknown linkType: soft +"@aws-sdk/aws-protocoltests-query-schema@workspace:private/aws-protocoltests-query-schema": + version: 0.0.0-use.local + resolution: "@aws-sdk/aws-protocoltests-query-schema@workspace:private/aws-protocoltests-query-schema" + dependencies: + "@aws-crypto/sha256-browser": "npm:5.2.0" + "@aws-crypto/sha256-js": "npm:5.2.0" + "@aws-sdk/core": "npm:*" + "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/middleware-host-header": "npm:*" + "@aws-sdk/middleware-logger": "npm:*" + "@aws-sdk/middleware-recursion-detection": "npm:*" + "@aws-sdk/middleware-user-agent": "npm:*" + "@aws-sdk/region-config-resolver": "npm:*" + "@aws-sdk/types": "npm:*" + "@aws-sdk/util-endpoints": "npm:*" + "@aws-sdk/util-user-agent-browser": "npm:*" + "@aws-sdk/util-user-agent-node": "npm:*" + "@smithy/config-resolver": "npm:^4.1.4" + "@smithy/core": "npm:^3.5.2" + "@smithy/fetch-http-handler": "npm:^5.0.4" + "@smithy/hash-node": "npm:^4.0.4" + "@smithy/invalid-dependency": "npm:^4.0.4" + "@smithy/middleware-compression": "npm:^4.1.10" + "@smithy/middleware-content-length": "npm:^4.0.4" + "@smithy/middleware-endpoint": "npm:^4.1.10" + "@smithy/middleware-retry": "npm:^4.1.11" + "@smithy/middleware-serde": "npm:^4.0.8" + "@smithy/middleware-stack": "npm:^4.0.4" + "@smithy/node-config-provider": "npm:^4.1.3" + "@smithy/node-http-handler": "npm:^4.0.6" + "@smithy/protocol-http": "npm:^5.1.2" + "@smithy/smithy-client": "npm:^4.4.2" + "@smithy/types": "npm:^4.3.1" + "@smithy/url-parser": "npm:^4.0.4" + "@smithy/util-base64": "npm:^4.0.0" + "@smithy/util-body-length-browser": "npm:^4.0.0" + "@smithy/util-body-length-node": "npm:^4.0.0" + "@smithy/util-defaults-mode-browser": "npm:^4.0.18" + "@smithy/util-defaults-mode-node": "npm:^4.0.18" + "@smithy/util-endpoints": "npm:^3.0.6" + "@smithy/util-middleware": "npm:^4.0.4" + "@smithy/util-retry": "npm:^4.0.5" + "@smithy/util-utf8": "npm:^4.0.0" + "@tsconfig/node18": "npm:18.2.4" + "@types/node": "npm:^18.19.69" + "@types/uuid": "npm:^9.0.1" + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + typescript: "npm:~5.8.3" + uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" + languageName: unknown + linkType: soft + "@aws-sdk/aws-protocoltests-query@workspace:private/aws-protocoltests-query": version: 0.0.0-use.local resolution: "@aws-sdk/aws-protocoltests-query@workspace:private/aws-protocoltests-query" @@ -629,6 +853,68 @@ __metadata: languageName: unknown linkType: soft +"@aws-sdk/aws-protocoltests-restjson-schema@workspace:private/aws-protocoltests-restjson-schema": + version: 0.0.0-use.local + resolution: "@aws-sdk/aws-protocoltests-restjson-schema@workspace:private/aws-protocoltests-restjson-schema" + dependencies: + "@aws-crypto/sha256-browser": "npm:5.2.0" + "@aws-crypto/sha256-js": "npm:5.2.0" + "@aws-sdk/core": "npm:*" + "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/middleware-host-header": "npm:*" + "@aws-sdk/middleware-logger": "npm:*" + "@aws-sdk/middleware-recursion-detection": "npm:*" + "@aws-sdk/middleware-user-agent": "npm:*" + "@aws-sdk/region-config-resolver": "npm:*" + "@aws-sdk/types": "npm:*" + "@aws-sdk/util-endpoints": "npm:*" + "@aws-sdk/util-user-agent-browser": "npm:*" + "@aws-sdk/util-user-agent-node": "npm:*" + "@smithy/config-resolver": "npm:^4.1.4" + "@smithy/core": "npm:^3.5.2" + "@smithy/fetch-http-handler": "npm:^5.0.4" + "@smithy/hash-blob-browser": "npm:^4.0.4" + "@smithy/hash-node": "npm:^4.0.4" + "@smithy/hash-stream-node": "npm:^4.0.4" + "@smithy/invalid-dependency": "npm:^4.0.4" + "@smithy/md5-js": "npm:^4.0.4" + "@smithy/middleware-apply-body-checksum": "npm:^4.1.2" + "@smithy/middleware-compression": "npm:^4.1.10" + "@smithy/middleware-content-length": "npm:^4.0.4" + "@smithy/middleware-endpoint": "npm:^4.1.10" + "@smithy/middleware-retry": "npm:^4.1.11" + "@smithy/middleware-serde": "npm:^4.0.8" + "@smithy/middleware-stack": "npm:^4.0.4" + "@smithy/node-config-provider": "npm:^4.1.3" + "@smithy/node-http-handler": "npm:^4.0.6" + "@smithy/protocol-http": "npm:^5.1.2" + "@smithy/querystring-builder": "npm:^4.0.4" + "@smithy/smithy-client": "npm:^4.4.2" + "@smithy/types": "npm:^4.3.1" + "@smithy/url-parser": "npm:^4.0.4" + "@smithy/util-base64": "npm:^4.0.0" + "@smithy/util-body-length-browser": "npm:^4.0.0" + "@smithy/util-body-length-node": "npm:^4.0.0" + "@smithy/util-defaults-mode-browser": "npm:^4.0.18" + "@smithy/util-defaults-mode-node": "npm:^4.0.18" + "@smithy/util-endpoints": "npm:^3.0.6" + "@smithy/util-middleware": "npm:^4.0.4" + "@smithy/util-retry": "npm:^4.0.5" + "@smithy/util-stream": "npm:^4.2.2" + "@smithy/util-utf8": "npm:^4.0.0" + "@tsconfig/node18": "npm:18.2.4" + "@types/node": "npm:^18.19.69" + "@types/uuid": "npm:^9.0.1" + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + typescript: "npm:~5.8.3" + uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" + languageName: unknown + linkType: soft + "@aws-sdk/aws-protocoltests-restjson@workspace:private/aws-protocoltests-restjson": version: 0.0.0-use.local resolution: "@aws-sdk/aws-protocoltests-restjson@workspace:private/aws-protocoltests-restjson" @@ -691,6 +977,67 @@ __metadata: languageName: unknown linkType: soft +"@aws-sdk/aws-protocoltests-restxml-schema@workspace:private/aws-protocoltests-restxml-schema": + version: 0.0.0-use.local + resolution: "@aws-sdk/aws-protocoltests-restxml-schema@workspace:private/aws-protocoltests-restxml-schema" + dependencies: + "@aws-crypto/sha256-browser": "npm:5.2.0" + "@aws-crypto/sha256-js": "npm:5.2.0" + "@aws-sdk/core": "npm:*" + "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/middleware-host-header": "npm:*" + "@aws-sdk/middleware-logger": "npm:*" + "@aws-sdk/middleware-recursion-detection": "npm:*" + "@aws-sdk/middleware-user-agent": "npm:*" + "@aws-sdk/region-config-resolver": "npm:*" + "@aws-sdk/types": "npm:*" + "@aws-sdk/util-endpoints": "npm:*" + "@aws-sdk/util-user-agent-browser": "npm:*" + "@aws-sdk/util-user-agent-node": "npm:*" + "@aws-sdk/xml-builder": "npm:*" + "@smithy/config-resolver": "npm:^4.1.4" + "@smithy/core": "npm:^3.5.2" + "@smithy/fetch-http-handler": "npm:^5.0.4" + "@smithy/hash-node": "npm:^4.0.4" + "@smithy/invalid-dependency": "npm:^4.0.4" + "@smithy/middleware-compression": "npm:^4.1.10" + "@smithy/middleware-content-length": "npm:^4.0.4" + "@smithy/middleware-endpoint": "npm:^4.1.10" + "@smithy/middleware-retry": "npm:^4.1.11" + "@smithy/middleware-serde": "npm:^4.0.8" + "@smithy/middleware-stack": "npm:^4.0.4" + "@smithy/node-config-provider": "npm:^4.1.3" + "@smithy/node-http-handler": "npm:^4.0.6" + "@smithy/protocol-http": "npm:^5.1.2" + "@smithy/querystring-builder": "npm:^4.0.4" + "@smithy/smithy-client": "npm:^4.4.2" + "@smithy/types": "npm:^4.3.1" + "@smithy/url-parser": "npm:^4.0.4" + "@smithy/util-base64": "npm:^4.0.0" + "@smithy/util-body-length-browser": "npm:^4.0.0" + "@smithy/util-body-length-node": "npm:^4.0.0" + "@smithy/util-defaults-mode-browser": "npm:^4.0.18" + "@smithy/util-defaults-mode-node": "npm:^4.0.18" + "@smithy/util-endpoints": "npm:^3.0.6" + "@smithy/util-middleware": "npm:^4.0.4" + "@smithy/util-retry": "npm:^4.0.5" + "@smithy/util-stream": "npm:^4.2.2" + "@smithy/util-utf8": "npm:^4.0.0" + "@tsconfig/node18": "npm:18.2.4" + "@types/node": "npm:^18.19.69" + "@types/uuid": "npm:^9.0.1" + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + entities: "npm:2.2.0" + fast-xml-parser: "npm:4.4.1" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + typescript: "npm:~5.8.3" + uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" + languageName: unknown + linkType: soft + "@aws-sdk/aws-protocoltests-restxml@workspace:private/aws-protocoltests-restxml": version: 0.0.0-use.local resolution: "@aws-sdk/aws-protocoltests-restxml@workspace:private/aws-protocoltests-restxml" @@ -752,6 +1099,55 @@ __metadata: languageName: unknown linkType: soft +"@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema@workspace:private/aws-protocoltests-smithy-rpcv2-cbor-schema": + version: 0.0.0-use.local + resolution: "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor-schema@workspace:private/aws-protocoltests-smithy-rpcv2-cbor-schema" + dependencies: + "@aws-crypto/sha256-browser": "npm:5.2.0" + "@aws-crypto/sha256-js": "npm:5.2.0" + "@aws-sdk/middleware-host-header": "npm:*" + "@aws-sdk/middleware-logger": "npm:*" + "@aws-sdk/middleware-recursion-detection": "npm:*" + "@aws-sdk/middleware-user-agent": "npm:*" + "@aws-sdk/types": "npm:*" + "@aws-sdk/util-user-agent-browser": "npm:*" + "@aws-sdk/util-user-agent-node": "npm:*" + "@smithy/config-resolver": "npm:^4.1.4" + "@smithy/core": "npm:^3.5.2" + "@smithy/fetch-http-handler": "npm:^5.0.4" + "@smithy/hash-node": "npm:^4.0.4" + "@smithy/invalid-dependency": "npm:^4.0.4" + "@smithy/middleware-content-length": "npm:^4.0.4" + "@smithy/middleware-endpoint": "npm:^4.1.10" + "@smithy/middleware-retry": "npm:^4.1.11" + "@smithy/middleware-serde": "npm:^4.0.8" + "@smithy/middleware-stack": "npm:^4.0.4" + "@smithy/node-config-provider": "npm:^4.1.3" + "@smithy/node-http-handler": "npm:^4.0.6" + "@smithy/protocol-http": "npm:^5.1.2" + "@smithy/smithy-client": "npm:^4.4.2" + "@smithy/types": "npm:^4.3.1" + "@smithy/url-parser": "npm:^4.0.4" + "@smithy/util-base64": "npm:^4.0.0" + "@smithy/util-body-length-browser": "npm:^4.0.0" + "@smithy/util-body-length-node": "npm:^4.0.0" + "@smithy/util-defaults-mode-browser": "npm:^4.0.18" + "@smithy/util-defaults-mode-node": "npm:^4.0.18" + "@smithy/util-endpoints": "npm:^3.0.6" + "@smithy/util-middleware": "npm:^4.0.4" + "@smithy/util-retry": "npm:^4.0.5" + "@smithy/util-utf8": "npm:^4.0.0" + "@tsconfig/node18": "npm:18.2.4" + "@types/node": "npm:^18.19.69" + concurrently: "npm:7.0.0" + downlevel-dts: "npm:0.10.1" + rimraf: "npm:3.0.2" + tslib: "npm:^2.6.2" + typescript: "npm:~5.8.3" + vitest: "npm:2.1.8" + languageName: unknown + linkType: soft + "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor@workspace:private/aws-protocoltests-smithy-rpcv2-cbor": version: 0.0.0-use.local resolution: "@aws-sdk/aws-protocoltests-smithy-rpcv2-cbor@workspace:private/aws-protocoltests-smithy-rpcv2-cbor"