diff --git a/codegen/CHANGELOG.md b/codegen/CHANGELOG.md index 01069a266bb9a..c7a4f7fbebe12 100644 --- a/codegen/CHANGELOG.md +++ b/codegen/CHANGELOG.md @@ -1,25 +1,35 @@ # Smithy AWS Typescript Codegen Changelog +## 0.38.0 (2025-11-20) + +- Upgraded to smithy-typescript 0.37.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0380-2025-11-20)) +- Includes upgrade of smithy to 1.64.0 + ## 0.37.0 (2025-11-04) ### Features -- Upgraded to smithy-typescript 0.37.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0361-2025-11-04)) + +- Upgraded to smithy-typescript 0.37.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0370-2025-11-04)) - Upgraded smithy version to 1.63.0 ([#7474](https://github.com/aws/aws-sdk-js-v3/pull/7474)) ### Bug Fixes + - Applied reserved word escaping to union shape in Json serializer ([#7419](https://github.com/aws/aws-sdk-js-v3/pull/7419)) ## 0.36.1 (2025-10-06) ### Features + - Upgraded to smithy-typescript 0.36.1 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0361-2025-10-06)) ### Chores + - Removed usage of deprecated APIs ([#7395](https://github.com/aws/aws-sdk-js-v3/pull/7395)) ## 0.36.0 (2025-09-30) ### Features + - Upgraded to smithy-typescript 0.36.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0360-2025-09-30)) - Upgraded smithy version to 1.62.0 ([#7386](https://github.com/aws/aws-sdk-js-v3/pull/7386)) - Used DOMParser for browser XML parsing ([#7347](https://github.com/aws/aws-sdk-js-v3/pull/7347)) @@ -28,28 +38,33 @@ ## 0.35.0 (2025-09-18) ### Features + - Upgraded to smithy-typescript 0.35.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0350-2025-09-18)) ## 0.34.1 (2025-09-10) ### Features + - Upgraded to smithy-typescript 0.34.1 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0341-2025-09-10)) ## 0.34.0 (2025-07-30) ### Features + - Upgraded to smithy-typescript 0.34.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0340-2025-07-30)) - Upgraded smithy version to 1.61.0 ([#7233](https://github.com/aws/aws-sdk-js-v3/pull/7233)) ## 0.33.0 (2025-07-10) ### Features + - Upgraded to smithy-typescript 0.33.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0330-2025-07-10)) - Upgraded smithy version to 1.60.3 ([#7170](https://github.com/aws/aws-sdk-js-v3/pull/7170)) - Updated codegen to get token from environment variable ([#7166](https://github.com/aws/aws-sdk-js-v3/pull/7166)) - Updated codegen to use Websocket in browser runtime for Bedrock Runtime ([#7175](https://github.com/aws/aws-sdk-js-v3/pull/7175)) ### Bug Fixes + - Used model service instead of iterating services ([#7184](https://github.com/aws/aws-sdk-js-v3/pull/7184)) - Generated default endpoint provider for default regional AWS endpoints ([#7190](https://github.com/aws/aws-sdk-js-v3/pull/7190)) @@ -58,17 +73,21 @@ ## 0.32.0 (2025-06-26) ## Features + - Upgraded to smithy-typescript 0.32.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0320-2025-06-26)) ## Bug Fixes + - Added default AWS regional endpoints for generated AWS clients ([#7151](https://github.com/aws/aws-sdk-js-v3/pull/7151)) ## 0.31.1 (2025-06-23) ## Features + - Upgraded to smithy-typescript 0.31.1 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0311-2025-06-23)) ## Bug Fixes + - Updated codegen for endpoint configuration, event streams, and error classification ([#7143](https://github.com/aws/aws-sdk-js-v3/pull/7143)) - Fixed awsQueryCompat error structure for backwards compatibility ([#7133](https://github.com/aws/aws-sdk-js-v3/pull/7133)) - Allowed explicit undefined in EndpointParameters ([#7131](https://github.com/aws/aws-sdk-js-v3/pull/7131)) @@ -76,53 +95,64 @@ ## 0.31.0 (2025-06-09) ## Features + - Upgraded to smithy 1.58.0 and smithy-typescript 0.31.0. ## Bug Fixes + - Fixed fallback behavior for SigV4A to SigV4 ([#7113](https://github.com/aws/aws-sdk-js-v3/pull/7113)) ## 0.30.0 (2025-05-08) ## Features + - Upgraded to smithy 1.57.1 and smithy-typescript 0.30.0. ## Bug Fixes + - Allowed the `AwsSmithyRpcV2Cbor` generator to take priority over the base `SmithyRpcV2Cbor` generator. The -AWS extension enables AwsQueryCompatibility handling. ([#7058](https://github.com/aws/aws-sdk-js-v3/pull/7058)) + AWS extension enables AwsQueryCompatibility handling. ([#7058](https://github.com/aws/aws-sdk-js-v3/pull/7058)) ## 0.29.1 (2025-04-24) ## Features + - Upgraded to smithy-typescript 0.29.1 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0291-2025-04-24)) ## Bug Fixes + - Removed host prefix behaviour for S3 and S3Control ([#7025](https://github.com/aws/aws-sdk-js-v3/pull/7025)) ## 0.29.0 (2025-04-11) ## Features + - Upgraded to smithy-typescript 0.29.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0290-2025-04-11)) - Upgraded to smithy 1.55.0 ([#7005](https://github.com/aws/aws-sdk-js-v3/pull/7005)) ## 0.28.0 (2025-04-01) ## Features + - Upgraded to smithy-typescript 0.28.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0280-2025-04-01)) - Enforced singular config object for resolver stack ([#6969](https://github.com/aws/aws-sdk-js-v3/pull/6969)) ## 0.27.0 (2025-03-04) ## Features + - Upgraded to smithy-typescript 0.27.0 ([Release Notes](https://github.com/smithy-lang/smithy-typescript/blob/main/CHANGELOG.md#0270-2025-03-04)) - Upgraded to smithy 1.54.0 ([#6913](https://github.com/aws/aws-sdk-js-v3/pull/6913)) - Upgraded to smithy 1.53.0 ([#6906](https://github.com/aws/aws-sdk-js-v3/pull/6906)) ### Bug Fixes + - Fixed union member serialization in JSON ([#6892](https://github.com/aws/aws-sdk-js-v3/pull/6892)) ## 0.26.0 (2025-01-22) ### Features + - Upgraded to 0.26.0 of smithy-typescript ([Release Notes](https://github.com/kuhe/smithy-typescript/blob/main/CHANGELOG.md#0260-2025-01-22)) - Enabled profile configuration for clients ([#6728](https://github.com/aws/aws-sdk-js-v3/pull/6728)) - Created nested clients for internal use ([#6791](https://github.com/aws/aws-sdk-js-v3/pull/6791)) @@ -130,6 +160,7 @@ AWS extension enables AwsQueryCompatibility handling. ([#7058](https://github.co ## 0.25.0 (2024-11-18) ### Features + - Upgraded to 1.51.0 of Smithy ([Release Notes](https://github.com/smithy-lang/smithy/blob/main/CHANGELOG.md#1520-2024-10-16)) - Upgraded to 0.25.0 of smithy-typescript ([Release Notes](https://github.com/kuhe/smithy-typescript/blob/main/CHANGELOG.md#0250-2024-11-18)) @@ -137,79 +168,86 @@ AWS extension enables AwsQueryCompatibility handling. ([#7058](https://github.co ### Features -* Populates and resolves flexible checksums client config values ([#6471](https://github.com/aws/aws-sdk-js-v3/pull/6471)) +- Populates and resolves flexible checksums client config values ([#6471](https://github.com/aws/aws-sdk-js-v3/pull/6471)) ### Bug Fixes -* Allow empty string field values for headers ([#6511](https://github.com/aws/aws-sdk-js-v3/pull/6511)) -* Fix setting the defualt signing name ([#6487](https://github.com/aws/aws-sdk-js-v3/pull/6487)) -* Fix how waiters are generated using error types when using `awsQuery` ([#6501](https://github.com/aws/aws-sdk-js-v3/pull/6501)) +- Allow empty string field values for headers ([#6511](https://github.com/aws/aws-sdk-js-v3/pull/6511)) +- Fix setting the defualt signing name ([#6487](https://github.com/aws/aws-sdk-js-v3/pull/6487)) +- Fix how waiters are generated using error types when using `awsQuery` ([#6501](https://github.com/aws/aws-sdk-js-v3/pull/6501)) ## 0.23.0 (2024-09-10) ### Features -* Added support for SigV4a and sigining region sets ([#6368](https://github.com/aws/aws-sdk-js-v3/pull/6368)) -* Added support for Smithy RPCv2 CBOR protocol ([#6096](https://github.com/aws/aws-sdk-js-v3/pull/6096)) +- Added support for SigV4a and sigining region sets ([#6368](https://github.com/aws/aws-sdk-js-v3/pull/6368)) +- Added support for Smithy RPCv2 CBOR protocol ([#6096](https://github.com/aws/aws-sdk-js-v3/pull/6096)) ## 0.22.0 (2024-08-06) ### Features -* Added support for `AccountIdEndpointMode` when configuring client endpoint parameters ([#6036](https://github.com/aws/aws-sdk-js-v3/pull/6036)) -* Enabled the new identity and auth behavior by default ([#1352](https://github.com/smithy-lang/smithy-typescript/pull/1352)) +- Added support for `AccountIdEndpointMode` when configuring client endpoint parameters ([#6036](https://github.com/aws/aws-sdk-js-v3/pull/6036)) +- Enabled the new identity and auth behavior by default ([#1352](https://github.com/smithy-lang/smithy-typescript/pull/1352)) ## 0.21.0 (2024-05-22) ### Bug Fixes -* Added dependencies required by default credential providers ([#6055](https://github.com/aws/aws-sdk-js-v3/pull/6055)) -* Statically import credential-provider-node in clients used from credentials ([#6027](https://github.com/aws/aws-sdk-js-v3/pull/6027)) -* Changed the logic to only add doc trait conditionally ([#6002](https://github.com/aws/aws-sdk-js-v3/pull/6002)) + +- Added dependencies required by default credential providers ([#6055](https://github.com/aws/aws-sdk-js-v3/pull/6055)) +- Statically import credential-provider-node in clients used from credentials ([#6027](https://github.com/aws/aws-sdk-js-v3/pull/6027)) +- Changed the logic to only add doc trait conditionally ([#6002](https://github.com/aws/aws-sdk-js-v3/pull/6002)) ## 0.20.1 (2024-04-05) ### Features -* Add option to prevent md5 computation ([#5953](https://github.com/aws/aws-sdk-js-v3/pull/5953)) -* Update Smithy to 1.47.0 ([#5956](https://github.com/aws/aws-sdk-js-v3/pull/5956)) + +- Add option to prevent md5 computation ([#5953](https://github.com/aws/aws-sdk-js-v3/pull/5953)) +- Update Smithy to 1.47.0 ([#5956](https://github.com/aws/aws-sdk-js-v3/pull/5956)) ## 0.20.0 (2024-03-27) ### Features -* Reduced code size for xml serde ([#5568](https://github.com/aws/aws-sdk-js-v3/pull/5568), [#5566](https://github.com/aws/aws-sdk-js-v3/pull/5566)) -* Reduced generated code size for all clients with library serde helpers ([#5855](https://github.com/aws/aws-sdk-js-v3/pull/5855)) -* Implemented lazy-loading of STS & SSO clients in credential providers ([#5681](https://github.com/aws/aws-sdk-js-v3/pull/5681)) + +- Reduced code size for xml serde ([#5568](https://github.com/aws/aws-sdk-js-v3/pull/5568), [#5566](https://github.com/aws/aws-sdk-js-v3/pull/5566)) +- Reduced generated code size for all clients with library serde helpers ([#5855](https://github.com/aws/aws-sdk-js-v3/pull/5855)) +- Implemented lazy-loading of STS & SSO clients in credential providers ([#5681](https://github.com/aws/aws-sdk-js-v3/pull/5681)) ### Bug Fixes -* Fixed an issue that could cause endpoint augmentations not to be applied in certain cases ([#5933](https://github.com/aws/aws-sdk-js-v3/pull/5933)) -* Fixed an issue where the `_json` deser function wouldn't be imported ([#5837](https://github.com/aws/aws-sdk-js-v3/pull/5837)) -* Added string fallback for S3 responses that contain the `Expires` timestamp instead of throwing an exception ([#5715](https://github.com/aws/aws-sdk-js-v3/pull/5715)) + +- Fixed an issue that could cause endpoint augmentations not to be applied in certain cases ([#5933](https://github.com/aws/aws-sdk-js-v3/pull/5933)) +- Fixed an issue where the `_json` deser function wouldn't be imported ([#5837](https://github.com/aws/aws-sdk-js-v3/pull/5837)) +- Added string fallback for S3 responses that contain the `Expires` timestamp instead of throwing an exception ([#5715](https://github.com/aws/aws-sdk-js-v3/pull/5715)) ## 0.19.0 (2023-11-03) ### Features -* Created coercing serializers for awsQueryCompat ([#5440](https://github.com/aws/aws-sdk-js-v3/pull/5440)) -* Migrated the `@aws-sdk/util-endpoints` package to use the newly added `@smithy/util-endpoints` package ([#5390](https://github.com/aws/aws-sdk-js-v3/pull/5390)) -* Added Node.js 14.x version deprecation warning ([#5413](https://github.com/aws/aws-sdk-js-v3/pull/5413)) -* Deprecated gamesparks ([#5386](https://github.com/aws/aws-sdk-js-v3/pull/5386)) -* Changed codegen for JSON protocols to use `awsExpectUnion`, which ignores the `__type` field ([#5376](https://github.com/aws/aws-sdk-js-v3/pull/5376)) -* Updated shapes with members targeting string and number enums (TypeScript unions) to be closed ([#5356](https://github.com/aws/aws-sdk-js-v3/pull/5356)) -* Added e2e suite for lib-dynamodb ([#5306](https://github.com/aws/aws-sdk-js-v3/pull/5306)) -* Added middleware for following region redirects ([#5185](https://github.com/aws/aws-sdk-js-v3/pull/5185)) + +- Created coercing serializers for awsQueryCompat ([#5440](https://github.com/aws/aws-sdk-js-v3/pull/5440)) +- Migrated the `@aws-sdk/util-endpoints` package to use the newly added `@smithy/util-endpoints` package ([#5390](https://github.com/aws/aws-sdk-js-v3/pull/5390)) +- Added Node.js 14.x version deprecation warning ([#5413](https://github.com/aws/aws-sdk-js-v3/pull/5413)) +- Deprecated gamesparks ([#5386](https://github.com/aws/aws-sdk-js-v3/pull/5386)) +- Changed codegen for JSON protocols to use `awsExpectUnion`, which ignores the `__type` field ([#5376](https://github.com/aws/aws-sdk-js-v3/pull/5376)) +- Updated shapes with members targeting string and number enums (TypeScript unions) to be closed ([#5356](https://github.com/aws/aws-sdk-js-v3/pull/5356)) +- Added e2e suite for lib-dynamodb ([#5306](https://github.com/aws/aws-sdk-js-v3/pull/5306)) +- Added middleware for following region redirects ([#5185](https://github.com/aws/aws-sdk-js-v3/pull/5185)) ### Bug Fixes -* Updated to use partial record for enum keyed types ([#5391](https://github.com/aws/aws-sdk-js-v3/pull/5391)) + +- Updated to use partial record for enum keyed types ([#5391](https://github.com/aws/aws-sdk-js-v3/pull/5391)) ## 0.18.0 (2023-10-04) ### Features -* Refactor addImport usage ([#4986](https://github.com/aws/aws-sdk-js-v3/pull/4986)) -* Remove defaults mode provider codegen ([#4993](https://github.com/aws/aws-sdk-js-v3/pull/4993)) -* Temporarily disable unused codegen ([#4996](https://github.com/aws/aws-sdk-js-v3/pull/4996)) -* Customize @aws.auth#sigv4 identity providers for the AWS SDK ([#5179](https://github.com/aws/aws-sdk-js-v3/pull/5179)) -* Customize @httpBearerAuth identity providers for the AWS SDK ([#5169](https://github.com/aws/aws-sdk-js-v3/pull/5169)) -* Add aws region runtime extension codegen ([#5157](https://github.com/aws/aws-sdk-js-v3/pull/5157)) -* Add smithy-aws-endpoints dependency ([#5311](https://github.com/aws/aws-sdk-js-v3/pull/5311)) -* Upgrade to Smithy 1.39.0 ([#5311](https://github.com/aws/aws-sdk-js-v3/pull/5311)) + +- Refactor addImport usage ([#4986](https://github.com/aws/aws-sdk-js-v3/pull/4986)) +- Remove defaults mode provider codegen ([#4993](https://github.com/aws/aws-sdk-js-v3/pull/4993)) +- Temporarily disable unused codegen ([#4996](https://github.com/aws/aws-sdk-js-v3/pull/4996)) +- Customize @aws.auth#sigv4 identity providers for the AWS SDK ([#5179](https://github.com/aws/aws-sdk-js-v3/pull/5179)) +- Customize @httpBearerAuth identity providers for the AWS SDK ([#5169](https://github.com/aws/aws-sdk-js-v3/pull/5169)) +- Add aws region runtime extension codegen ([#5157](https://github.com/aws/aws-sdk-js-v3/pull/5157)) +- Add smithy-aws-endpoints dependency ([#5311](https://github.com/aws/aws-sdk-js-v3/pull/5311)) +- Upgrade to Smithy 1.39.0 ([#5311](https://github.com/aws/aws-sdk-js-v3/pull/5311)) ## 0.17.1 (2023-07-07) @@ -217,33 +255,33 @@ AWS extension enables AwsQueryCompatibility handling. ([#7058](https://github.co ### Features -* Upgraded to Smithy 1.33.0 ([#4899](https://github.com/aws/aws-sdk-js-v3/pull/4899)) +- Upgraded to Smithy 1.33.0 ([#4899](https://github.com/aws/aws-sdk-js-v3/pull/4899)) ## 0.16.0 (2023-06-30) ### Features -* Updated code generator to use @smithy scoped npm packages ([#4873](https://github.com/aws/aws-sdk-js-v3/pull/4873)) -* Updated code generator to use runtime-agnostic util-stream package ([#4861](https://github.com/aws/aws-sdk-js-v3/pull/4861)) +- Updated code generator to use @smithy scoped npm packages ([#4873](https://github.com/aws/aws-sdk-js-v3/pull/4873)) +- Updated code generator to use runtime-agnostic util-stream package ([#4861](https://github.com/aws/aws-sdk-js-v3/pull/4861)) ## 0.15.0 (2023-05-10) ### Features -* Add Gradle composite build ([#4710](https://github.com/aws/aws-sdk-js-v3/pull/4710)) -* Add factory for aggregated clients ([#4639](https://github.com/aws/aws-sdk-js-v3/pull/4639)) -* Shorten serde code in protocols files ([#4625](https://github.com/aws/aws-sdk-js-v3/pull/4625), [#4714](https://github.com/aws/aws-sdk-js-v3/pull/4714)) -* Reduce generated HTTP request header code ([#4594](https://github.com/aws/aws-sdk-js-v3/pull/4594)) -* Add client api-extraction ([#4567](https://github.com/aws/aws-sdk-js-v3/pull/4567)) -* Reduce XML deserialization code size ([#4565](https://github.com/aws/aws-sdk-js-v3/pull/4565)) -* Add operations list to client README files ([#4478](https://github.com/aws/aws-sdk-js-v3/pull/4478)) -* Use generic client runtime config ([#4427](https://github.com/aws/aws-sdk-js-v3/pull/4427)) +- Add Gradle composite build ([#4710](https://github.com/aws/aws-sdk-js-v3/pull/4710)) +- Add factory for aggregated clients ([#4639](https://github.com/aws/aws-sdk-js-v3/pull/4639)) +- Shorten serde code in protocols files ([#4625](https://github.com/aws/aws-sdk-js-v3/pull/4625), [#4714](https://github.com/aws/aws-sdk-js-v3/pull/4714)) +- Reduce generated HTTP request header code ([#4594](https://github.com/aws/aws-sdk-js-v3/pull/4594)) +- Add client api-extraction ([#4567](https://github.com/aws/aws-sdk-js-v3/pull/4567)) +- Reduce XML deserialization code size ([#4565](https://github.com/aws/aws-sdk-js-v3/pull/4565)) +- Add operations list to client README files ([#4478](https://github.com/aws/aws-sdk-js-v3/pull/4478)) +- Use generic client runtime config ([#4427](https://github.com/aws/aws-sdk-js-v3/pull/4427)) ### Bug Fixes -* Fix jsonName deserialization on complex shapes ([#4670](https://github.com/aws/aws-sdk-js-v3/pull/4670)) -* Fix allowing idempotency token ([#4642](https://github.com/aws/aws-sdk-js-v3/pull/4642)) -* Fix missing dashes in client README files ([#4480](https://github.com/aws/aws-sdk-js-v3/pull/4480)) +- Fix jsonName deserialization on complex shapes ([#4670](https://github.com/aws/aws-sdk-js-v3/pull/4670)) +- Fix allowing idempotency token ([#4642](https://github.com/aws/aws-sdk-js-v3/pull/4642)) +- Fix missing dashes in client README files ([#4480](https://github.com/aws/aws-sdk-js-v3/pull/4480)) ## 0.14.0 (2023-02-09) @@ -251,125 +289,125 @@ AWS extension enables AwsQueryCompatibility handling. ([#7058](https://github.co ### Features -* Upgrade to Java 17 ([#4096](https://github.com/aws/aws-sdk-js-v3/pull/4096)) -* Upgrade to smithy 1.27.2 ([#4387](https://github.com/aws/aws-sdk-js-v3/pull/4387)) -* Endpoints 2.0 package changes ([#3947](https://github.com/aws/aws-sdk-js-v3/pull/3947)) -* Support awsQueryError trait ([#3998](https://github.com/aws/aws-sdk-js-v3/pull/3998)) -* Add TokenAuthPlugin ([#4238](https://github.com/aws/aws-sdk-js-v3/pull/4238), [#4012](https://github.com/aws/aws-sdk-js-v3/pull/4012), [#3972](https://github.com/aws/aws-sdk-js-v3/pull/3972)) -* Add RetryStrategyV2 ([#4248](https://github.com/aws/aws-sdk-js-v3/pull/4248)) -* Replace Hash with Checksum ([#4346](https://github.com/aws/aws-sdk-js-v3/pull/4346)) -* Use util-utf8 instead of platform dependencies ([#4353](https://github.com/aws/aws-sdk-js-v3/pull/4353)) -* Reduce object copying in iterators ([#4194](https://github.com/aws/aws-sdk-js-v3/pull/4194)) -* Support util functions to consume response streams ([#3977](https://github.com/aws/aws-sdk-js-v3/pull/3977)) -* Update awsAuthPlugin to set default signing name ([#4259](https://github.com/aws/aws-sdk-js-v3/pull/4259)) -* fix(codegen): safe access for error code location ([#4367](https://github.com/aws/aws-sdk-js-v3/pull/4367)) +- Upgrade to Java 17 ([#4096](https://github.com/aws/aws-sdk-js-v3/pull/4096)) +- Upgrade to smithy 1.27.2 ([#4387](https://github.com/aws/aws-sdk-js-v3/pull/4387)) +- Endpoints 2.0 package changes ([#3947](https://github.com/aws/aws-sdk-js-v3/pull/3947)) +- Support awsQueryError trait ([#3998](https://github.com/aws/aws-sdk-js-v3/pull/3998)) +- Add TokenAuthPlugin ([#4238](https://github.com/aws/aws-sdk-js-v3/pull/4238), [#4012](https://github.com/aws/aws-sdk-js-v3/pull/4012), [#3972](https://github.com/aws/aws-sdk-js-v3/pull/3972)) +- Add RetryStrategyV2 ([#4248](https://github.com/aws/aws-sdk-js-v3/pull/4248)) +- Replace Hash with Checksum ([#4346](https://github.com/aws/aws-sdk-js-v3/pull/4346)) +- Use util-utf8 instead of platform dependencies ([#4353](https://github.com/aws/aws-sdk-js-v3/pull/4353)) +- Reduce object copying in iterators ([#4194](https://github.com/aws/aws-sdk-js-v3/pull/4194)) +- Support util functions to consume response streams ([#3977](https://github.com/aws/aws-sdk-js-v3/pull/3977)) +- Update awsAuthPlugin to set default signing name ([#4259](https://github.com/aws/aws-sdk-js-v3/pull/4259)) +- fix(codegen): safe access for error code location ([#4367](https://github.com/aws/aws-sdk-js-v3/pull/4367)) ### Bug fixes -* Populate message field when parsing errors ([#3995](https://github.com/aws/aws-sdk-js-v3/pull/3995), [#3999](https://github.com/aws/aws-sdk-js-v3/pull/3999)) -* Update message in Error key in case of XML protocol ([#4000](https://github.com/aws/aws-sdk-js-v3/pull/4000)) -* Update aws-query protocol to distinguish explicit empty list ([#4003](https://github.com/aws/aws-sdk-js-v3/pull/4003)) -* Update S3 default config.signingEscapePath to false ([#4013](https://github.com/aws/aws-sdk-js-v3/pull/4013)) -* Use default no-op logger to preserve type safety ([#4171](https://github.com/aws/aws-sdk-js-v3/pull/4171)) -* Fix S3 control to add prefix dedupe middleware ([#4286](https://github.com/aws/aws-sdk-js-v3/pull/4286)) -* Fix restXml protocol test for timestampFormat targets ([#4364](https://github.com/aws/aws-sdk-js-v3/pull/4364)) -* Fix endpoints 2.0 bugs ([#4043](https://github.com/aws/aws-sdk-js-v3/pull/4043), [#4051](https://github.com/aws/aws-sdk-js-v3/pull/4051), [#4059](https://github.com/aws/aws-sdk-js-v3/pull/4059), [#4132](https://github.com/aws/aws-sdk-js-v3/pull/4132), [#4164](https://github.com/aws/aws-sdk-js-v3/pull/4164), [#4285](https://github.com/aws/aws-sdk-js-v3/pull/4285)) +- Populate message field when parsing errors ([#3995](https://github.com/aws/aws-sdk-js-v3/pull/3995), [#3999](https://github.com/aws/aws-sdk-js-v3/pull/3999)) +- Update message in Error key in case of XML protocol ([#4000](https://github.com/aws/aws-sdk-js-v3/pull/4000)) +- Update aws-query protocol to distinguish explicit empty list ([#4003](https://github.com/aws/aws-sdk-js-v3/pull/4003)) +- Update S3 default config.signingEscapePath to false ([#4013](https://github.com/aws/aws-sdk-js-v3/pull/4013)) +- Use default no-op logger to preserve type safety ([#4171](https://github.com/aws/aws-sdk-js-v3/pull/4171)) +- Fix S3 control to add prefix dedupe middleware ([#4286](https://github.com/aws/aws-sdk-js-v3/pull/4286)) +- Fix restXml protocol test for timestampFormat targets ([#4364](https://github.com/aws/aws-sdk-js-v3/pull/4364)) +- Fix endpoints 2.0 bugs ([#4043](https://github.com/aws/aws-sdk-js-v3/pull/4043), [#4051](https://github.com/aws/aws-sdk-js-v3/pull/4051), [#4059](https://github.com/aws/aws-sdk-js-v3/pull/4059), [#4132](https://github.com/aws/aws-sdk-js-v3/pull/4132), [#4164](https://github.com/aws/aws-sdk-js-v3/pull/4164), [#4285](https://github.com/aws/aws-sdk-js-v3/pull/4285)) ## 0.12.0 (2022-09-19) ### Features -* Added support for endpoints v2. ([#3942](https://github.com/aws/aws-sdk-js-v3/pull/3942)) -* Added support for multiple error headers. ([#3852](https://github.com/aws/aws-sdk-js-v3/pull/3852)) -* Added support for customer middleware for STS client. ([#3887](https://github.com/aws/aws-sdk-js-v3/pull/3887)) -* Added fallback to status code for unmodeled errors. ([#3752](https://github.com/aws/aws-sdk-js-v3/pull/3752)) -* Removed unnecessary S3 Size modification from inte to long. ([#3664](https://github.com/aws/aws-sdk-js-v3/pull/3664)) -* Removed deprecated S3 regional endpoints middleware. ([#3656](https://github.com/aws/aws-sdk-js-v3/pull/3656)) -* Added support for recursion detection middleware in Lambda. ([#3654](https://github.com/aws/aws-sdk-js-v3/pull/3654)) -* Used Record type instead of Object. ([#3659](https://github.com/aws/aws-sdk-js-v3/pull/3659)) -* Added check for javascript property validity for property access. ([#3649](https://github.com/aws/aws-sdk-js-v3/pull/3649)) -* Added codegen indicator comment to all generated files. ([#3592](https://github.com/aws/aws-sdk-js-v3/pull/3592)) -* Updated HTTP2 handler to accept parameters from default config provider. ([#3580](https://github.com/aws/aws-sdk-js-v3/pull/3580), [#3810](https://github.com/aws/aws-sdk-js-v3/pull/3810)) -* Enabled HTTP2 support based on protocol trait definition. ([#3577](https://github.com/aws/aws-sdk-js-v3/pull/3577)) -* Added support for multi-region sigv4a signer. ([#3518](https://github.com/aws/aws-sdk-js-v3/pull/3518)) +- Added support for endpoints v2. ([#3942](https://github.com/aws/aws-sdk-js-v3/pull/3942)) +- Added support for multiple error headers. ([#3852](https://github.com/aws/aws-sdk-js-v3/pull/3852)) +- Added support for customer middleware for STS client. ([#3887](https://github.com/aws/aws-sdk-js-v3/pull/3887)) +- Added fallback to status code for unmodeled errors. ([#3752](https://github.com/aws/aws-sdk-js-v3/pull/3752)) +- Removed unnecessary S3 Size modification from inte to long. ([#3664](https://github.com/aws/aws-sdk-js-v3/pull/3664)) +- Removed deprecated S3 regional endpoints middleware. ([#3656](https://github.com/aws/aws-sdk-js-v3/pull/3656)) +- Added support for recursion detection middleware in Lambda. ([#3654](https://github.com/aws/aws-sdk-js-v3/pull/3654)) +- Used Record type instead of Object. ([#3659](https://github.com/aws/aws-sdk-js-v3/pull/3659)) +- Added check for javascript property validity for property access. ([#3649](https://github.com/aws/aws-sdk-js-v3/pull/3649)) +- Added codegen indicator comment to all generated files. ([#3592](https://github.com/aws/aws-sdk-js-v3/pull/3592)) +- Updated HTTP2 handler to accept parameters from default config provider. ([#3580](https://github.com/aws/aws-sdk-js-v3/pull/3580), [#3810](https://github.com/aws/aws-sdk-js-v3/pull/3810)) +- Enabled HTTP2 support based on protocol trait definition. ([#3577](https://github.com/aws/aws-sdk-js-v3/pull/3577)) +- Added support for multi-region sigv4a signer. ([#3518](https://github.com/aws/aws-sdk-js-v3/pull/3518)) ### Bug Fixes -* Fixed README generation to handle service documentation containing `${}`. ([#3834](https://github.com/aws/aws-sdk-js-v3/pull/3834)) -* Fixed error code parsing when it is a number. ([#3371](https://github.com/aws/aws-sdk-js-v3/pull/3371)) -* Fixed serialization of event stream payloads. ([#3655](https://github.com/aws/aws-sdk-js-v3/pull/3655)) -* Fixed endpoints for S3's WriteGetObjectResponse. ([#3662](https://github.com/aws/aws-sdk-js-v3/pull/3662)) -* Fixed handling of empty xml tags. ([#3623](https://github.com/aws/aws-sdk-js-v3/pull/3623)) +- Fixed README generation to handle service documentation containing `${}`. ([#3834](https://github.com/aws/aws-sdk-js-v3/pull/3834)) +- Fixed error code parsing when it is a number. ([#3371](https://github.com/aws/aws-sdk-js-v3/pull/3371)) +- Fixed serialization of event stream payloads. ([#3655](https://github.com/aws/aws-sdk-js-v3/pull/3655)) +- Fixed endpoints for S3's WriteGetObjectResponse. ([#3662](https://github.com/aws/aws-sdk-js-v3/pull/3662)) +- Fixed handling of empty xml tags. ([#3623](https://github.com/aws/aws-sdk-js-v3/pull/3623)) ## 0.11.0 (2022-04-04) ### Features -* Updated Smithy version to `1.19.x`. ([#3507](https://github.com/aws/aws-sdk-js-v3/pull/3507)) +- Updated Smithy version to `1.19.x`. ([#3507](https://github.com/aws/aws-sdk-js-v3/pull/3507)) ## 0.10.0 (2022-03-02) ### Features -* Added http checksum dependency integration. ([#3346](https://github.com/aws/aws-sdk-js-v3/pull/3346), [#3349](https://github.com/aws/aws-sdk-js-v3/pull/3349)) +- Added http checksum dependency integration. ([#3346](https://github.com/aws/aws-sdk-js-v3/pull/3346), [#3349](https://github.com/aws/aws-sdk-js-v3/pull/3349)) ### Bug Fixes -* Disabled bucket endpoint plugin in WriteGetObjectResponseCommand. ([#3344](https://github.com/aws/aws-sdk-js-v3/pull/3344)) -* Fixed set deserialization in SSDKs. ([#3322](https://github.com/aws/aws-sdk-js-v3/pull/3322)) +- Disabled bucket endpoint plugin in WriteGetObjectResponseCommand. ([#3344](https://github.com/aws/aws-sdk-js-v3/pull/3344)) +- Fixed set deserialization in SSDKs. ([#3322](https://github.com/aws/aws-sdk-js-v3/pull/3322)) ## 0.9.0 (2022-02-14) ### Features -* Updated Smithy version to `1.17.0`. ([#3288](https://github.com/aws/aws-sdk-js-v3/pull/3288)) -* Added support for `defaultsMode`. ([#3192](https://github.com/aws/aws-sdk-js-v3/pull/3192)) +- Updated Smithy version to `1.17.0`. ([#3288](https://github.com/aws/aws-sdk-js-v3/pull/3288)) +- Added support for `defaultsMode`. ([#3192](https://github.com/aws/aws-sdk-js-v3/pull/3192)) ## 0.8.0 (2021-11-23) ### Features -* Updated EndpointGenerator to merge variants from partition defaults and service defaults using tags as unique key. ([#2989](https://github.com/aws/aws-sdk-js-v3/pull/2989), [#2990](https://github.com/aws/aws-sdk-js-v3/pull/2990), [#3044](https://github.com/aws/aws-sdk-js-v3/pull/3044)) -* Centralized Smithy version for Smithy dependencies including Smithy CLI. ([#3011](https://github.com/aws/aws-sdk-js-v3/pull/3011), [#3054](https://github.com/aws/aws-sdk-js-v3/pull/3054)) -* Updated Smithy version to `1.14.x`. ([#3053](https://github.com/aws/aws-sdk-js-v3/pull/3053)) +- Updated EndpointGenerator to merge variants from partition defaults and service defaults using tags as unique key. ([#2989](https://github.com/aws/aws-sdk-js-v3/pull/2989), [#2990](https://github.com/aws/aws-sdk-js-v3/pull/2990), [#3044](https://github.com/aws/aws-sdk-js-v3/pull/3044)) +- Centralized Smithy version for Smithy dependencies including Smithy CLI. ([#3011](https://github.com/aws/aws-sdk-js-v3/pull/3011), [#3054](https://github.com/aws/aws-sdk-js-v3/pull/3054)) +- Updated Smithy version to `1.14.x`. ([#3053](https://github.com/aws/aws-sdk-js-v3/pull/3053)) ## 0.7.1 (2021-11-04) ### Bug Fixes -* Fixed generator to not rely on unreleased features. +- Fixed generator to not rely on unreleased features. ## 0.7.0 (2021-11-03) ### Features -* Updated set deserialization to reject duplicates. ([#2764](https://github.com/aws/aws-sdk-js-v3/pull/2764)) -* Updated collection deserialization to reject null in non-sparse collections. ([#2771](https://github.com/aws/aws-sdk-js-v3/pull/2771)) -* Moved source files to `src` folder. ([#2844](https://github.com/aws/aws-sdk-js-v3/pull/2844)) -* packageInfo imports from user agent module are now automatically ignored. ([#2875](https://github.com/aws/aws-sdk-js-v3/pull/2875)) -* Updated Smithy version to `1.12.0`. ([#2878](https://github.com/aws/aws-sdk-js-v3/pull/2878)) +- Updated set deserialization to reject duplicates. ([#2764](https://github.com/aws/aws-sdk-js-v3/pull/2764)) +- Updated collection deserialization to reject null in non-sparse collections. ([#2771](https://github.com/aws/aws-sdk-js-v3/pull/2771)) +- Moved source files to `src` folder. ([#2844](https://github.com/aws/aws-sdk-js-v3/pull/2844)) +- packageInfo imports from user agent module are now automatically ignored. ([#2875](https://github.com/aws/aws-sdk-js-v3/pull/2875)) +- Updated Smithy version to `1.12.0`. ([#2878](https://github.com/aws/aws-sdk-js-v3/pull/2878)) ## 0.6.0 (2021-09-02) ### Features -* Added support for malformed request tests. ([#2695](https://github.com/aws/aws-sdk-js-v3/pull/2695)) -* Made endpoints resolution modular. ([#2704](https://github.com/aws/aws-sdk-js-v3/pull/2704)) -* Updated number parsing to be stricter. ([#2662](https://github.com/aws/aws-sdk-js-v3/pull/2662), [#2719](https://github.com/aws/aws-sdk-js-v3/pull/2719)) -* Reintroduced CORS retry headers for supported services. ([#2658](https://github.com/aws/aws-sdk-js-v3/pull/2658)) +- Added support for malformed request tests. ([#2695](https://github.com/aws/aws-sdk-js-v3/pull/2695)) +- Made endpoints resolution modular. ([#2704](https://github.com/aws/aws-sdk-js-v3/pull/2704)) +- Updated number parsing to be stricter. ([#2662](https://github.com/aws/aws-sdk-js-v3/pull/2662), [#2719](https://github.com/aws/aws-sdk-js-v3/pull/2719)) +- Reintroduced CORS retry headers for supported services. ([#2658](https://github.com/aws/aws-sdk-js-v3/pull/2658)) ### Bug Fixes -* Fixed double encoding of presigned url. ([#2711](https://github.com/aws/aws-sdk-js-v3/pull/2711)) -* Only trim xml tag values which contain newline. ([#2653](https://github.com/aws/aws-sdk-js-v3/pull/2653)) +- Fixed double encoding of presigned url. ([#2711](https://github.com/aws/aws-sdk-js-v3/pull/2711)) +- Only trim xml tag values which contain newline. ([#2653](https://github.com/aws/aws-sdk-js-v3/pull/2653)) ### Other -* Updated `smithy-typescript-codegen` dependency to `0.6.0`. -* Updated `smithy` dependencies to `1.11.x`. +- Updated `smithy-typescript-codegen` dependency to `0.6.0`. +- Updated `smithy` dependencies to `1.11.x`. ## 0.5.0 (2021-07-23) ### Features -* Updated `smithy-typescript-codegen` dependency to `0.5.0`. +- Updated `smithy-typescript-codegen` dependency to `0.5.0`. diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts index 4fd84b139fd38..49efb69632d55 100644 --- a/codegen/build.gradle.kts +++ b/codegen/build.gradle.kts @@ -32,7 +32,7 @@ allprojects { mavenCentral() } group = "software.amazon.smithy.typescript" - version = "0.37.0" + version = "0.38.0" } // The root project doesn't produce a JAR. diff --git a/codegen/gradle.properties b/codegen/gradle.properties index 47bc5c0211b28..78f38dbccd699 100644 --- a/codegen/gradle.properties +++ b/codegen/gradle.properties @@ -1,4 +1,4 @@ -smithyVersion=1.63.0 +smithyVersion=1.64.0 smithyGradleVersion=1.3.0 org.gradle.jvmargs=-Xmx4096M org.gradle.configuration-cache=true \ No newline at end of file diff --git a/codegen/smithy-aws-typescript-codegen/build.gradle.kts b/codegen/smithy-aws-typescript-codegen/build.gradle.kts index 8fc3473b4fcca..a808087e0ff3c 100644 --- a/codegen/smithy-aws-typescript-codegen/build.gradle.kts +++ b/codegen/smithy-aws-typescript-codegen/build.gradle.kts @@ -43,7 +43,7 @@ buildscript { dependencies { // Smithy TypeScript - api("software.amazon.smithy.typescript:smithy-typescript-codegen:0.37.0") + api("software.amazon.smithy.typescript:smithy-typescript-codegen:0.38.0") // Smithy generic dependencies api("software.amazon.smithy:smithy-model:$smithyVersion") diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java index 91ecc1759703a..0a6f22320c700 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java @@ -38,6 +38,7 @@ import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.ShapeVisitor; import software.amazon.smithy.model.traits.IdempotencyTokenTrait; +import software.amazon.smithy.model.traits.StreamingTrait; import software.amazon.smithy.model.traits.TimestampFormatTrait; import software.amazon.smithy.model.traits.TimestampFormatTrait.Format; import software.amazon.smithy.model.traits.XmlNamespaceTrait; @@ -104,7 +105,14 @@ static void generateDocumentBodyShapeSerde( Walker shapeWalker = new Walker(NeighborProviderIndex.of(context.getModel()).getProvider()); Set shapesToGenerate = new TreeSet<>(shapes); shapes.forEach(shape -> shapesToGenerate.addAll(shapeWalker.walkShapes(shape))); - shapesToGenerate.forEach(shape -> shape.accept(visitor)); + shapesToGenerate.forEach(shape -> { + boolean isEventStream = shape.isUnionShape() && shape.hasTrait(StreamingTrait.class); + + if (!isEventStream) { + // event streams have a separate serde. + shape.accept(visitor); + } + }); } /** diff --git a/private/aws-protocoltests-ec2-schema/README.md b/private/aws-protocoltests-ec2-schema/README.md index 5f4dc7c4f86b8..5e79da4e58b24 100644 --- a/private/aws-protocoltests-ec2-schema/README.md +++ b/private/aws-protocoltests-ec2-schema/README.md @@ -1018,6 +1018,30 @@ 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/) + +
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1162,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1242,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1650,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-ec2/README.md b/private/aws-protocoltests-ec2/README.md index 344e6628801cf..057ec42312b3a 100644 --- a/private/aws-protocoltests-ec2/README.md +++ b/private/aws-protocoltests-ec2/README.md @@ -1018,6 +1018,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1162,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1242,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1650,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-json-10-schema/README.md b/private/aws-protocoltests-json-10-schema/README.md index 61ea3ddd61002..e6514a6985cea 100644 --- a/private/aws-protocoltests-json-10-schema/README.md +++ b/private/aws-protocoltests-json-10-schema/README.md @@ -1016,6 +1016,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-json-10/README.md b/private/aws-protocoltests-json-10/README.md index 10a0aa3a65afa..e875fa33ebe39 100644 --- a/private/aws-protocoltests-json-10/README.md +++ b/private/aws-protocoltests-json-10/README.md @@ -1016,6 +1016,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-rpc-10/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-rpc-10/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-json-machinelearning/README.md b/private/aws-protocoltests-json-machinelearning/README.md index b0cdc0c26be47..19f2437ba93d9 100644 --- a/private/aws-protocoltests-json-machinelearning/README.md +++ b/private/aws-protocoltests-json-machinelearning/README.md @@ -1016,6 +1016,30 @@ DocumentTypeAsPayload [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DocumentTypeAsPayloadCommandOutput/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ HttpPrefixHeadersInResponse [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpPrefixHeadersInResponseCommandOutput/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ InputAndOutputWithHeaders [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputAndOutputWithHeadersCommandOutput/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ OperationWithNestedStructure [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OperationWithNestedStructureCommandOutput/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-json-schema-machinelearning/README.md b/private/aws-protocoltests-json-schema-machinelearning/README.md index e4d5942dd7b42..e34d6a6a30bbf 100644 --- a/private/aws-protocoltests-json-schema-machinelearning/README.md +++ b/private/aws-protocoltests-json-schema-machinelearning/README.md @@ -1016,6 +1016,30 @@ DocumentTypeAsPayload [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DocumentTypeAsPayloadCommandOutput/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ HttpPrefixHeadersInResponse [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpPrefixHeadersInResponseCommandOutput/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ InputAndOutputWithHeaders [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputAndOutputWithHeadersCommandOutput/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ OperationWithNestedStructure [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OperationWithNestedStructureCommandOutput/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/machine-learning/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-machine-learning/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-json-schema/README.md b/private/aws-protocoltests-json-schema/README.md index a91e5ad73b1a3..c841dccf475e2 100644 --- a/private/aws-protocoltests-json-schema/README.md +++ b/private/aws-protocoltests-json-schema/README.md @@ -1016,6 +1016,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-json/README.md b/private/aws-protocoltests-json/README.md index 6ddb65b9d4d20..bd370b5075202 100644 --- a/private/aws-protocoltests-json/README.md +++ b/private/aws-protocoltests-json/README.md @@ -1016,6 +1016,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/json-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-json-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-query-schema/README.md b/private/aws-protocoltests-query-schema/README.md index 13f053e524085..6534563df847a 100644 --- a/private/aws-protocoltests-query-schema/README.md +++ b/private/aws-protocoltests-query-schema/README.md @@ -1018,6 +1018,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1162,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1242,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1650,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-query/README.md b/private/aws-protocoltests-query/README.md index 323c114fdef63..3bc19d1fbc6f5 100644 --- a/private/aws-protocoltests-query/README.md +++ b/private/aws-protocoltests-query/README.md @@ -1018,6 +1018,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1162,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1242,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1650,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/query-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-query-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restjson-apigateway/README.md b/private/aws-protocoltests-restjson-apigateway/README.md index c7914abdc7fb4..017850a6fcacc 100644 --- a/private/aws-protocoltests-restjson-apigateway/README.md +++ b/private/aws-protocoltests-restjson-apigateway/README.md @@ -1016,6 +1016,30 @@ DocumentTypeAsPayload [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DocumentTypeAsPayloadCommandOutput/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ HttpPrefixHeadersInResponse [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpPrefixHeadersInResponseCommandOutput/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ InputAndOutputWithHeaders [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputAndOutputWithHeadersCommandOutput/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ OperationWithNestedStructure [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OperationWithNestedStructureCommandOutput/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restjson-glacier/README.md b/private/aws-protocoltests-restjson-glacier/README.md index 40aebf834e0f4..c26a8d5502c4c 100644 --- a/private/aws-protocoltests-restjson-glacier/README.md +++ b/private/aws-protocoltests-restjson-glacier/README.md @@ -1016,6 +1016,30 @@ DocumentTypeAsPayload [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DocumentTypeAsPayloadCommandOutput/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ HttpPrefixHeadersInResponse [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpPrefixHeadersInResponseCommandOutput/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ InputAndOutputWithHeaders [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputAndOutputWithHeadersCommandOutput/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ OperationWithNestedStructure [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OperationWithNestedStructureCommandOutput/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restjson-schema-apigateway/README.md b/private/aws-protocoltests-restjson-schema-apigateway/README.md index 3df0ef6a5f44d..c8122d24d6b12 100644 --- a/private/aws-protocoltests-restjson-schema-apigateway/README.md +++ b/private/aws-protocoltests-restjson-schema-apigateway/README.md @@ -1016,6 +1016,30 @@ DocumentTypeAsPayload [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DocumentTypeAsPayloadCommandOutput/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ HttpPrefixHeadersInResponse [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpPrefixHeadersInResponseCommandOutput/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ InputAndOutputWithHeaders [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputAndOutputWithHeadersCommandOutput/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ OperationWithNestedStructure [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OperationWithNestedStructureCommandOutput/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/api-gateway/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-api-gateway/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restjson-schema-glacier/README.md b/private/aws-protocoltests-restjson-schema-glacier/README.md index fd2b5be4ae0c3..5e83c53d9e60e 100644 --- a/private/aws-protocoltests-restjson-schema-glacier/README.md +++ b/private/aws-protocoltests-restjson-schema-glacier/README.md @@ -1016,6 +1016,30 @@ DocumentTypeAsPayload [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DocumentTypeAsPayloadCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DocumentTypeAsPayloadCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DocumentTypeAsPayloadCommandOutput/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1136,6 +1160,14 @@ HttpPrefixHeadersInResponse [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/HttpPrefixHeadersInResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpPrefixHeadersInResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpPrefixHeadersInResponseCommandOutput/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1208,6 +1240,22 @@ InputAndOutputWithHeaders [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/InputAndOutputWithHeadersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputAndOutputWithHeadersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputAndOutputWithHeadersCommandOutput/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1600,6 +1648,22 @@ OperationWithNestedStructure [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/OperationWithNestedStructureCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OperationWithNestedStructureCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OperationWithNestedStructureCommandOutput/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/glacier/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-glacier/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restjson-schema/README.md b/private/aws-protocoltests-restjson-schema/README.md index aab3effda1416..5da52a10060b0 100644 --- a/private/aws-protocoltests-restjson-schema/README.md +++ b/private/aws-protocoltests-restjson-schema/README.md @@ -6,8 +6,6 @@ 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 @@ -23,16 +21,16 @@ using your favorite package manager: 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`: +the commands you need, for example `InputStreamCommand`: ```js // ES5 example -const { RestJsonProtocolClient, JsonBlobsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); +const { RestJsonProtocolClient, InputStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); ``` ```ts // ES6+ example -import { RestJsonProtocolClient, JsonBlobsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; +import { RestJsonProtocolClient, InputStreamCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; ``` ### Usage @@ -51,7 +49,7 @@ const client = new RestJsonProtocolClient({ region: "REGION" }); const params = { /** input parameters */ }; -const command = new JsonBlobsCommand(params); +const command = new InputStreamCommand(params); ``` #### Async/await @@ -130,7 +128,7 @@ const client = new AWS.RestJsonProtocol({ region: "REGION" }); // async/await. try { - const data = await client.jsonBlobs(params); + const data = await client.inputStream(params); // process data. } catch (error) { // error handling. @@ -138,7 +136,7 @@ try { // Promises. client - .jsonBlobs(params) + .inputStream(params) .then((data) => { // process data. }) @@ -147,7 +145,7 @@ client }); // callbacks. -client.jsonBlobs(params, (err, data) => { +client.inputStream(params, (err, data) => { // process err and data. }); ``` @@ -1018,6 +1016,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1160,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1240,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1648,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restjson-schema/package.json b/private/aws-protocoltests-restjson-schema/package.json index 26dda4da9a8b0..205423e6d4ad5 100644 --- a/private/aws-protocoltests-restjson-schema/package.json +++ b/private/aws-protocoltests-restjson-schema/package.json @@ -22,6 +22,8 @@ "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "*", "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/eventstream-handler-node": "*", + "@aws-sdk/middleware-eventstream": "*", "@aws-sdk/middleware-host-header": "*", "@aws-sdk/middleware-logger": "*", "@aws-sdk/middleware-recursion-detection": "*", @@ -33,6 +35,9 @@ "@aws-sdk/util-user-agent-node": "*", "@smithy/config-resolver": "^4.4.3", "@smithy/core": "^3.18.5", + "@smithy/eventstream-serde-browser": "^4.2.5", + "@smithy/eventstream-serde-config-resolver": "^4.3.5", + "@smithy/eventstream-serde-node": "^4.2.5", "@smithy/fetch-http-handler": "^5.3.6", "@smithy/hash-blob-browser": "^4.2.6", "@smithy/hash-node": "^4.2.5", diff --git a/private/aws-protocoltests-restjson-schema/src/RestJsonProtocol.ts b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocol.ts index 09c418beedef1..0f27ea4c5ea3c 100644 --- a/private/aws-protocoltests-restjson-schema/src/RestJsonProtocol.ts +++ b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocol.ts @@ -42,6 +42,21 @@ import { DocumentTypeCommandInput, DocumentTypeCommandOutput, } from "./commands/DocumentTypeCommand"; +import { + DuplexStreamCommand, + DuplexStreamCommandInput, + DuplexStreamCommandOutput, +} from "./commands/DuplexStreamCommand"; +import { + DuplexStreamWithDistinctStreamsCommand, + DuplexStreamWithDistinctStreamsCommandInput, + DuplexStreamWithDistinctStreamsCommandOutput, +} from "./commands/DuplexStreamWithDistinctStreamsCommand"; +import { + DuplexStreamWithInitialMessagesCommand, + DuplexStreamWithInitialMessagesCommandInput, + DuplexStreamWithInitialMessagesCommandOutput, +} from "./commands/DuplexStreamWithInitialMessagesCommand"; import { EmptyInputAndEmptyOutputCommand, EmptyInputAndEmptyOutputCommandInput, @@ -117,6 +132,11 @@ import { HttpPrefixHeadersInResponseCommandInput, HttpPrefixHeadersInResponseCommandOutput, } from "./commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpQueryParamsOnlyOperationCommand, + HttpQueryParamsOnlyOperationCommandInput, + HttpQueryParamsOnlyOperationCommandOutput, +} from "./commands/HttpQueryParamsOnlyOperationCommand"; import { HttpRequestWithFloatLabelsCommand, HttpRequestWithFloatLabelsCommandInput, @@ -162,6 +182,12 @@ import { InputAndOutputWithHeadersCommandInput, InputAndOutputWithHeadersCommandOutput, } from "./commands/InputAndOutputWithHeadersCommand"; +import { InputStreamCommand, InputStreamCommandInput, InputStreamCommandOutput } from "./commands/InputStreamCommand"; +import { + InputStreamWithInitialRequestCommand, + InputStreamWithInitialRequestCommandInput, + InputStreamWithInitialRequestCommandOutput, +} from "./commands/InputStreamWithInitialRequestCommand"; import { JsonBlobsCommand, JsonBlobsCommandInput, JsonBlobsCommandOutput } from "./commands/JsonBlobsCommand"; import { JsonEnumsCommand, JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; import { @@ -387,6 +413,16 @@ import { OperationWithNestedStructureCommandInput, OperationWithNestedStructureCommandOutput, } from "./commands/OperationWithNestedStructureCommand"; +import { + OutputStreamCommand, + OutputStreamCommandInput, + OutputStreamCommandOutput, +} from "./commands/OutputStreamCommand"; +import { + OutputStreamWithInitialResponseCommand, + OutputStreamWithInitialResponseCommandInput, + OutputStreamWithInitialResponseCommandOutput, +} from "./commands/OutputStreamWithInitialResponseCommand"; import { PostPlayerActionCommand, PostPlayerActionCommandInput, @@ -518,6 +554,9 @@ const commands = { DocumentTypeCommand, DocumentTypeAsMapValueCommand, DocumentTypeAsPayloadCommand, + DuplexStreamCommand, + DuplexStreamWithDistinctStreamsCommand, + DuplexStreamWithInitialMessagesCommand, EmptyInputAndEmptyOutputCommand, EndpointOperationCommand, EndpointWithHostLabelOperationCommand, @@ -533,6 +572,7 @@ const commands = { HttpPayloadWithUnionCommand, HttpPrefixHeadersCommand, HttpPrefixHeadersInResponseCommand, + HttpQueryParamsOnlyOperationCommand, HttpRequestWithFloatLabelsCommand, HttpRequestWithGreedyLabelInPathCommand, HttpRequestWithLabelsCommand, @@ -542,6 +582,8 @@ const commands = { HttpStringPayloadCommand, IgnoreQueryParamsInResponseCommand, InputAndOutputWithHeadersCommand, + InputStreamCommand, + InputStreamWithInitialRequestCommand, JsonBlobsCommand, JsonEnumsCommand, JsonIntEnumsCommand, @@ -591,6 +633,8 @@ const commands = { OmitsSerializingEmptyListsCommand, OperationWithDefaultsCommand, OperationWithNestedStructureCommand, + OutputStreamCommand, + OutputStreamWithInitialResponseCommand, PostPlayerActionCommand, PostUnionWithJsonNameCommand, PutWithContentEncodingCommand, @@ -752,6 +796,53 @@ export interface RestJsonProtocol { cb: (err: any, data?: DocumentTypeAsPayloadCommandOutput) => void ): void; + /** + * @see {@link DuplexStreamCommand} + */ + duplexStream(): Promise; + duplexStream(args: DuplexStreamCommandInput, options?: __HttpHandlerOptions): Promise; + duplexStream(args: DuplexStreamCommandInput, cb: (err: any, data?: DuplexStreamCommandOutput) => void): void; + duplexStream( + args: DuplexStreamCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DuplexStreamCommandOutput) => void + ): void; + + /** + * @see {@link DuplexStreamWithDistinctStreamsCommand} + */ + duplexStreamWithDistinctStreams(): Promise; + duplexStreamWithDistinctStreams( + args: DuplexStreamWithDistinctStreamsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + duplexStreamWithDistinctStreams( + args: DuplexStreamWithDistinctStreamsCommandInput, + cb: (err: any, data?: DuplexStreamWithDistinctStreamsCommandOutput) => void + ): void; + duplexStreamWithDistinctStreams( + args: DuplexStreamWithDistinctStreamsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DuplexStreamWithDistinctStreamsCommandOutput) => void + ): void; + + /** + * @see {@link DuplexStreamWithInitialMessagesCommand} + */ + duplexStreamWithInitialMessages( + args: DuplexStreamWithInitialMessagesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + duplexStreamWithInitialMessages( + args: DuplexStreamWithInitialMessagesCommandInput, + cb: (err: any, data?: DuplexStreamWithInitialMessagesCommandOutput) => void + ): void; + duplexStreamWithInitialMessages( + args: DuplexStreamWithInitialMessagesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DuplexStreamWithInitialMessagesCommandOutput) => void + ): void; + /** * @see {@link EmptyInputAndEmptyOutputCommand} */ @@ -1018,6 +1109,24 @@ export interface RestJsonProtocol { cb: (err: any, data?: HttpPrefixHeadersInResponseCommandOutput) => void ): void; + /** + * @see {@link HttpQueryParamsOnlyOperationCommand} + */ + httpQueryParamsOnlyOperation(): Promise; + httpQueryParamsOnlyOperation( + args: HttpQueryParamsOnlyOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpQueryParamsOnlyOperation( + args: HttpQueryParamsOnlyOperationCommandInput, + cb: (err: any, data?: HttpQueryParamsOnlyOperationCommandOutput) => void + ): void; + httpQueryParamsOnlyOperation( + args: HttpQueryParamsOnlyOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpQueryParamsOnlyOperationCommandOutput) => void + ): void; + /** * @see {@link HttpRequestWithFloatLabelsCommand} */ @@ -1175,6 +1284,35 @@ export interface RestJsonProtocol { cb: (err: any, data?: InputAndOutputWithHeadersCommandOutput) => void ): void; + /** + * @see {@link InputStreamCommand} + */ + inputStream(): Promise; + inputStream(args: InputStreamCommandInput, options?: __HttpHandlerOptions): Promise; + inputStream(args: InputStreamCommandInput, cb: (err: any, data?: InputStreamCommandOutput) => void): void; + inputStream( + args: InputStreamCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InputStreamCommandOutput) => void + ): void; + + /** + * @see {@link InputStreamWithInitialRequestCommand} + */ + inputStreamWithInitialRequest( + args: InputStreamWithInitialRequestCommandInput, + options?: __HttpHandlerOptions + ): Promise; + inputStreamWithInitialRequest( + args: InputStreamWithInitialRequestCommandInput, + cb: (err: any, data?: InputStreamWithInitialRequestCommandOutput) => void + ): void; + inputStreamWithInitialRequest( + args: InputStreamWithInitialRequestCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InputStreamWithInitialRequestCommandOutput) => void + ): void; + /** * @see {@link JsonBlobsCommand} */ @@ -1950,6 +2088,36 @@ export interface RestJsonProtocol { cb: (err: any, data?: OperationWithNestedStructureCommandOutput) => void ): void; + /** + * @see {@link OutputStreamCommand} + */ + outputStream(): Promise; + outputStream(args: OutputStreamCommandInput, options?: __HttpHandlerOptions): Promise; + outputStream(args: OutputStreamCommandInput, cb: (err: any, data?: OutputStreamCommandOutput) => void): void; + outputStream( + args: OutputStreamCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OutputStreamCommandOutput) => void + ): void; + + /** + * @see {@link OutputStreamWithInitialResponseCommand} + */ + outputStreamWithInitialResponse(): Promise; + outputStreamWithInitialResponse( + args: OutputStreamWithInitialResponseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + outputStreamWithInitialResponse( + args: OutputStreamWithInitialResponseCommandInput, + cb: (err: any, data?: OutputStreamWithInitialResponseCommandOutput) => void + ): void; + outputStreamWithInitialResponse( + args: OutputStreamWithInitialResponseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OutputStreamWithInitialResponseCommandOutput) => void + ): void; + /** * @see {@link PostPlayerActionCommand} */ @@ -2366,7 +2534,6 @@ export interface RestJsonProtocol { } /** - * A REST JSON service that sends JSON requests and responses. * @public */ export class RestJsonProtocol extends RestJsonProtocolClient implements RestJsonProtocol {} diff --git a/private/aws-protocoltests-restjson-schema/src/RestJsonProtocolClient.ts b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocolClient.ts index 41820d1c15b4e..6df4bda298cde 100644 --- a/private/aws-protocoltests-restjson-schema/src/RestJsonProtocolClient.ts +++ b/private/aws-protocoltests-restjson-schema/src/RestJsonProtocolClient.ts @@ -1,4 +1,9 @@ // smithy-typescript generated code +import { + EventStreamInputConfig, + EventStreamResolvedConfig, + resolveEventStreamConfig, +} from "@aws-sdk/middleware-eventstream"; import { getHostHeaderPlugin, HostHeaderInputConfig, @@ -13,6 +18,7 @@ import { UserAgentInputConfig, UserAgentResolvedConfig, } from "@aws-sdk/middleware-user-agent"; +import { EventStreamPayloadHandlerProvider as __EventStreamPayloadHandlerProvider } from "@aws-sdk/types"; import { DefaultAwsRegionalEndpointsInputConfig, DefaultAwsRegionalEndpointsResolvedConfig, @@ -25,6 +31,11 @@ import { getHttpSigningPlugin, } from "@smithy/core"; import { getSchemaSerdePlugin } from "@smithy/core/schema"; +import { + EventStreamSerdeInputConfig, + EventStreamSerdeResolvedConfig, + resolveEventStreamSerdeConfig, +} from "@smithy/eventstream-serde-config-resolver"; import { CompressionInputConfig, CompressionResolvedConfig, @@ -50,6 +61,7 @@ import { Decoder as __Decoder, Encoder as __Encoder, EndpointV2 as __EndpointV2, + EventStreamSerdeProvider as __EventStreamSerdeProvider, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, HttpRequest, @@ -97,6 +109,15 @@ import { DocumentTypeAsPayloadCommandOutput, } from "./commands/DocumentTypeAsPayloadCommand"; import { DocumentTypeCommandInput, DocumentTypeCommandOutput } from "./commands/DocumentTypeCommand"; +import { DuplexStreamCommandInput, DuplexStreamCommandOutput } from "./commands/DuplexStreamCommand"; +import { + DuplexStreamWithDistinctStreamsCommandInput, + DuplexStreamWithDistinctStreamsCommandOutput, +} from "./commands/DuplexStreamWithDistinctStreamsCommand"; +import { + DuplexStreamWithInitialMessagesCommandInput, + DuplexStreamWithInitialMessagesCommandOutput, +} from "./commands/DuplexStreamWithInitialMessagesCommand"; import { EmptyInputAndEmptyOutputCommandInput, EmptyInputAndEmptyOutputCommandOutput, @@ -139,6 +160,10 @@ import { HttpPrefixHeadersInResponseCommandInput, HttpPrefixHeadersInResponseCommandOutput, } from "./commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpQueryParamsOnlyOperationCommandInput, + HttpQueryParamsOnlyOperationCommandOutput, +} from "./commands/HttpQueryParamsOnlyOperationCommand"; import { HttpRequestWithFloatLabelsCommandInput, HttpRequestWithFloatLabelsCommandOutput, @@ -169,6 +194,11 @@ import { InputAndOutputWithHeadersCommandInput, InputAndOutputWithHeadersCommandOutput, } from "./commands/InputAndOutputWithHeadersCommand"; +import { InputStreamCommandInput, InputStreamCommandOutput } from "./commands/InputStreamCommand"; +import { + InputStreamWithInitialRequestCommandInput, + InputStreamWithInitialRequestCommandOutput, +} from "./commands/InputStreamWithInitialRequestCommand"; import { JsonBlobsCommandInput, JsonBlobsCommandOutput } from "./commands/JsonBlobsCommand"; import { JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; import { JsonIntEnumsCommandInput, JsonIntEnumsCommandOutput } from "./commands/JsonIntEnumsCommand"; @@ -299,6 +329,11 @@ import { OperationWithNestedStructureCommandInput, OperationWithNestedStructureCommandOutput, } from "./commands/OperationWithNestedStructureCommand"; +import { OutputStreamCommandInput, OutputStreamCommandOutput } from "./commands/OutputStreamCommand"; +import { + OutputStreamWithInitialResponseCommandInput, + OutputStreamWithInitialResponseCommandOutput, +} from "./commands/OutputStreamWithInitialResponseCommand"; import { PostPlayerActionCommandInput, PostPlayerActionCommandOutput } from "./commands/PostPlayerActionCommand"; import { PostUnionWithJsonNameCommandInput, @@ -385,6 +420,9 @@ export type ServiceInputTypes = | DocumentTypeAsMapValueCommandInput | DocumentTypeAsPayloadCommandInput | DocumentTypeCommandInput + | DuplexStreamCommandInput + | DuplexStreamWithDistinctStreamsCommandInput + | DuplexStreamWithInitialMessagesCommandInput | EmptyInputAndEmptyOutputCommandInput | EndpointOperationCommandInput | EndpointWithHostLabelOperationCommandInput @@ -400,6 +438,7 @@ export type ServiceInputTypes = | HttpPayloadWithUnionCommandInput | HttpPrefixHeadersCommandInput | HttpPrefixHeadersInResponseCommandInput + | HttpQueryParamsOnlyOperationCommandInput | HttpRequestWithFloatLabelsCommandInput | HttpRequestWithGreedyLabelInPathCommandInput | HttpRequestWithLabelsAndTimestampFormatCommandInput @@ -409,6 +448,8 @@ export type ServiceInputTypes = | HttpStringPayloadCommandInput | IgnoreQueryParamsInResponseCommandInput | InputAndOutputWithHeadersCommandInput + | InputStreamCommandInput + | InputStreamWithInitialRequestCommandInput | JsonBlobsCommandInput | JsonEnumsCommandInput | JsonIntEnumsCommandInput @@ -458,6 +499,8 @@ export type ServiceInputTypes = | OmitsSerializingEmptyListsCommandInput | OperationWithDefaultsCommandInput | OperationWithNestedStructureCommandInput + | OutputStreamCommandInput + | OutputStreamWithInitialResponseCommandInput | PostPlayerActionCommandInput | PostUnionWithJsonNameCommandInput | PutWithContentEncodingCommandInput @@ -495,6 +538,9 @@ export type ServiceOutputTypes = | DocumentTypeAsMapValueCommandOutput | DocumentTypeAsPayloadCommandOutput | DocumentTypeCommandOutput + | DuplexStreamCommandOutput + | DuplexStreamWithDistinctStreamsCommandOutput + | DuplexStreamWithInitialMessagesCommandOutput | EmptyInputAndEmptyOutputCommandOutput | EndpointOperationCommandOutput | EndpointWithHostLabelOperationCommandOutput @@ -510,6 +556,7 @@ export type ServiceOutputTypes = | HttpPayloadWithUnionCommandOutput | HttpPrefixHeadersCommandOutput | HttpPrefixHeadersInResponseCommandOutput + | HttpQueryParamsOnlyOperationCommandOutput | HttpRequestWithFloatLabelsCommandOutput | HttpRequestWithGreedyLabelInPathCommandOutput | HttpRequestWithLabelsAndTimestampFormatCommandOutput @@ -519,6 +566,8 @@ export type ServiceOutputTypes = | HttpStringPayloadCommandOutput | IgnoreQueryParamsInResponseCommandOutput | InputAndOutputWithHeadersCommandOutput + | InputStreamCommandOutput + | InputStreamWithInitialRequestCommandOutput | JsonBlobsCommandOutput | JsonEnumsCommandOutput | JsonIntEnumsCommandOutput @@ -568,6 +617,8 @@ export type ServiceOutputTypes = | OmitsSerializingEmptyListsCommandOutput | OperationWithDefaultsCommandOutput | OperationWithNestedStructureCommandOutput + | OutputStreamCommandOutput + | OutputStreamWithInitialResponseCommandOutput | PostPlayerActionCommandOutput | PostUnionWithJsonNameCommandOutput | PutWithContentEncodingCommandOutput @@ -748,6 +799,11 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ protocol?: ClientProtocol; + /** + * The function that provides necessary utilities for generating and parsing event stream + */ + eventStreamSerdeProvider?: __EventStreamSerdeProvider; + /** * A function that, given a hash constructor and a stream, calculates the * hash of the streamed value. @@ -767,6 +823,12 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; + /** + * The function that provides necessary utilities for handling request event stream. + * @internal + */ + eventStreamPayloadHandlerProvider?: __EventStreamPayloadHandlerProvider; + /** * The internal function that inject utilities to runtime-specific stream to help users consume the data * @internal @@ -785,7 +847,9 @@ export type RestJsonProtocolClientConfigType = Partial<__SmithyConfiguration<__H HostHeaderInputConfig & EndpointInputConfig & DefaultAwsRegionalEndpointsInputConfig & + EventStreamSerdeInputConfig & HttpAuthSchemeInputConfig & + EventStreamInputConfig & CompressionInputConfig & ClientInputEndpointParameters; /** @@ -807,7 +871,9 @@ export type RestJsonProtocolClientResolvedConfigType = __SmithyResolvedConfigura HostHeaderResolvedConfig & EndpointResolvedConfig & DefaultAwsRegionalEndpointsResolvedConfig & + EventStreamSerdeResolvedConfig & HttpAuthSchemeResolvedConfig & + EventStreamResolvedConfig & CompressionResolvedConfig & ClientResolvedEndpointParameters; /** @@ -818,7 +884,6 @@ export type RestJsonProtocolClientResolvedConfigType = __SmithyResolvedConfigura export interface RestJsonProtocolClientResolvedConfig extends RestJsonProtocolClientResolvedConfigType {} /** - * A REST JSON service that sends JSON requests and responses. * @public */ export class RestJsonProtocolClient extends __Client< @@ -843,10 +908,12 @@ export class RestJsonProtocolClient extends __Client< const _config_5 = resolveHostHeaderConfig(_config_4); const _config_6 = resolveEndpointConfig(_config_5); const _config_7 = resolveDefaultAwsRegionalEndpointsConfig(_config_6); - const _config_8 = resolveHttpAuthSchemeConfig(_config_7); - const _config_9 = resolveCompressionConfig(_config_8); - const _config_10 = resolveRuntimeExtensions(_config_9, configuration?.extensions || []); - this.config = _config_10; + const _config_8 = resolveEventStreamSerdeConfig(_config_7); + const _config_9 = resolveHttpAuthSchemeConfig(_config_8); + const _config_10 = resolveEventStreamConfig(_config_9); + const _config_11 = resolveCompressionConfig(_config_10); + const _config_12 = resolveRuntimeExtensions(_config_11, configuration?.extensions || []); + this.config = _config_12; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); diff --git a/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamCommand.ts new file mode 100644 index 0000000000000..83c93f284ae2a --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamCommand.ts @@ -0,0 +1,178 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +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 { DuplexStreamInput, DuplexStreamOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { DuplexStream } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DuplexStreamCommand}. + */ +export interface DuplexStreamCommandInput extends DuplexStreamInput {} +/** + * @public + * + * The output of {@link DuplexStreamCommand}. + */ +export interface DuplexStreamCommandOutput extends DuplexStreamOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DuplexStreamCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, DuplexStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // DuplexStreamInput + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new DuplexStreamCommand(input); + * const response = await client.send(command); + * // { // DuplexStreamOutput + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param DuplexStreamCommandInput - {@link DuplexStreamCommandInput} + * @returns {@link DuplexStreamCommandOutput} + * @see {@link DuplexStreamCommandInput} for command's `input` shape. + * @see {@link DuplexStreamCommandOutput} 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 DuplexStreamCommand extends $Command + .classBuilder< + DuplexStreamCommandInput, + DuplexStreamCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getEventStreamPlugin(config)]; + }) + .s("RestJson", "DuplexStream", { + /** + * @internal + */ + eventStream: { + input: true, + output: true, + }, + }) + .n("RestJsonProtocolClient", "DuplexStreamCommand") + .sc(DuplexStream) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DuplexStreamInput; + output: DuplexStreamOutput; + }; + sdk: { + input: DuplexStreamCommandInput; + output: DuplexStreamCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamWithDistinctStreamsCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamWithDistinctStreamsCommand.ts new file mode 100644 index 0000000000000..2e4cba2feadb0 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamWithDistinctStreamsCommand.ts @@ -0,0 +1,143 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +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 { DuplexStreamWithDistinctStreamsInput, DuplexStreamWithDistinctStreamsOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { DuplexStreamWithDistinctStreams } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DuplexStreamWithDistinctStreamsCommand}. + */ +export interface DuplexStreamWithDistinctStreamsCommandInput extends DuplexStreamWithDistinctStreamsInput {} +/** + * @public + * + * The output of {@link DuplexStreamWithDistinctStreamsCommand}. + */ +export interface DuplexStreamWithDistinctStreamsCommandOutput + extends DuplexStreamWithDistinctStreamsOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DuplexStreamWithDistinctStreamsCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, DuplexStreamWithDistinctStreamsCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // DuplexStreamWithDistinctStreamsInput + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new DuplexStreamWithDistinctStreamsCommand(input); + * const response = await client.send(command); + * // { // DuplexStreamWithDistinctStreamsOutput + * // stream: { // SingletonEventStream Union: only one key present + * // singleton: { // SingletonEvent + * // value: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param DuplexStreamWithDistinctStreamsCommandInput - {@link DuplexStreamWithDistinctStreamsCommandInput} + * @returns {@link DuplexStreamWithDistinctStreamsCommandOutput} + * @see {@link DuplexStreamWithDistinctStreamsCommandInput} for command's `input` shape. + * @see {@link DuplexStreamWithDistinctStreamsCommandOutput} 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 DuplexStreamWithDistinctStreamsCommand extends $Command + .classBuilder< + DuplexStreamWithDistinctStreamsCommandInput, + DuplexStreamWithDistinctStreamsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getEventStreamPlugin(config)]; + }) + .s("RestJson", "DuplexStreamWithDistinctStreams", { + /** + * @internal + */ + eventStream: { + input: true, + }, + }) + .n("RestJsonProtocolClient", "DuplexStreamWithDistinctStreamsCommand") + .sc(DuplexStreamWithDistinctStreams) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DuplexStreamWithDistinctStreamsInput; + output: DuplexStreamWithDistinctStreamsOutput; + }; + sdk: { + input: DuplexStreamWithDistinctStreamsCommandInput; + output: DuplexStreamWithDistinctStreamsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamWithInitialMessagesCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamWithInitialMessagesCommand.ts new file mode 100644 index 0000000000000..81fa16a02f840 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/DuplexStreamWithInitialMessagesCommand.ts @@ -0,0 +1,184 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +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 { DuplexStreamWithInitialMessagesInput, DuplexStreamWithInitialMessagesOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { DuplexStreamWithInitialMessages } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DuplexStreamWithInitialMessagesCommand}. + */ +export interface DuplexStreamWithInitialMessagesCommandInput extends DuplexStreamWithInitialMessagesInput {} +/** + * @public + * + * The output of {@link DuplexStreamWithInitialMessagesCommand}. + */ +export interface DuplexStreamWithInitialMessagesCommandOutput + extends DuplexStreamWithInitialMessagesOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DuplexStreamWithInitialMessagesCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, DuplexStreamWithInitialMessagesCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // DuplexStreamWithInitialMessagesInput + * initialRequestMember: "STRING_VALUE", // required + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new DuplexStreamWithInitialMessagesCommand(input); + * const response = await client.send(command); + * // { // DuplexStreamWithInitialMessagesOutput + * // initialResponseMember: "STRING_VALUE", // required + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param DuplexStreamWithInitialMessagesCommandInput - {@link DuplexStreamWithInitialMessagesCommandInput} + * @returns {@link DuplexStreamWithInitialMessagesCommandOutput} + * @see {@link DuplexStreamWithInitialMessagesCommandInput} for command's `input` shape. + * @see {@link DuplexStreamWithInitialMessagesCommandOutput} for command's `response` shape. + * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape. + * + * @throws {@link ServiceUnavailableError} (server fault) + * + * @throws {@link RestJsonProtocolServiceException} + *

Base exception class for all service exceptions from RestJsonProtocol service.

+ * + * + */ +export class DuplexStreamWithInitialMessagesCommand extends $Command + .classBuilder< + DuplexStreamWithInitialMessagesCommandInput, + DuplexStreamWithInitialMessagesCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getEventStreamPlugin(config)]; + }) + .s("RestJson", "DuplexStreamWithInitialMessages", { + /** + * @internal + */ + eventStream: { + input: true, + output: true, + }, + }) + .n("RestJsonProtocolClient", "DuplexStreamWithInitialMessagesCommand") + .sc(DuplexStreamWithInitialMessages) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DuplexStreamWithInitialMessagesInput; + output: DuplexStreamWithInitialMessagesOutput; + }; + sdk: { + input: DuplexStreamWithInitialMessagesCommandInput; + output: DuplexStreamWithInitialMessagesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/HttpQueryParamsOnlyOperationCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/HttpQueryParamsOnlyOperationCommand.ts new file mode 100644 index 0000000000000..c10128543f67d --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/HttpQueryParamsOnlyOperationCommand.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 { HttpQueryParamsOnlyInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { HttpQueryParamsOnlyOperation } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpQueryParamsOnlyOperationCommand}. + */ +export interface HttpQueryParamsOnlyOperationCommandInput extends HttpQueryParamsOnlyInput {} +/** + * @public + * + * The output of {@link HttpQueryParamsOnlyOperationCommand}. + */ +export interface HttpQueryParamsOnlyOperationCommandOutput extends __MetadataBearer {} + +/** + * This example tests httpQueryParams when no other query parameters exist. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpQueryParamsOnlyOperationCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, HttpQueryParamsOnlyOperationCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpQueryParamsOnlyInput + * queryMap: { // QueryMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new HttpQueryParamsOnlyOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpQueryParamsOnlyOperationCommandInput - {@link HttpQueryParamsOnlyOperationCommandInput} + * @returns {@link HttpQueryParamsOnlyOperationCommandOutput} + * @see {@link HttpQueryParamsOnlyOperationCommandInput} for command's `input` shape. + * @see {@link HttpQueryParamsOnlyOperationCommandOutput} 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 HttpQueryParamsOnlyOperationCommand extends $Command + .classBuilder< + HttpQueryParamsOnlyOperationCommandInput, + HttpQueryParamsOnlyOperationCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "HttpQueryParamsOnlyOperation", {}) + .n("RestJsonProtocolClient", "HttpQueryParamsOnlyOperationCommand") + .sc(HttpQueryParamsOnlyOperation) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpQueryParamsOnlyInput; + output: {}; + }; + sdk: { + input: HttpQueryParamsOnlyOperationCommandInput; + output: HttpQueryParamsOnlyOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/InputStreamCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/InputStreamCommand.ts new file mode 100644 index 0000000000000..2151adefcddb8 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/InputStreamCommand.ts @@ -0,0 +1,135 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +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 { InputStreamInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { InputStream } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InputStreamCommand}. + */ +export interface InputStreamCommandInput extends InputStreamInput {} +/** + * @public + * + * The output of {@link InputStreamCommand}. + */ +export interface InputStreamCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, InputStreamCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, InputStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // InputStreamInput + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new InputStreamCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param InputStreamCommandInput - {@link InputStreamCommandInput} + * @returns {@link InputStreamCommandOutput} + * @see {@link InputStreamCommandInput} for command's `input` shape. + * @see {@link InputStreamCommandOutput} 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 InputStreamCommand extends $Command + .classBuilder< + InputStreamCommandInput, + InputStreamCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getEventStreamPlugin(config)]; + }) + .s("RestJson", "InputStream", { + /** + * @internal + */ + eventStream: { + input: true, + }, + }) + .n("RestJsonProtocolClient", "InputStreamCommand") + .sc(InputStream) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: InputStreamInput; + output: {}; + }; + sdk: { + input: InputStreamCommandInput; + output: InputStreamCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/InputStreamWithInitialRequestCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/InputStreamWithInitialRequestCommand.ts new file mode 100644 index 0000000000000..873ec8acc8575 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/InputStreamWithInitialRequestCommand.ts @@ -0,0 +1,136 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +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 { InputStreamWithInitialRequestInput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { InputStreamWithInitialRequest } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InputStreamWithInitialRequestCommand}. + */ +export interface InputStreamWithInitialRequestCommandInput extends InputStreamWithInitialRequestInput {} +/** + * @public + * + * The output of {@link InputStreamWithInitialRequestCommand}. + */ +export interface InputStreamWithInitialRequestCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, InputStreamWithInitialRequestCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, InputStreamWithInitialRequestCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // InputStreamWithInitialRequestInput + * initialRequestMember: "STRING_VALUE", // required + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new InputStreamWithInitialRequestCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param InputStreamWithInitialRequestCommandInput - {@link InputStreamWithInitialRequestCommandInput} + * @returns {@link InputStreamWithInitialRequestCommandOutput} + * @see {@link InputStreamWithInitialRequestCommandInput} for command's `input` shape. + * @see {@link InputStreamWithInitialRequestCommandOutput} 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 InputStreamWithInitialRequestCommand extends $Command + .classBuilder< + InputStreamWithInitialRequestCommandInput, + InputStreamWithInitialRequestCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getEventStreamPlugin(config)]; + }) + .s("RestJson", "InputStreamWithInitialRequest", { + /** + * @internal + */ + eventStream: { + input: true, + }, + }) + .n("RestJsonProtocolClient", "InputStreamWithInitialRequestCommand") + .sc(InputStreamWithInitialRequest) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: InputStreamWithInitialRequestInput; + output: {}; + }; + sdk: { + input: InputStreamWithInitialRequestCommandInput; + output: InputStreamWithInitialRequestCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/OutputStreamCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/OutputStreamCommand.ts new file mode 100644 index 0000000000000..cdf5c3e067e8f --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/OutputStreamCommand.ts @@ -0,0 +1,136 @@ +// smithy-typescript 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 { OutputStreamOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { OutputStream } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OutputStreamCommand}. + */ +export interface OutputStreamCommandInput {} +/** + * @public + * + * The output of {@link OutputStreamCommand}. + */ +export interface OutputStreamCommandOutput extends OutputStreamOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OutputStreamCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, OutputStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new OutputStreamCommand(input); + * const response = await client.send(command); + * // { // OutputStreamOutput + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param OutputStreamCommandInput - {@link OutputStreamCommandInput} + * @returns {@link OutputStreamCommandOutput} + * @see {@link OutputStreamCommandInput} for command's `input` shape. + * @see {@link OutputStreamCommandOutput} for command's `response` shape. + * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape. + * + * @throws {@link ServiceUnavailableError} (server fault) + * + * @throws {@link RestJsonProtocolServiceException} + *

Base exception class for all service exceptions from RestJsonProtocol service.

+ * + * + */ +export class OutputStreamCommand extends $Command + .classBuilder< + OutputStreamCommandInput, + OutputStreamCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "OutputStream", { + /** + * @internal + */ + eventStream: { + output: true, + }, + }) + .n("RestJsonProtocolClient", "OutputStreamCommand") + .sc(OutputStream) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: OutputStreamOutput; + }; + sdk: { + input: OutputStreamCommandInput; + output: OutputStreamCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/OutputStreamWithInitialResponseCommand.ts b/private/aws-protocoltests-restjson-schema/src/commands/OutputStreamWithInitialResponseCommand.ts new file mode 100644 index 0000000000000..0db1d13328e18 --- /dev/null +++ b/private/aws-protocoltests-restjson-schema/src/commands/OutputStreamWithInitialResponseCommand.ts @@ -0,0 +1,137 @@ +// smithy-typescript 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 { OutputStreamWithInitialResponseOutput } from "../models/models_0"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; +import { OutputStreamWithInitialResponse } from "../schemas/schemas_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OutputStreamWithInitialResponseCommand}. + */ +export interface OutputStreamWithInitialResponseCommandInput {} +/** + * @public + * + * The output of {@link OutputStreamWithInitialResponseCommand}. + */ +export interface OutputStreamWithInitialResponseCommandOutput + extends OutputStreamWithInitialResponseOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OutputStreamWithInitialResponseCommand } from "@aws-sdk/aws-protocoltests-restjson-schema"; // ES Modules import + * // const { RestJsonProtocolClient, OutputStreamWithInitialResponseCommand } = require("@aws-sdk/aws-protocoltests-restjson-schema"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson-schema"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new OutputStreamWithInitialResponseCommand(input); + * const response = await client.send(command); + * // { // OutputStreamWithInitialResponseOutput + * // initialResponseMember: "STRING_VALUE", // required + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param OutputStreamWithInitialResponseCommandInput - {@link OutputStreamWithInitialResponseCommandInput} + * @returns {@link OutputStreamWithInitialResponseCommandOutput} + * @see {@link OutputStreamWithInitialResponseCommandInput} for command's `input` shape. + * @see {@link OutputStreamWithInitialResponseCommandOutput} 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 OutputStreamWithInitialResponseCommand extends $Command + .classBuilder< + OutputStreamWithInitialResponseCommandInput, + OutputStreamWithInitialResponseCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }) + .s("RestJson", "OutputStreamWithInitialResponse", { + /** + * @internal + */ + eventStream: { + output: true, + }, + }) + .n("RestJsonProtocolClient", "OutputStreamWithInitialResponseCommand") + .sc(OutputStreamWithInitialResponse) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: OutputStreamWithInitialResponseOutput; + }; + sdk: { + input: OutputStreamWithInitialResponseCommandInput; + output: OutputStreamWithInitialResponseCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson-schema/src/commands/index.ts b/private/aws-protocoltests-restjson-schema/src/commands/index.ts index f7eda19004821..de51781237b5e 100644 --- a/private/aws-protocoltests-restjson-schema/src/commands/index.ts +++ b/private/aws-protocoltests-restjson-schema/src/commands/index.ts @@ -7,6 +7,9 @@ export * from "./DatetimeOffsetsCommand"; export * from "./DocumentTypeAsMapValueCommand"; export * from "./DocumentTypeAsPayloadCommand"; export * from "./DocumentTypeCommand"; +export * from "./DuplexStreamCommand"; +export * from "./DuplexStreamWithDistinctStreamsCommand"; +export * from "./DuplexStreamWithInitialMessagesCommand"; export * from "./EmptyInputAndEmptyOutputCommand"; export * from "./EndpointOperationCommand"; export * from "./EndpointWithHostLabelOperationCommand"; @@ -22,6 +25,7 @@ export * from "./HttpPayloadWithStructureCommand"; export * from "./HttpPayloadWithUnionCommand"; export * from "./HttpPrefixHeadersCommand"; export * from "./HttpPrefixHeadersInResponseCommand"; +export * from "./HttpQueryParamsOnlyOperationCommand"; export * from "./HttpRequestWithFloatLabelsCommand"; export * from "./HttpRequestWithGreedyLabelInPathCommand"; export * from "./HttpRequestWithLabelsAndTimestampFormatCommand"; @@ -31,6 +35,8 @@ export * from "./HttpResponseCodeCommand"; export * from "./HttpStringPayloadCommand"; export * from "./IgnoreQueryParamsInResponseCommand"; export * from "./InputAndOutputWithHeadersCommand"; +export * from "./InputStreamCommand"; +export * from "./InputStreamWithInitialRequestCommand"; export * from "./JsonBlobsCommand"; export * from "./JsonEnumsCommand"; export * from "./JsonIntEnumsCommand"; @@ -80,6 +86,8 @@ export * from "./OmitsNullSerializesEmptyStringCommand"; export * from "./OmitsSerializingEmptyListsCommand"; export * from "./OperationWithDefaultsCommand"; export * from "./OperationWithNestedStructureCommand"; +export * from "./OutputStreamCommand"; +export * from "./OutputStreamWithInitialResponseCommand"; export * from "./PostPlayerActionCommand"; export * from "./PostUnionWithJsonNameCommand"; export * from "./PutWithContentEncodingCommand"; diff --git a/private/aws-protocoltests-restjson-schema/src/index.ts b/private/aws-protocoltests-restjson-schema/src/index.ts index c9920e5b09f8c..378b1c6297a90 100644 --- a/private/aws-protocoltests-restjson-schema/src/index.ts +++ b/private/aws-protocoltests-restjson-schema/src/index.ts @@ -1,10 +1,5 @@ // 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"; diff --git a/private/aws-protocoltests-restjson-schema/src/models/errors.ts b/private/aws-protocoltests-restjson-schema/src/models/errors.ts index f6cbb02088ef0..bd41d2117bd95 100644 --- a/private/aws-protocoltests-restjson-schema/src/models/errors.ts +++ b/private/aws-protocoltests-restjson-schema/src/models/errors.ts @@ -30,6 +30,44 @@ export class ComplexError extends __BaseException { } } +/** + * @public + */ +export class ErrorEvent extends __BaseException { + readonly name = "ErrorEvent" as const; + readonly $fault = "client" as const; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ErrorEvent", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ErrorEvent.prototype); + } +} + +/** + * @public + */ +export class ServiceUnavailableError extends __BaseException { + readonly name = "ServiceUnavailableError" as const; + readonly $fault = "server" as const; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceUnavailableError", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, ServiceUnavailableError.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. diff --git a/private/aws-protocoltests-restjson-schema/src/models/models_0.ts b/private/aws-protocoltests-restjson-schema/src/models/models_0.ts index d7c1ca81cebda..bf0822ea96dfd 100644 --- a/private/aws-protocoltests-restjson-schema/src/models/models_0.ts +++ b/private/aws-protocoltests-restjson-schema/src/models/models_0.ts @@ -3,6 +3,7 @@ import { AutomaticJsonStringConversion as __AutomaticJsonStringConversion } from import { DocumentType as __DocumentType, StreamingBlobTypes } from "@smithy/types"; import { FooEnum, IntegerEnum, StringEnum, TestEnum, TestIntEnum } from "./enums"; +import { ErrorEvent } from "./errors"; /** * @public @@ -38,6 +39,13 @@ export interface AllQueryStringTypesInput { queryParamsMapOfStringList?: Record | undefined; } +/** + * @public + */ +export interface BlobPayloadEvent { + payload?: Uint8Array | undefined; +} + /** * @public */ @@ -158,6 +166,325 @@ export interface DocumentTypeAsPayloadInputOutput { documentValue?: __DocumentType | undefined; } +/** + * @public + */ +export interface HeadersEvent { + booleanHeader?: boolean | undefined; + byteHeader?: number | undefined; + shortHeader?: number | undefined; + intHeader?: number | undefined; + longHeader?: number | undefined; + blobHeader?: Uint8Array | undefined; + stringHeader?: string | undefined; + timestampHeader?: Date | undefined; +} + +/** + * @public + */ +export interface PayloadStructure { + structureMember?: string | undefined; +} + +/** + * @public + */ +export interface HeadersAndExplicitPayloadEvent { + header?: string | undefined; + payload?: PayloadStructure | undefined; +} + +/** + * @public + */ +export interface HeadersAndImplicitPayloadEvent { + header?: string | undefined; + payload?: string | undefined; +} + +/** + * @public + */ +export interface StringPayloadEvent { + payload?: string | undefined; +} + +/** + * @public + */ +export interface StructurePayloadEvent { + payload?: PayloadStructure | undefined; +} + +/** + * @public + */ +export type PayloadUnion = PayloadUnion.UnionMemberMember | PayloadUnion.$UnknownMember; + +/** + * @public + */ +export namespace PayloadUnion { + export interface UnionMemberMember { + unionMember: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + unionMember?: never; + $unknown: [string, any]; + } + + /** + * @deprecated unused in schema-serde mode. + * + */ + export interface Visitor { + unionMember: (value: string) => T; + _: (name: string, value: any) => T; + } +} + +/** + * @public + */ +export interface UnionPayloadEvent { + payload?: PayloadUnion | undefined; +} + +/** + * @public + */ +export type EventStream = + | EventStream.BlobPayloadMember + | EventStream.ErrorMember + | EventStream.HeadersMember + | EventStream.HeadersAndExplicitPayloadMember + | EventStream.HeadersAndImplicitPayloadMember + | EventStream.StringPayloadMember + | EventStream.StructurePayloadMember + | EventStream.UnionPayloadMember + | EventStream.$UnknownMember; + +/** + * @public + */ +export namespace EventStream { + export interface HeadersMember { + headers: HeadersEvent; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface BlobPayloadMember { + headers?: never; + blobPayload: BlobPayloadEvent; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface StringPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload: StringPayloadEvent; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface StructurePayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload: StructurePayloadEvent; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface UnionPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload: UnionPayloadEvent; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface HeadersAndExplicitPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload: HeadersAndExplicitPayloadEvent; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface HeadersAndImplicitPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload: HeadersAndImplicitPayloadEvent; + error?: never; + $unknown?: never; + } + + export interface ErrorMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error: ErrorEvent; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown: [string, any]; + } + + /** + * @deprecated unused in schema-serde mode. + * + */ + export interface Visitor { + headers: (value: HeadersEvent) => T; + blobPayload: (value: BlobPayloadEvent) => T; + stringPayload: (value: StringPayloadEvent) => T; + structurePayload: (value: StructurePayloadEvent) => T; + unionPayload: (value: UnionPayloadEvent) => T; + headersAndExplicitPayload: (value: HeadersAndExplicitPayloadEvent) => T; + headersAndImplicitPayload: (value: HeadersAndImplicitPayloadEvent) => T; + error: (value: ErrorEvent) => T; + _: (name: string, value: any) => T; + } +} + +/** + * @public + */ +export interface DuplexStreamInput { + stream?: AsyncIterable | undefined; +} + +/** + * @public + */ +export interface DuplexStreamOutput { + stream?: AsyncIterable | undefined; +} + +/** + * @public + */ +export interface DuplexStreamWithDistinctStreamsInput { + stream?: AsyncIterable | undefined; +} + +/** + * @public + */ +export interface SingletonEvent { + value?: string | undefined; +} + +/** + * @public + */ +export type SingletonEventStream = SingletonEventStream.SingletonMember | SingletonEventStream.$UnknownMember; + +/** + * @public + */ +export namespace SingletonEventStream { + export interface SingletonMember { + singleton: SingletonEvent; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + singleton?: never; + $unknown: [string, any]; + } + + /** + * @deprecated unused in schema-serde mode. + * + */ + export interface Visitor { + singleton: (value: SingletonEvent) => T; + _: (name: string, value: any) => T; + } +} + +/** + * @public + */ +export interface DuplexStreamWithDistinctStreamsOutput { + stream?: SingletonEventStream | undefined; +} + +/** + * @public + */ +export interface DuplexStreamWithInitialMessagesInput { + initialRequestMember: string | undefined; + stream?: AsyncIterable | undefined; +} + +/** + * @public + */ +export interface DuplexStreamWithInitialMessagesOutput { + initialResponseMember: string | undefined; + stream?: AsyncIterable | undefined; +} + /** * @public */ @@ -317,6 +644,13 @@ export interface HttpPrefixHeadersInResponseOutput { prefixHeaders?: Record | undefined; } +/** + * @public + */ +export interface HttpQueryParamsOnlyInput { + queryMap?: Record | undefined; +} + /** * @public */ @@ -421,6 +755,21 @@ export interface InputAndOutputWithHeadersIO { headerIntegerEnumList?: IntegerEnum[] | undefined; } +/** + * @public + */ +export interface InputStreamInput { + stream?: AsyncIterable | undefined; +} + +/** + * @public + */ +export interface InputStreamWithInitialRequestInput { + initialRequestMember: string | undefined; + stream?: AsyncIterable | undefined; +} + /** * @public */ @@ -1111,6 +1460,21 @@ export interface OperationWithNestedStructureOutput { dialogMap?: Record | undefined; } +/** + * @public + */ +export interface OutputStreamOutput { + stream?: AsyncIterable | undefined; +} + +/** + * @public + */ +export interface OutputStreamWithInitialResponseOutput { + initialResponseMember: string | undefined; + stream?: AsyncIterable | undefined; +} + /** * @public */ diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.browser.ts b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.browser.ts index 397966de10cf6..2b16c22f9d875 100644 --- a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.browser.ts @@ -5,9 +5,10 @@ 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 { eventStreamSerdeProvider } from "@smithy/eventstream-serde-browser"; 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 { invalidFunction, invalidProvider } from "@smithy/invalid-dependency"; import { Md5 } from "@smithy/md5-js"; import { DEFAULT_DISABLE_REQUEST_COMPRESSION, @@ -39,6 +40,10 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + eventStreamPayloadHandlerProvider: + config?.eventStreamPayloadHandlerProvider ?? + (() => ({ handle: invalidFunction("event stream request is not supported in browser.") })), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, md5: config?.md5 ?? Md5, region: config?.region ?? invalidProvider("Region is missing"), diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.native.ts b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.native.ts index 48bc89d417bd9..413dc1c065160 100644 --- a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.native.ts +++ b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.native.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { Sha256 } from "@aws-crypto/sha256-js"; +import { invalidFunction } from "@smithy/invalid-dependency"; import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; @@ -13,6 +14,9 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { ...browserDefaults, ...config, runtime: "react-native", + eventStreamPayloadHandlerProvider: + config?.eventStreamPayloadHandlerProvider ?? + (() => ({ handle: invalidFunction("event stream request is not supported in ReactNative.") })), sha256: config?.sha256 ?? Sha256, }; }; diff --git a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.ts b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.ts index f5f4b2fb3ca27..bdc0958ab8a38 100644 --- a/private/aws-protocoltests-restjson-schema/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restjson-schema/src/runtimeConfig.ts @@ -4,6 +4,7 @@ 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 { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node"; import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; import { NODE_REGION_CONFIG_FILE_OPTIONS, @@ -11,6 +12,7 @@ import { NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver"; +import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-node"; import { Hash } from "@smithy/hash-node"; import { fileStreamHasher as streamHasher } from "@smithy/hash-stream-node"; import { @@ -55,6 +57,8 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), md5: config?.md5 ?? Hash.bind(null, "md5"), region: diff --git a/private/aws-protocoltests-restjson-schema/src/schemas/schemas_0.ts b/private/aws-protocoltests-restjson-schema/src/schemas/schemas_0.ts index b3e64dd02d119..e3e75158e7f11 100644 --- a/private/aws-protocoltests-restjson-schema/src/schemas/schemas_0.ts +++ b/private/aws-protocoltests-restjson-schema/src/schemas/schemas_0.ts @@ -3,6 +3,7 @@ const _AQST = "AllQueryStringTypes"; const _AQSTI = "AllQueryStringTypesInput"; const _B = "Byte"; const _BL = "BooleanList"; +const _BPE = "BlobPayloadEvent"; const _Bo = "Boolean"; const _CAVQS = "ConstantAndVariableQueryString"; const _CAVQSI = "ConstantAndVariableQueryStringInput"; @@ -23,8 +24,17 @@ const _DLi = "DialogList"; const _DM = "DialogMap"; const _DO = "DatetimeOffsets"; const _DOO = "DatetimeOffsetsOutput"; +const _DS = "DuplexStream"; +const _DSI = "DuplexStreamInput"; const _DSM = "DenseSetMap"; const _DSMe = "DenseStructMap"; +const _DSO = "DuplexStreamOutput"; +const _DSWDS = "DuplexStreamWithDistinctStreams"; +const _DSWDSI = "DuplexStreamWithDistinctStreamsInput"; +const _DSWDSO = "DuplexStreamWithDistinctStreamsOutput"; +const _DSWIM = "DuplexStreamWithInitialMessages"; +const _DSWIMI = "DuplexStreamWithInitialMessagesInput"; +const _DSWIMO = "DuplexStreamWithInitialMessagesOutput"; const _DT = "DocumentType"; const _DTAMV = "DocumentTypeAsMapValue"; const _DTAMVIO = "DocumentTypeAsMapValueInputOutput"; @@ -34,12 +44,14 @@ const _DTIO = "DocumentTypeInputOutput"; const _De = "Defaults"; const _Di = "Dialog"; const _E = "Enum"; +const _EE = "ErrorEvent"; const _EIAEO = "EmptyInputAndEmptyOutput"; const _EIAEOI = "EmptyInputAndEmptyOutputInput"; const _EIAEOO = "EmptyInputAndEmptyOutputOutput"; const _EL = "EnumList"; const _EO = "EndpointOperation"; const _EPI = "EnumPayloadInput"; +const _ES = "EventStream"; const _EWHLO = "EndpointWithHostLabelOperation"; const _Em = "Empty"; const _F = "Float"; @@ -55,8 +67,11 @@ const _GS = "GreetingStruct"; const _GWE = "GreetingWithErrors"; const _GWEO = "GreetingWithErrorsOutput"; const _H = "Header"; +const _HAEPE = "HeadersAndExplicitPayloadEvent"; +const _HAIPE = "HeadersAndImplicitPayloadEvent"; const _HCR = "HttpChecksumRequired"; const _HCRIO = "HttpChecksumRequiredInputOutput"; +const _HE = "HeadersEvent"; const _HEP = "HttpEnumPayload"; const _HEPH = "HttpEmptyPrefixHeaders"; const _HEPHI = "HttpEmptyPrefixHeadersInput"; @@ -76,6 +91,8 @@ const _HPWS = "HttpPayloadWithStructure"; const _HPWSIO = "HttpPayloadWithStructureInputOutput"; const _HPWU = "HttpPayloadWithUnion"; const _HPWUIO = "HttpPayloadWithUnionInputOutput"; +const _HQPOI = "HttpQueryParamsOnlyInput"; +const _HQPOO = "HttpQueryParamsOnlyOperation"; const _HRC = "HttpResponseCode"; const _HRCO = "HttpResponseCodeOutput"; const _HRWFL = "HttpRequestWithFloatLabels"; @@ -100,6 +117,10 @@ const _IL = "IntegerList"; const _IQPIR = "IgnoreQueryParamsInResponse"; const _IQPIRO = "IgnoreQueryParamsInResponseOutput"; const _IS = "IntegerSet"; +const _ISI = "InputStreamInput"; +const _ISWIR = "InputStreamWithInitialRequest"; +const _ISWIRI = "InputStreamWithInitialRequestInput"; +const _ISn = "InputStream"; const _JB = "JpegBlob"; const _JBIO = "JsonBlobsInputOutput"; const _JBs = "JsonBlobs"; @@ -197,8 +218,12 @@ const _NSL = "NestedStringList"; const _Nu = "Null"; const _ONSES = "OmitsNullSerializesEmptyString"; const _ONSESI = "OmitsNullSerializesEmptyStringInput"; +const _OS = "OutputStream"; const _OSEL = "OmitsSerializingEmptyLists"; const _OSELI = "OmitsSerializingEmptyListsInput"; +const _OSO = "OutputStreamOutput"; +const _OSWIR = "OutputStreamWithInitialResponse"; +const _OSWIRO = "OutputStreamWithInitialResponseOutput"; const _OWD = "OperationWithDefaults"; const _OWDI = "OperationWithDefaultsInput"; const _OWDO = "OperationWithDefaultsOutput"; @@ -210,6 +235,8 @@ const _PC = "PayloadConfig"; const _PPA = "PostPlayerAction"; const _PPAI = "PostPlayerActionInput"; const _PPAO = "PostPlayerActionOutput"; +const _PS = "PayloadStructure"; +const _PU = "PayloadUnion"; const _PUWJN = "PostUnionWithJsonName"; const _PUWJNI = "PostUnionWithJsonNameInput"; const _PUWJNO = "PostUnionWithJsonNameOutput"; @@ -232,6 +259,8 @@ const _RSIONe = "RecursiveShapesInputOutputNested2"; const _S = "String"; const _SB = "StreamingBlob"; const _SBM = "SparseBooleanMap"; +const _SE = "SingletonEvent"; +const _SES = "SingletonEventStream"; const _SJL = "SparseJsonLists"; const _SJLIO = "SparseJsonListsInputOutput"; const _SJM = "SparseJsonMaps"; @@ -241,6 +270,8 @@ const _SLM = "StringListMap"; const _SLMt = "StructureListMember"; const _SLt = "StructureList"; const _SNM = "SparseNumberMap"; +const _SPE = "StringPayloadEvent"; +const _SPEt = "StructurePayloadEvent"; const _SPI = "StringPayloadInput"; const _SS = "StringSet"; const _SSL = "SparseShortList"; @@ -258,6 +289,7 @@ const _STRLI = "StreamingTraitsRequireLengthInput"; const _STWMT = "StreamingTraitsWithMediaType"; const _STWMTIO = "StreamingTraitsWithMediaTypeInputOutput"; const _SU = "SimpleUnion"; +const _SUE = "ServiceUnavailableError"; const _Sh = "Short"; const _St = "Status"; const _T = "Timestamp"; @@ -281,6 +313,7 @@ const _TPSIO = "TestPayloadStructureInputOutput"; const _UIAO = "UnitInputAndOutput"; const _UIO = "UnionInputOutput"; const _UP = "UnionPayload"; +const _UPE = "UnionPayloadEvent"; const _UWJN = "UnionWithJsonName"; const _XA = "X-A"; const _XATI = "X-Amz-Test-Id"; @@ -320,6 +353,9 @@ const _a_ = "a"; const _ac = "action"; const _amth = "amz-media-typed-header"; const _b = "baz"; +const _bH = "booleanHeader"; +const _bHl = "blobHeader"; +const _bHy = "byteHeader"; const _bIB = "booleanInBody"; const _bIBy = "byteInBody"; const _bIH = "booleanInHeader"; @@ -331,6 +367,7 @@ const _bIQy = "byteInQuery"; const _bL = "booleanList"; const _bLo = "bodyList"; const _bM = "bodyMap"; +const _bP = "blobPayload"; const _bV = "byteValue"; const _bVl = "blobValue"; const _bVo = "booleanValue"; @@ -388,7 +425,9 @@ const _di = "dialog"; const _do = "double"; const _e = "error"; const _eB = "emptyBlob"; +const _eH = "eventHeader"; const _eL = "enumList"; +const _eP = "eventPayload"; const _eS = "emptyString"; const _eSOT = "epochSecondsOnTarget"; const _eSp = "epochSeconds"; @@ -414,6 +453,8 @@ const _fl = "float"; const _fo = "foo"; const _g = "greeting"; const _h = "hello"; +const _hAEP = "headersAndExplicitPayload"; +const _hAIP = "headersAndImplicitPayload"; const _hB = "headerByte"; const _hBL = "headerBooleanList"; const _hCR = "httpChecksumRequired"; @@ -441,6 +482,7 @@ const _hSe = "headerShort"; const _hTB = "headerTrueBool"; const _hTL = "headerTimestampList"; const _he = "header"; +const _hea = "headers"; const _hi = "hi"; const _ht = "http"; const _i = "image/jpeg"; @@ -451,18 +493,24 @@ const _iEM = "integerEnumMap"; const _iES = "integerEnumSet"; const _iEn = "integerEnum2"; const _iEnt = "integerEnum3"; +const _iH = "intHeader"; const _iIB = "integerInBody"; const _iIH = "integerInHeader"; const _iIP = "integerInPath"; const _iIQ = "integerInQuery"; const _iL = "integerList"; +const _iRM = "initialRequestMember"; +const _iRMn = "initialResponseMember"; const _iT = "idempotencyToken"; const _iV = "integerValue"; const _in = "integer"; const _int = "int"; +const _irm = "initial-request-member"; +const _irm_ = "initial-response-member"; const _j = "json"; const _jN = "jsonName"; const _l = "language"; +const _lH = "longHeader"; const _lIB = "longInBody"; const _lIH = "longInHeader"; const _lIP = "longInPath"; @@ -479,6 +527,7 @@ const _mS = "maybeSet"; const _mSL = "myStructureList"; const _mT = "mediaType"; const _mV = "mapValue"; +const _me = "message"; const _n = "nested"; const _nSL = "nestedStringList"; const _nV = "nullValue"; @@ -506,6 +555,7 @@ const _qIEL = "queryIntegerEnumList"; const _qIL = "queryIntegerList"; const _qIS = "queryIntegerSet"; const _qL = "queryLong"; +const _qM = "queryMap"; const _qPMOSL = "queryParamsMapOfStringList"; const _qS = "queryString"; const _qSL = "queryStringList"; @@ -520,14 +570,19 @@ const _rM = "recursiveMember"; const _rSV = "renamedStructureValue"; const _s = "streaming"; const _sBM = "sparseBooleanMap"; -const _sH = "specificHeader"; +const _sH = "shortHeader"; +const _sHp = "specificHeader"; +const _sHt = "stringHeader"; const _sIB = "shortInBody"; const _sIH = "shortInHeader"; const _sIP = "shortInPath"; const _sIQ = "shortInQuery"; const _sL = "stringList"; const _sLt = "structureList"; +const _sM = "structureMember"; const _sNM = "sparseNumberMap"; +const _sP = "stringPayload"; +const _sPt = "structurePayload"; const _sS = "stringSet"; const _sSL = "sparseStringList"; const _sSLp = "sparseShortList"; @@ -540,15 +595,18 @@ const _sVt = "structureValue"; const _sa = "salutation"; const _se = "server"; const _sh = "short"; +const _si = "singleton"; const _sm = "smithy.ts.sdk.synthetic.aws.protocoltests.restjson"; const _sp = "sparse"; -const _st = "string"; -const _str = "str"; +const _st = "stream"; +const _str = "string"; +const _str_ = "str"; const _t = "text/plain"; const _tBV = "trueBooleanValue"; const _tC = "testConfig"; const _tDT = "targetDateTime"; const _tES = "targetEpochSeconds"; +const _tH = "timestampHeader"; const _tHD = "targetHttpDate"; const _tI = "testId"; const _tL = "timestampList"; @@ -559,6 +617,8 @@ const _ti = "timestamp"; const _tim = "timeout"; const _to = "token"; const _u = "union"; +const _uM = "unionMember"; +const _uP = "unionPayload"; const _v = "value"; const _xati = "x-amz-test-id"; const _xf = "x-foo"; @@ -586,8 +646,10 @@ import { import { ComplexError as __ComplexError, + ErrorEvent as __ErrorEvent, FooError as __FooError, InvalidGreeting as __InvalidGreeting, + ServiceUnavailableError as __ServiceUnavailableError, } from "../models/errors"; import { RestJsonProtocolServiceException as __RestJsonProtocolServiceException } from "../models/RestJsonProtocolServiceException"; @@ -810,6 +872,21 @@ export var AllQueryStringTypesInput: StaticStructureSchema = [ [[2, n1, _SLM, 0, 0, 64 | 0], 64], ], ]; +export var BlobPayloadEvent: StaticStructureSchema = [ + 3, + n0, + _BPE, + 0, + [_p], + [ + [ + 21, + { + [_eP]: 1, + }, + ], + ], +]; export var ClientOptionalDefaults: StaticStructureSchema = [3, n0, _COD, 0, [_m], [1]]; export var ComplexError: StaticErrorSchema = [ -3, @@ -914,9 +991,71 @@ export var Dialog: StaticStructureSchema = [3, n0, _Di, 0, [_l, _g, _f], [0, 0, export var DocumentTypeAsMapValueInputOutput: StaticStructureSchema = [3, n0, _DTAMVIO, 0, [_dVM], [128 | 15]]; export var DocumentTypeAsPayloadInputOutput: StaticStructureSchema = [3, n0, _DTAPIO, 0, [_dV], [[15, 16]]]; export var DocumentTypeInputOutput: StaticStructureSchema = [3, n0, _DTIO, 0, [_sV, _dV], [0, 15]]; +export var DuplexStreamInput: StaticStructureSchema = [3, n0, _DSI, 0, [_st], [[() => EventStream, 16]]]; +export var DuplexStreamOutput: StaticStructureSchema = [3, n0, _DSO, 0, [_st], [[() => EventStream, 16]]]; +export var DuplexStreamWithDistinctStreamsInput: StaticStructureSchema = [ + 3, + n0, + _DSWDSI, + 0, + [_st], + [[() => EventStream, 16]], +]; +export var DuplexStreamWithDistinctStreamsOutput: StaticStructureSchema = [ + 3, + n0, + _DSWDSO, + 0, + [_st], + [[() => SingletonEventStream, 16]], +]; +export var DuplexStreamWithInitialMessagesInput: StaticStructureSchema = [ + 3, + n0, + _DSWIMI, + 0, + [_iRM, _st], + [ + [ + 0, + { + [_hH]: _irm, + }, + ], + [() => EventStream, 16], + ], +]; +export var DuplexStreamWithInitialMessagesOutput: StaticStructureSchema = [ + 3, + n0, + _DSWIMO, + 0, + [_iRMn, _st], + [ + [ + 0, + { + [_hH]: _irm_, + }, + ], + [() => EventStream, 16], + ], +]; export var EmptyInputAndEmptyOutputInput: StaticStructureSchema = [3, n0, _EIAEOI, 0, [], []]; export var EmptyInputAndEmptyOutputOutput: StaticStructureSchema = [3, n0, _EIAEOO, 0, [], []]; export var EnumPayloadInput: StaticStructureSchema = [3, n0, _EPI, 0, [_p], [[0, 16]]]; +export var ErrorEvent: StaticErrorSchema = [ + -3, + n0, + _EE, + { + [_e]: _c, + }, + [_me], + [0], +]; +TypeRegistry.for(n0).registerError(ErrorEvent, __ErrorEvent); + export var Farewell: StaticStructureSchema = [3, n0, _Fa, 0, [_ph], [0]]; export var FooError: StaticErrorSchema = [ -3, @@ -947,6 +1086,100 @@ export var GreetingWithErrorsOutput: StaticStructureSchema = [ ], ], ]; +export var HeadersAndExplicitPayloadEvent: StaticStructureSchema = [ + 3, + n0, + _HAEPE, + 0, + [_he, _p], + [ + [ + 0, + { + [_eH]: 1, + }, + ], + [ + () => PayloadStructure, + { + [_eP]: 1, + }, + ], + ], +]; +export var HeadersAndImplicitPayloadEvent: StaticStructureSchema = [ + 3, + n0, + _HAIPE, + 0, + [_he, _p], + [ + [ + 0, + { + [_eH]: 1, + }, + ], + 0, + ], +]; +export var HeadersEvent: StaticStructureSchema = [ + 3, + n0, + _HE, + 0, + [_bH, _bHy, _sH, _iH, _lH, _bHl, _sHt, _tH], + [ + [ + 2, + { + [_eH]: 1, + }, + ], + [ + 1, + { + [_eH]: 1, + }, + ], + [ + 1, + { + [_eH]: 1, + }, + ], + [ + 1, + { + [_eH]: 1, + }, + ], + [ + 1, + { + [_eH]: 1, + }, + ], + [ + 21, + { + [_eH]: 1, + }, + ], + [ + 0, + { + [_eH]: 1, + }, + ], + [ + 5, + { + [_eH]: 1, + }, + ], + ], +]; export var HostLabelInput: StaticStructureSchema = [ 3, n0, @@ -968,7 +1201,7 @@ export var HttpEmptyPrefixHeadersInput: StaticStructureSchema = [ n0, _HEPHI, 0, - [_pH, _sH], + [_pH, _sHp], [ [ 128 | 0, @@ -989,7 +1222,7 @@ export var HttpEmptyPrefixHeadersOutput: StaticStructureSchema = [ n0, _HEPHO, 0, - [_pH, _sH], + [_pH, _sHp], [ [ 128 | 0, @@ -1111,6 +1344,7 @@ export var HttpPrefixHeadersOutput: StaticStructureSchema = [ ], ], ]; +export var HttpQueryParamsOnlyInput: StaticStructureSchema = [3, n0, _HQPOI, 0, [_qM], [[128 | 0, 64]]]; export var HttpRequestWithFloatLabelsInput: StaticStructureSchema = [ 3, n0, @@ -1154,7 +1388,7 @@ export var HttpRequestWithLabelsInput: StaticStructureSchema = [ n0, _HRWLI, 0, - [_st, _sh, _in, _lo, _fl, _do, _bo, _ti], + [_str, _sh, _in, _lo, _fl, _do, _bo, _ti], [ [0, 1], [1, 1], @@ -1166,7 +1400,7 @@ export var HttpRequestWithLabelsInput: StaticStructureSchema = [ [4, 1], ], ]; -export var HttpRequestWithRegexLiteralInput: StaticStructureSchema = [3, n0, _HRWRLI, 0, [_str], [[0, 1]]]; +export var HttpRequestWithRegexLiteralInput: StaticStructureSchema = [3, n0, _HRWRLI, 0, [_str_], [[0, 1]]]; export var HttpResponseCodeOutput: StaticStructureSchema = [3, n0, _HRCO, 0, [_St], [[1, 32]]]; export var IgnoreQueryParamsInResponseOutput: StaticStructureSchema = [ 3, @@ -1300,6 +1534,23 @@ export var InputAndOutputWithHeadersIO: StaticStructureSchema = [ ], ], ]; +export var InputStreamInput: StaticStructureSchema = [3, n0, _ISI, 0, [_st], [[() => EventStream, 16]]]; +export var InputStreamWithInitialRequestInput: StaticStructureSchema = [ + 3, + n0, + _ISWIRI, + 0, + [_iRM, _st], + [ + [ + 0, + { + [_hH]: _irm, + }, + ], + [() => EventStream, 16], + ], +]; export var InvalidGreeting: StaticErrorSchema = [ -3, n0, @@ -1857,7 +2108,25 @@ export var OperationWithNestedStructureOutput: StaticStructureSchema = [ [_di, _dLi, _dMi], [() => Dialog, () => DialogList, () => DialogMap], ]; +export var OutputStreamOutput: StaticStructureSchema = [3, n0, _OSO, 0, [_st], [[() => EventStream, 16]]]; +export var OutputStreamWithInitialResponseOutput: StaticStructureSchema = [ + 3, + n0, + _OSWIRO, + 0, + [_iRMn, _st], + [ + [ + 0, + { + [_hH]: _irm_, + }, + ], + [() => EventStream, 16], + ], +]; export var PayloadConfig: StaticStructureSchema = [3, n0, _PC, 0, [_da], [1]]; +export var PayloadStructure: StaticStructureSchema = [3, n0, _PS, 0, [_sM], [0]]; export var PostPlayerActionInput: StaticStructureSchema = [3, n0, _PPAI, 0, [_ac], [() => PlayerAction]]; export var PostPlayerActionOutput: StaticStructureSchema = [3, n0, _PPAO, 0, [_ac], [() => PlayerAction]]; export var PostUnionWithJsonNameInput: StaticStructureSchema = [ @@ -1966,6 +2235,19 @@ export var RecursiveShapesInputOutputNested2: StaticStructureSchema = [ ]; export var ResponseCodeHttpFallbackInputOutput: StaticStructureSchema = [3, n0, _RCHFIO, 0, [], []]; export var ResponseCodeRequiredOutput: StaticStructureSchema = [3, n0, _RCRO, 0, [_rC], [[1, 32]]]; +export var ServiceUnavailableError: StaticErrorSchema = [ + -3, + n0, + _SUE, + { + [_e]: _se, + [_hE]: 500, + }, + [_me], + [0], +]; +TypeRegistry.for(n0).registerError(ServiceUnavailableError, __ServiceUnavailableError); + export var SimpleScalarPropertiesInputOutput: StaticStructureSchema = [ 3, n0, @@ -1995,6 +2277,7 @@ export var SimpleScalarPropertiesInputOutput: StaticStructureSchema = [ ], ], ]; +export var SingletonEvent: StaticStructureSchema = [3, n0, _SE, 0, [_v], [0]]; export var SparseJsonListsInputOutput: StaticStructureSchema = [ 3, n0, @@ -2068,6 +2351,21 @@ export var StreamingTraitsWithMediaTypeInputOutput: StaticStructureSchema = [ [() => StreamingTextPlainBlob, 16], ], ]; +export var StringPayloadEvent: StaticStructureSchema = [ + 3, + n0, + _SPE, + 0, + [_p], + [ + [ + 0, + { + [_eP]: 1, + }, + ], + ], +]; export var StringPayloadInput: StaticStructureSchema = [3, n0, _SPI, 0, [_p], [[0, 16]]]; export var StructureListMember: StaticStructureSchema = [ 3, @@ -2090,6 +2388,21 @@ export var StructureListMember: StaticStructureSchema = [ ], ], ]; +export var StructurePayloadEvent: StaticStructureSchema = [ + 3, + n0, + _SPEt, + 0, + [_p], + [ + [ + () => PayloadStructure, + { + [_eP]: 1, + }, + ], + ], +]; export var TestBodyStructureInputOutput: StaticStructureSchema = [ 3, n0, @@ -2214,8 +2527,23 @@ export var TopLevel: StaticStructureSchema = [ [() => Dialog, () => DialogList, () => DialogMap], ]; export var UnionInputOutput: StaticStructureSchema = [3, n0, _UIO, 0, [_con], [() => MyUnion]]; -export var GreetingStruct: StaticStructureSchema = [3, n2, _GS, 0, [_sa], [0]]; -export var GreetingStruct_n1: StaticStructureSchema = [3, n1, _GS, 0, [_hi], [0]]; +export var UnionPayloadEvent: StaticStructureSchema = [ + 3, + n0, + _UPE, + 0, + [_p], + [ + [ + () => PayloadUnion, + { + [_eP]: 1, + }, + ], + ], +]; +export var GreetingStruct_n2: StaticStructureSchema = [3, n2, _GS, 0, [_sa], [0]]; +export var GreetingStruct: StaticStructureSchema = [3, n1, _GS, 0, [_hi], [0]]; export var __Unit = "unit" as const; export var RestJsonProtocolServiceException: StaticErrorSchema = [ @@ -2282,10 +2610,12 @@ export var DenseNumberMap = 128 | 1; export var DenseSetMap: StaticMapSchema = [2, n0, _DSM, 0, 0, 64 | 0]; export var DenseStringMap = 128 | 0; -export var DenseStructMap: StaticMapSchema = [2, n0, _DSMe, 0, 0, () => GreetingStruct_n1]; +export var DenseStructMap: StaticMapSchema = [2, n0, _DSMe, 0, 0, () => GreetingStruct]; export var DialogMap: StaticMapSchema = [2, n0, _DM, 0, 0, () => Dialog]; export var DocumentValuedMap = 128 | 15; +export var QueryMap = 128 | 0; + export var SimpleMap = 128 | 0; export var SparseBooleanMap: StaticMapSchema = [ @@ -2326,7 +2656,7 @@ export var SparseStructMap: StaticMapSchema = [ [_sp]: 1, }, 0, - () => GreetingStruct_n1, + () => GreetingStruct, ]; export var TestStringMap = 128 | 0; @@ -2347,16 +2677,37 @@ export var SparseStringMap: StaticMapSchema = [ export var StringListMap: StaticMapSchema = [2, n1, _SLM, 0, 0, 64 | 0]; export var StringMap = 128 | 0; +export var EventStream: StaticStructureSchema = [ + 3, + n0, + _ES, + { + [_s]: 1, + }, + [_hea, _bP, _sP, _sPt, _uP, _hAEP, _hAIP, _e], + [ + [() => HeadersEvent, 0], + [() => BlobPayloadEvent, 0], + [() => StringPayloadEvent, 0], + [() => StructurePayloadEvent, 0], + [() => UnionPayloadEvent, 0], + [() => HeadersAndExplicitPayloadEvent, 0], + [() => HeadersAndImplicitPayloadEvent, 0], + [() => ErrorEvent, 0], + ], +]; export var MyUnion: StaticStructureSchema = [ 3, 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], + [0, 2, 1, 21, 4, 0, 64 | 0, 128 | 0, () => GreetingStruct, () => GreetingStruct_n2], ]; +export var PayloadUnion: StaticStructureSchema = [3, n0, _PU, 0, [_uM], [0]]; export var PlayerAction: StaticStructureSchema = [3, n0, _PA, 0, [_qu], [() => __Unit]]; -export var SimpleUnion: StaticStructureSchema = [3, n0, _SU, 0, [_int, _st], [1, 0]]; +export var SimpleUnion: StaticStructureSchema = [3, n0, _SU, 0, [_int, _str], [1, 0]]; +export var SingletonEventStream: StaticStructureSchema = [3, n0, _SES, 0, [_si], [() => SingletonEvent]]; export var UnionPayload: StaticStructureSchema = [3, n0, _UP, 0, [_g], [0]]; export var UnionWithJsonName: StaticStructureSchema = [ 3, @@ -2460,6 +2811,36 @@ export var DocumentTypeAsPayload: StaticOperationSchema = [ () => DocumentTypeAsPayloadInputOutput, () => DocumentTypeAsPayloadInputOutput, ]; +export var DuplexStream: StaticOperationSchema = [ + 9, + n0, + _DS, + { + [_ht]: ["POST", "/DuplexStream", 200], + }, + () => DuplexStreamInput, + () => DuplexStreamOutput, +]; +export var DuplexStreamWithDistinctStreams: StaticOperationSchema = [ + 9, + n0, + _DSWDS, + { + [_ht]: ["POST", "/DuplexStreamWithDistinctStreams", 200], + }, + () => DuplexStreamWithDistinctStreamsInput, + () => DuplexStreamWithDistinctStreamsOutput, +]; +export var DuplexStreamWithInitialMessages: StaticOperationSchema = [ + 9, + n0, + _DSWIM, + { + [_ht]: ["POST", "/DuplexStreamWithInitialMessages", 200], + }, + () => DuplexStreamWithInitialMessagesInput, + () => DuplexStreamWithInitialMessagesOutput, +]; export var EmptyInputAndEmptyOutput: StaticOperationSchema = [ 9, n0, @@ -2613,6 +2994,16 @@ export var HttpPrefixHeadersInResponse: StaticOperationSchema = [ () => HttpPrefixHeadersInResponseInput, () => HttpPrefixHeadersInResponseOutput, ]; +export var HttpQueryParamsOnlyOperation: StaticOperationSchema = [ + 9, + n0, + _HQPOO, + { + [_ht]: ["GET", "/http-query-params-only", 200], + }, + () => HttpQueryParamsOnlyInput, + () => __Unit, +]; export var HttpRequestWithFloatLabels: StaticOperationSchema = [ 9, n0, @@ -2711,6 +3102,26 @@ export var InputAndOutputWithHeaders: StaticOperationSchema = [ () => InputAndOutputWithHeadersIO, () => InputAndOutputWithHeadersIO, ]; +export var InputStream: StaticOperationSchema = [ + 9, + n0, + _ISn, + { + [_ht]: ["POST", "/InputStream", 200], + }, + () => InputStreamInput, + () => __Unit, +]; +export var InputStreamWithInitialRequest: StaticOperationSchema = [ + 9, + n0, + _ISWIR, + { + [_ht]: ["POST", "/InputStreamWithInitialRequest", 200], + }, + () => InputStreamWithInitialRequestInput, + () => __Unit, +]; export var JsonBlobs: StaticOperationSchema = [ 9, n0, @@ -2789,7 +3200,7 @@ export var MalformedAcceptWithBody: StaticOperationSchema = [ [_ht]: ["POST", "/MalformedAcceptWithBody", 200], }, () => __Unit, - () => GreetingStruct_n1, + () => GreetingStruct, ]; export var MalformedAcceptWithGenericString: StaticOperationSchema = [ 9, @@ -2848,7 +3259,7 @@ export var MalformedContentTypeWithBody: StaticOperationSchema = [ { [_ht]: ["POST", "/MalformedContentTypeWithBody", 200], }, - () => GreetingStruct_n1, + () => GreetingStruct, () => __Unit, ]; export var MalformedContentTypeWithGenericString: StaticOperationSchema = [ @@ -3201,6 +3612,26 @@ export var OperationWithNestedStructure: StaticOperationSchema = [ () => OperationWithNestedStructureInput, () => OperationWithNestedStructureOutput, ]; +export var OutputStream: StaticOperationSchema = [ + 9, + n0, + _OS, + { + [_ht]: ["POST", "/OutputStream", 200], + }, + () => __Unit, + () => OutputStreamOutput, +]; +export var OutputStreamWithInitialResponse: StaticOperationSchema = [ + 9, + n0, + _OSWIR, + { + [_ht]: ["POST", "/OutputStreamWithInitialResponse", 200], + }, + () => __Unit, + () => OutputStreamWithInitialResponseOutput, +]; export var PostPlayerAction: StaticOperationSchema = [ 9, n0, diff --git a/private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts index 49e2e78849f01..1cd35f81ce592 100644 --- a/private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts +++ b/private/aws-protocoltests-restjson-schema/test/functional/restjson1.spec.ts @@ -28,6 +28,7 @@ import { HttpPayloadWithStructureCommand } from "../../src/commands/HttpPayloadW import { HttpPayloadWithUnionCommand } from "../../src/commands/HttpPayloadWithUnionCommand"; import { HttpPrefixHeadersCommand } from "../../src/commands/HttpPrefixHeadersCommand"; import { HttpPrefixHeadersInResponseCommand } from "../../src/commands/HttpPrefixHeadersInResponseCommand"; +import { HttpQueryParamsOnlyOperationCommand } from "../../src/commands/HttpQueryParamsOnlyOperationCommand"; import { HttpRequestWithFloatLabelsCommand } from "../../src/commands/HttpRequestWithFloatLabelsCommand"; import { HttpRequestWithGreedyLabelInPathCommand } from "../../src/commands/HttpRequestWithGreedyLabelInPathCommand"; import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../src/commands/HttpRequestWithLabelsAndTimestampFormatCommand"; @@ -3191,6 +3192,67 @@ it("HttpPrefixHeadersResponse:Response", async () => { }); }); +/** + * Test that httpQueryParams are included in request when no other query parameters exist + */ +it("HttpQueryParamsOnlyRequest:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpQueryParamsOnlyOperationCommand({ + queryMap: { + a: "b", + c: "d", + } 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("/http-query-params-only"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("a=b"); + expect(queryString).toContain("c=d"); + } +}); + +/** + * Test that empty httpQueryParams map results in no query parameters + */ +it("HttpQueryParamsOnlyEmptyRequest:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpQueryParamsOnlyOperationCommand({ + queryMap: {} 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("/http-query-params-only"); + } +}); + /** * Supports handling NaN float label values. */ diff --git a/private/aws-protocoltests-restjson/README.md b/private/aws-protocoltests-restjson/README.md index 59cd08f330f39..006c6f5ad4563 100644 --- a/private/aws-protocoltests-restjson/README.md +++ b/private/aws-protocoltests-restjson/README.md @@ -6,8 +6,6 @@ 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 @@ -23,16 +21,16 @@ using your favorite package manager: 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`: +the commands you need, for example `InputStreamCommand`: ```js // ES5 example -const { RestJsonProtocolClient, JsonBlobsCommand } = require("@aws-sdk/aws-protocoltests-restjson"); +const { RestJsonProtocolClient, InputStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson"); ``` ```ts // ES6+ example -import { RestJsonProtocolClient, JsonBlobsCommand } from "@aws-sdk/aws-protocoltests-restjson"; +import { RestJsonProtocolClient, InputStreamCommand } from "@aws-sdk/aws-protocoltests-restjson"; ``` ### Usage @@ -51,7 +49,7 @@ const client = new RestJsonProtocolClient({ region: "REGION" }); const params = { /** input parameters */ }; -const command = new JsonBlobsCommand(params); +const command = new InputStreamCommand(params); ``` #### Async/await @@ -130,7 +128,7 @@ const client = new AWS.RestJsonProtocol({ region: "REGION" }); // async/await. try { - const data = await client.jsonBlobs(params); + const data = await client.inputStream(params); // process data. } catch (error) { // error handling. @@ -138,7 +136,7 @@ try { // Promises. client - .jsonBlobs(params) + .inputStream(params) .then((data) => { // process data. }) @@ -147,7 +145,7 @@ client }); // callbacks. -client.jsonBlobs(params, (err, data) => { +client.inputStream(params, (err, data) => { // process err and data. }); ``` @@ -1018,6 +1016,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1160,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1240,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1648,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-json-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-json-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restjson/package.json b/private/aws-protocoltests-restjson/package.json index 5181a25e3344b..fbc0de43fe98b 100644 --- a/private/aws-protocoltests-restjson/package.json +++ b/private/aws-protocoltests-restjson/package.json @@ -22,6 +22,8 @@ "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "*", "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/eventstream-handler-node": "*", + "@aws-sdk/middleware-eventstream": "*", "@aws-sdk/middleware-host-header": "*", "@aws-sdk/middleware-logger": "*", "@aws-sdk/middleware-recursion-detection": "*", @@ -33,6 +35,10 @@ "@aws-sdk/util-user-agent-node": "*", "@smithy/config-resolver": "^4.4.3", "@smithy/core": "^3.18.5", + "@smithy/eventstream-codec": "^4.2.5", + "@smithy/eventstream-serde-browser": "^4.2.5", + "@smithy/eventstream-serde-config-resolver": "^4.3.5", + "@smithy/eventstream-serde-node": "^4.2.5", "@smithy/fetch-http-handler": "^5.3.6", "@smithy/hash-blob-browser": "^4.2.6", "@smithy/hash-node": "^4.2.5", diff --git a/private/aws-protocoltests-restjson/src/RestJsonProtocol.ts b/private/aws-protocoltests-restjson/src/RestJsonProtocol.ts index 09c418beedef1..0f27ea4c5ea3c 100644 --- a/private/aws-protocoltests-restjson/src/RestJsonProtocol.ts +++ b/private/aws-protocoltests-restjson/src/RestJsonProtocol.ts @@ -42,6 +42,21 @@ import { DocumentTypeCommandInput, DocumentTypeCommandOutput, } from "./commands/DocumentTypeCommand"; +import { + DuplexStreamCommand, + DuplexStreamCommandInput, + DuplexStreamCommandOutput, +} from "./commands/DuplexStreamCommand"; +import { + DuplexStreamWithDistinctStreamsCommand, + DuplexStreamWithDistinctStreamsCommandInput, + DuplexStreamWithDistinctStreamsCommandOutput, +} from "./commands/DuplexStreamWithDistinctStreamsCommand"; +import { + DuplexStreamWithInitialMessagesCommand, + DuplexStreamWithInitialMessagesCommandInput, + DuplexStreamWithInitialMessagesCommandOutput, +} from "./commands/DuplexStreamWithInitialMessagesCommand"; import { EmptyInputAndEmptyOutputCommand, EmptyInputAndEmptyOutputCommandInput, @@ -117,6 +132,11 @@ import { HttpPrefixHeadersInResponseCommandInput, HttpPrefixHeadersInResponseCommandOutput, } from "./commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpQueryParamsOnlyOperationCommand, + HttpQueryParamsOnlyOperationCommandInput, + HttpQueryParamsOnlyOperationCommandOutput, +} from "./commands/HttpQueryParamsOnlyOperationCommand"; import { HttpRequestWithFloatLabelsCommand, HttpRequestWithFloatLabelsCommandInput, @@ -162,6 +182,12 @@ import { InputAndOutputWithHeadersCommandInput, InputAndOutputWithHeadersCommandOutput, } from "./commands/InputAndOutputWithHeadersCommand"; +import { InputStreamCommand, InputStreamCommandInput, InputStreamCommandOutput } from "./commands/InputStreamCommand"; +import { + InputStreamWithInitialRequestCommand, + InputStreamWithInitialRequestCommandInput, + InputStreamWithInitialRequestCommandOutput, +} from "./commands/InputStreamWithInitialRequestCommand"; import { JsonBlobsCommand, JsonBlobsCommandInput, JsonBlobsCommandOutput } from "./commands/JsonBlobsCommand"; import { JsonEnumsCommand, JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; import { @@ -387,6 +413,16 @@ import { OperationWithNestedStructureCommandInput, OperationWithNestedStructureCommandOutput, } from "./commands/OperationWithNestedStructureCommand"; +import { + OutputStreamCommand, + OutputStreamCommandInput, + OutputStreamCommandOutput, +} from "./commands/OutputStreamCommand"; +import { + OutputStreamWithInitialResponseCommand, + OutputStreamWithInitialResponseCommandInput, + OutputStreamWithInitialResponseCommandOutput, +} from "./commands/OutputStreamWithInitialResponseCommand"; import { PostPlayerActionCommand, PostPlayerActionCommandInput, @@ -518,6 +554,9 @@ const commands = { DocumentTypeCommand, DocumentTypeAsMapValueCommand, DocumentTypeAsPayloadCommand, + DuplexStreamCommand, + DuplexStreamWithDistinctStreamsCommand, + DuplexStreamWithInitialMessagesCommand, EmptyInputAndEmptyOutputCommand, EndpointOperationCommand, EndpointWithHostLabelOperationCommand, @@ -533,6 +572,7 @@ const commands = { HttpPayloadWithUnionCommand, HttpPrefixHeadersCommand, HttpPrefixHeadersInResponseCommand, + HttpQueryParamsOnlyOperationCommand, HttpRequestWithFloatLabelsCommand, HttpRequestWithGreedyLabelInPathCommand, HttpRequestWithLabelsCommand, @@ -542,6 +582,8 @@ const commands = { HttpStringPayloadCommand, IgnoreQueryParamsInResponseCommand, InputAndOutputWithHeadersCommand, + InputStreamCommand, + InputStreamWithInitialRequestCommand, JsonBlobsCommand, JsonEnumsCommand, JsonIntEnumsCommand, @@ -591,6 +633,8 @@ const commands = { OmitsSerializingEmptyListsCommand, OperationWithDefaultsCommand, OperationWithNestedStructureCommand, + OutputStreamCommand, + OutputStreamWithInitialResponseCommand, PostPlayerActionCommand, PostUnionWithJsonNameCommand, PutWithContentEncodingCommand, @@ -752,6 +796,53 @@ export interface RestJsonProtocol { cb: (err: any, data?: DocumentTypeAsPayloadCommandOutput) => void ): void; + /** + * @see {@link DuplexStreamCommand} + */ + duplexStream(): Promise; + duplexStream(args: DuplexStreamCommandInput, options?: __HttpHandlerOptions): Promise; + duplexStream(args: DuplexStreamCommandInput, cb: (err: any, data?: DuplexStreamCommandOutput) => void): void; + duplexStream( + args: DuplexStreamCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DuplexStreamCommandOutput) => void + ): void; + + /** + * @see {@link DuplexStreamWithDistinctStreamsCommand} + */ + duplexStreamWithDistinctStreams(): Promise; + duplexStreamWithDistinctStreams( + args: DuplexStreamWithDistinctStreamsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + duplexStreamWithDistinctStreams( + args: DuplexStreamWithDistinctStreamsCommandInput, + cb: (err: any, data?: DuplexStreamWithDistinctStreamsCommandOutput) => void + ): void; + duplexStreamWithDistinctStreams( + args: DuplexStreamWithDistinctStreamsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DuplexStreamWithDistinctStreamsCommandOutput) => void + ): void; + + /** + * @see {@link DuplexStreamWithInitialMessagesCommand} + */ + duplexStreamWithInitialMessages( + args: DuplexStreamWithInitialMessagesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + duplexStreamWithInitialMessages( + args: DuplexStreamWithInitialMessagesCommandInput, + cb: (err: any, data?: DuplexStreamWithInitialMessagesCommandOutput) => void + ): void; + duplexStreamWithInitialMessages( + args: DuplexStreamWithInitialMessagesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DuplexStreamWithInitialMessagesCommandOutput) => void + ): void; + /** * @see {@link EmptyInputAndEmptyOutputCommand} */ @@ -1018,6 +1109,24 @@ export interface RestJsonProtocol { cb: (err: any, data?: HttpPrefixHeadersInResponseCommandOutput) => void ): void; + /** + * @see {@link HttpQueryParamsOnlyOperationCommand} + */ + httpQueryParamsOnlyOperation(): Promise; + httpQueryParamsOnlyOperation( + args: HttpQueryParamsOnlyOperationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + httpQueryParamsOnlyOperation( + args: HttpQueryParamsOnlyOperationCommandInput, + cb: (err: any, data?: HttpQueryParamsOnlyOperationCommandOutput) => void + ): void; + httpQueryParamsOnlyOperation( + args: HttpQueryParamsOnlyOperationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: HttpQueryParamsOnlyOperationCommandOutput) => void + ): void; + /** * @see {@link HttpRequestWithFloatLabelsCommand} */ @@ -1175,6 +1284,35 @@ export interface RestJsonProtocol { cb: (err: any, data?: InputAndOutputWithHeadersCommandOutput) => void ): void; + /** + * @see {@link InputStreamCommand} + */ + inputStream(): Promise; + inputStream(args: InputStreamCommandInput, options?: __HttpHandlerOptions): Promise; + inputStream(args: InputStreamCommandInput, cb: (err: any, data?: InputStreamCommandOutput) => void): void; + inputStream( + args: InputStreamCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InputStreamCommandOutput) => void + ): void; + + /** + * @see {@link InputStreamWithInitialRequestCommand} + */ + inputStreamWithInitialRequest( + args: InputStreamWithInitialRequestCommandInput, + options?: __HttpHandlerOptions + ): Promise; + inputStreamWithInitialRequest( + args: InputStreamWithInitialRequestCommandInput, + cb: (err: any, data?: InputStreamWithInitialRequestCommandOutput) => void + ): void; + inputStreamWithInitialRequest( + args: InputStreamWithInitialRequestCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: InputStreamWithInitialRequestCommandOutput) => void + ): void; + /** * @see {@link JsonBlobsCommand} */ @@ -1950,6 +2088,36 @@ export interface RestJsonProtocol { cb: (err: any, data?: OperationWithNestedStructureCommandOutput) => void ): void; + /** + * @see {@link OutputStreamCommand} + */ + outputStream(): Promise; + outputStream(args: OutputStreamCommandInput, options?: __HttpHandlerOptions): Promise; + outputStream(args: OutputStreamCommandInput, cb: (err: any, data?: OutputStreamCommandOutput) => void): void; + outputStream( + args: OutputStreamCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OutputStreamCommandOutput) => void + ): void; + + /** + * @see {@link OutputStreamWithInitialResponseCommand} + */ + outputStreamWithInitialResponse(): Promise; + outputStreamWithInitialResponse( + args: OutputStreamWithInitialResponseCommandInput, + options?: __HttpHandlerOptions + ): Promise; + outputStreamWithInitialResponse( + args: OutputStreamWithInitialResponseCommandInput, + cb: (err: any, data?: OutputStreamWithInitialResponseCommandOutput) => void + ): void; + outputStreamWithInitialResponse( + args: OutputStreamWithInitialResponseCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: OutputStreamWithInitialResponseCommandOutput) => void + ): void; + /** * @see {@link PostPlayerActionCommand} */ @@ -2366,7 +2534,6 @@ export interface RestJsonProtocol { } /** - * A REST JSON service that sends JSON requests and responses. * @public */ export class RestJsonProtocol extends RestJsonProtocolClient implements RestJsonProtocol {} diff --git a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts index c916cbc4189eb..77dfb6a39592d 100644 --- a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts +++ b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts @@ -1,4 +1,9 @@ // smithy-typescript generated code +import { + EventStreamInputConfig, + EventStreamResolvedConfig, + resolveEventStreamConfig, +} from "@aws-sdk/middleware-eventstream"; import { getHostHeaderPlugin, HostHeaderInputConfig, @@ -13,6 +18,7 @@ import { UserAgentInputConfig, UserAgentResolvedConfig, } from "@aws-sdk/middleware-user-agent"; +import { EventStreamPayloadHandlerProvider as __EventStreamPayloadHandlerProvider } from "@aws-sdk/types"; import { DefaultAwsRegionalEndpointsInputConfig, DefaultAwsRegionalEndpointsResolvedConfig, @@ -24,6 +30,11 @@ import { getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core"; +import { + EventStreamSerdeInputConfig, + EventStreamSerdeResolvedConfig, + resolveEventStreamSerdeConfig, +} from "@smithy/eventstream-serde-config-resolver"; import { CompressionInputConfig, CompressionResolvedConfig, @@ -48,6 +59,7 @@ import { Decoder as __Decoder, Encoder as __Encoder, EndpointV2 as __EndpointV2, + EventStreamSerdeProvider as __EventStreamSerdeProvider, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, @@ -93,6 +105,15 @@ import { DocumentTypeAsPayloadCommandOutput, } from "./commands/DocumentTypeAsPayloadCommand"; import { DocumentTypeCommandInput, DocumentTypeCommandOutput } from "./commands/DocumentTypeCommand"; +import { DuplexStreamCommandInput, DuplexStreamCommandOutput } from "./commands/DuplexStreamCommand"; +import { + DuplexStreamWithDistinctStreamsCommandInput, + DuplexStreamWithDistinctStreamsCommandOutput, +} from "./commands/DuplexStreamWithDistinctStreamsCommand"; +import { + DuplexStreamWithInitialMessagesCommandInput, + DuplexStreamWithInitialMessagesCommandOutput, +} from "./commands/DuplexStreamWithInitialMessagesCommand"; import { EmptyInputAndEmptyOutputCommandInput, EmptyInputAndEmptyOutputCommandOutput, @@ -135,6 +156,10 @@ import { HttpPrefixHeadersInResponseCommandInput, HttpPrefixHeadersInResponseCommandOutput, } from "./commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpQueryParamsOnlyOperationCommandInput, + HttpQueryParamsOnlyOperationCommandOutput, +} from "./commands/HttpQueryParamsOnlyOperationCommand"; import { HttpRequestWithFloatLabelsCommandInput, HttpRequestWithFloatLabelsCommandOutput, @@ -165,6 +190,11 @@ import { InputAndOutputWithHeadersCommandInput, InputAndOutputWithHeadersCommandOutput, } from "./commands/InputAndOutputWithHeadersCommand"; +import { InputStreamCommandInput, InputStreamCommandOutput } from "./commands/InputStreamCommand"; +import { + InputStreamWithInitialRequestCommandInput, + InputStreamWithInitialRequestCommandOutput, +} from "./commands/InputStreamWithInitialRequestCommand"; import { JsonBlobsCommandInput, JsonBlobsCommandOutput } from "./commands/JsonBlobsCommand"; import { JsonEnumsCommandInput, JsonEnumsCommandOutput } from "./commands/JsonEnumsCommand"; import { JsonIntEnumsCommandInput, JsonIntEnumsCommandOutput } from "./commands/JsonIntEnumsCommand"; @@ -295,6 +325,11 @@ import { OperationWithNestedStructureCommandInput, OperationWithNestedStructureCommandOutput, } from "./commands/OperationWithNestedStructureCommand"; +import { OutputStreamCommandInput, OutputStreamCommandOutput } from "./commands/OutputStreamCommand"; +import { + OutputStreamWithInitialResponseCommandInput, + OutputStreamWithInitialResponseCommandOutput, +} from "./commands/OutputStreamWithInitialResponseCommand"; import { PostPlayerActionCommandInput, PostPlayerActionCommandOutput } from "./commands/PostPlayerActionCommand"; import { PostUnionWithJsonNameCommandInput, @@ -381,6 +416,9 @@ export type ServiceInputTypes = | DocumentTypeAsMapValueCommandInput | DocumentTypeAsPayloadCommandInput | DocumentTypeCommandInput + | DuplexStreamCommandInput + | DuplexStreamWithDistinctStreamsCommandInput + | DuplexStreamWithInitialMessagesCommandInput | EmptyInputAndEmptyOutputCommandInput | EndpointOperationCommandInput | EndpointWithHostLabelOperationCommandInput @@ -396,6 +434,7 @@ export type ServiceInputTypes = | HttpPayloadWithUnionCommandInput | HttpPrefixHeadersCommandInput | HttpPrefixHeadersInResponseCommandInput + | HttpQueryParamsOnlyOperationCommandInput | HttpRequestWithFloatLabelsCommandInput | HttpRequestWithGreedyLabelInPathCommandInput | HttpRequestWithLabelsAndTimestampFormatCommandInput @@ -405,6 +444,8 @@ export type ServiceInputTypes = | HttpStringPayloadCommandInput | IgnoreQueryParamsInResponseCommandInput | InputAndOutputWithHeadersCommandInput + | InputStreamCommandInput + | InputStreamWithInitialRequestCommandInput | JsonBlobsCommandInput | JsonEnumsCommandInput | JsonIntEnumsCommandInput @@ -454,6 +495,8 @@ export type ServiceInputTypes = | OmitsSerializingEmptyListsCommandInput | OperationWithDefaultsCommandInput | OperationWithNestedStructureCommandInput + | OutputStreamCommandInput + | OutputStreamWithInitialResponseCommandInput | PostPlayerActionCommandInput | PostUnionWithJsonNameCommandInput | PutWithContentEncodingCommandInput @@ -491,6 +534,9 @@ export type ServiceOutputTypes = | DocumentTypeAsMapValueCommandOutput | DocumentTypeAsPayloadCommandOutput | DocumentTypeCommandOutput + | DuplexStreamCommandOutput + | DuplexStreamWithDistinctStreamsCommandOutput + | DuplexStreamWithInitialMessagesCommandOutput | EmptyInputAndEmptyOutputCommandOutput | EndpointOperationCommandOutput | EndpointWithHostLabelOperationCommandOutput @@ -506,6 +552,7 @@ export type ServiceOutputTypes = | HttpPayloadWithUnionCommandOutput | HttpPrefixHeadersCommandOutput | HttpPrefixHeadersInResponseCommandOutput + | HttpQueryParamsOnlyOperationCommandOutput | HttpRequestWithFloatLabelsCommandOutput | HttpRequestWithGreedyLabelInPathCommandOutput | HttpRequestWithLabelsAndTimestampFormatCommandOutput @@ -515,6 +562,8 @@ export type ServiceOutputTypes = | HttpStringPayloadCommandOutput | IgnoreQueryParamsInResponseCommandOutput | InputAndOutputWithHeadersCommandOutput + | InputStreamCommandOutput + | InputStreamWithInitialRequestCommandOutput | JsonBlobsCommandOutput | JsonEnumsCommandOutput | JsonIntEnumsCommandOutput @@ -564,6 +613,8 @@ export type ServiceOutputTypes = | OmitsSerializingEmptyListsCommandOutput | OperationWithDefaultsCommandOutput | OperationWithNestedStructureCommandOutput + | OutputStreamCommandOutput + | OutputStreamWithInitialResponseCommandOutput | PostPlayerActionCommandOutput | PostUnionWithJsonNameCommandOutput | PutWithContentEncodingCommandOutput @@ -734,6 +785,11 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ extensions?: RuntimeExtension[]; + /** + * The function that provides necessary utilities for generating and parsing event stream + */ + eventStreamSerdeProvider?: __EventStreamSerdeProvider; + /** * A function that, given a hash constructor and a stream, calculates the * hash of the streamed value. @@ -753,6 +809,12 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; + /** + * The function that provides necessary utilities for handling request event stream. + * @internal + */ + eventStreamPayloadHandlerProvider?: __EventStreamPayloadHandlerProvider; + /** * The internal function that inject utilities to runtime-specific stream to help users consume the data * @internal @@ -771,7 +833,9 @@ export type RestJsonProtocolClientConfigType = Partial<__SmithyConfiguration<__H HostHeaderInputConfig & EndpointInputConfig & DefaultAwsRegionalEndpointsInputConfig & + EventStreamSerdeInputConfig & HttpAuthSchemeInputConfig & + EventStreamInputConfig & CompressionInputConfig & ClientInputEndpointParameters; /** @@ -793,7 +857,9 @@ export type RestJsonProtocolClientResolvedConfigType = __SmithyResolvedConfigura HostHeaderResolvedConfig & EndpointResolvedConfig & DefaultAwsRegionalEndpointsResolvedConfig & + EventStreamSerdeResolvedConfig & HttpAuthSchemeResolvedConfig & + EventStreamResolvedConfig & CompressionResolvedConfig & ClientResolvedEndpointParameters; /** @@ -804,7 +870,6 @@ export type RestJsonProtocolClientResolvedConfigType = __SmithyResolvedConfigura export interface RestJsonProtocolClientResolvedConfig extends RestJsonProtocolClientResolvedConfigType {} /** - * A REST JSON service that sends JSON requests and responses. * @public */ export class RestJsonProtocolClient extends __Client< @@ -829,10 +894,12 @@ export class RestJsonProtocolClient extends __Client< const _config_5 = resolveHostHeaderConfig(_config_4); const _config_6 = resolveEndpointConfig(_config_5); const _config_7 = resolveDefaultAwsRegionalEndpointsConfig(_config_6); - const _config_8 = resolveHttpAuthSchemeConfig(_config_7); - const _config_9 = resolveCompressionConfig(_config_8); - const _config_10 = resolveRuntimeExtensions(_config_9, configuration?.extensions || []); - this.config = _config_10; + const _config_8 = resolveEventStreamSerdeConfig(_config_7); + const _config_9 = resolveHttpAuthSchemeConfig(_config_8); + const _config_10 = resolveEventStreamConfig(_config_9); + const _config_11 = resolveCompressionConfig(_config_10); + const _config_12 = resolveRuntimeExtensions(_config_11, configuration?.extensions || []); + this.config = _config_12; this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); diff --git a/private/aws-protocoltests-restjson/src/commands/DuplexStreamCommand.ts b/private/aws-protocoltests-restjson/src/commands/DuplexStreamCommand.ts new file mode 100644 index 0000000000000..37597c7b5bfb6 --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/DuplexStreamCommand.ts @@ -0,0 +1,190 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + DuplexStreamInput, + DuplexStreamInputFilterSensitiveLog, + DuplexStreamOutput, + DuplexStreamOutputFilterSensitiveLog, +} from "../models/models_0"; +import { de_DuplexStreamCommand, se_DuplexStreamCommand } from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DuplexStreamCommand}. + */ +export interface DuplexStreamCommandInput extends DuplexStreamInput {} +/** + * @public + * + * The output of {@link DuplexStreamCommand}. + */ +export interface DuplexStreamCommandOutput extends DuplexStreamOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DuplexStreamCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, DuplexStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // DuplexStreamInput + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new DuplexStreamCommand(input); + * const response = await client.send(command); + * // { // DuplexStreamOutput + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param DuplexStreamCommandInput - {@link DuplexStreamCommandInput} + * @returns {@link DuplexStreamCommandOutput} + * @see {@link DuplexStreamCommandInput} for command's `input` shape. + * @see {@link DuplexStreamCommandOutput} 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 DuplexStreamCommand extends $Command + .classBuilder< + DuplexStreamCommandInput, + DuplexStreamCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getEventStreamPlugin(config), + ]; + }) + .s("RestJson", "DuplexStream", { + /** + * @internal + */ + eventStream: { + input: true, + output: true, + }, + }) + .n("RestJsonProtocolClient", "DuplexStreamCommand") + .f(DuplexStreamInputFilterSensitiveLog, DuplexStreamOutputFilterSensitiveLog) + .ser(se_DuplexStreamCommand) + .de(de_DuplexStreamCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DuplexStreamInput; + output: DuplexStreamOutput; + }; + sdk: { + input: DuplexStreamCommandInput; + output: DuplexStreamCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/DuplexStreamWithDistinctStreamsCommand.ts b/private/aws-protocoltests-restjson/src/commands/DuplexStreamWithDistinctStreamsCommand.ts new file mode 100644 index 0000000000000..b7d8ea6005ce7 --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/DuplexStreamWithDistinctStreamsCommand.ts @@ -0,0 +1,157 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + DuplexStreamWithDistinctStreamsInput, + DuplexStreamWithDistinctStreamsInputFilterSensitiveLog, + DuplexStreamWithDistinctStreamsOutput, +} from "../models/models_0"; +import { + de_DuplexStreamWithDistinctStreamsCommand, + se_DuplexStreamWithDistinctStreamsCommand, +} from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DuplexStreamWithDistinctStreamsCommand}. + */ +export interface DuplexStreamWithDistinctStreamsCommandInput extends DuplexStreamWithDistinctStreamsInput {} +/** + * @public + * + * The output of {@link DuplexStreamWithDistinctStreamsCommand}. + */ +export interface DuplexStreamWithDistinctStreamsCommandOutput + extends DuplexStreamWithDistinctStreamsOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DuplexStreamWithDistinctStreamsCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, DuplexStreamWithDistinctStreamsCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // DuplexStreamWithDistinctStreamsInput + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new DuplexStreamWithDistinctStreamsCommand(input); + * const response = await client.send(command); + * // { // DuplexStreamWithDistinctStreamsOutput + * // stream: { // SingletonEventStream Union: only one key present + * // singleton: { // SingletonEvent + * // value: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param DuplexStreamWithDistinctStreamsCommandInput - {@link DuplexStreamWithDistinctStreamsCommandInput} + * @returns {@link DuplexStreamWithDistinctStreamsCommandOutput} + * @see {@link DuplexStreamWithDistinctStreamsCommandInput} for command's `input` shape. + * @see {@link DuplexStreamWithDistinctStreamsCommandOutput} 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 DuplexStreamWithDistinctStreamsCommand extends $Command + .classBuilder< + DuplexStreamWithDistinctStreamsCommandInput, + DuplexStreamWithDistinctStreamsCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getEventStreamPlugin(config), + ]; + }) + .s("RestJson", "DuplexStreamWithDistinctStreams", { + /** + * @internal + */ + eventStream: { + input: true, + }, + }) + .n("RestJsonProtocolClient", "DuplexStreamWithDistinctStreamsCommand") + .f(DuplexStreamWithDistinctStreamsInputFilterSensitiveLog, void 0) + .ser(se_DuplexStreamWithDistinctStreamsCommand) + .de(de_DuplexStreamWithDistinctStreamsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DuplexStreamWithDistinctStreamsInput; + output: DuplexStreamWithDistinctStreamsOutput; + }; + sdk: { + input: DuplexStreamWithDistinctStreamsCommandInput; + output: DuplexStreamWithDistinctStreamsCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/DuplexStreamWithInitialMessagesCommand.ts b/private/aws-protocoltests-restjson/src/commands/DuplexStreamWithInitialMessagesCommand.ts new file mode 100644 index 0000000000000..222c43d19777e --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/DuplexStreamWithInitialMessagesCommand.ts @@ -0,0 +1,199 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + DuplexStreamWithInitialMessagesInput, + DuplexStreamWithInitialMessagesInputFilterSensitiveLog, + DuplexStreamWithInitialMessagesOutput, + DuplexStreamWithInitialMessagesOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + de_DuplexStreamWithInitialMessagesCommand, + se_DuplexStreamWithInitialMessagesCommand, +} from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DuplexStreamWithInitialMessagesCommand}. + */ +export interface DuplexStreamWithInitialMessagesCommandInput extends DuplexStreamWithInitialMessagesInput {} +/** + * @public + * + * The output of {@link DuplexStreamWithInitialMessagesCommand}. + */ +export interface DuplexStreamWithInitialMessagesCommandOutput + extends DuplexStreamWithInitialMessagesOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, DuplexStreamWithInitialMessagesCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, DuplexStreamWithInitialMessagesCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // DuplexStreamWithInitialMessagesInput + * initialRequestMember: "STRING_VALUE", // required + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new DuplexStreamWithInitialMessagesCommand(input); + * const response = await client.send(command); + * // { // DuplexStreamWithInitialMessagesOutput + * // initialResponseMember: "STRING_VALUE", // required + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param DuplexStreamWithInitialMessagesCommandInput - {@link DuplexStreamWithInitialMessagesCommandInput} + * @returns {@link DuplexStreamWithInitialMessagesCommandOutput} + * @see {@link DuplexStreamWithInitialMessagesCommandInput} for command's `input` shape. + * @see {@link DuplexStreamWithInitialMessagesCommandOutput} for command's `response` shape. + * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape. + * + * @throws {@link ServiceUnavailableError} (server fault) + * + * @throws {@link RestJsonProtocolServiceException} + *

Base exception class for all service exceptions from RestJsonProtocol service.

+ * + * + */ +export class DuplexStreamWithInitialMessagesCommand extends $Command + .classBuilder< + DuplexStreamWithInitialMessagesCommandInput, + DuplexStreamWithInitialMessagesCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getEventStreamPlugin(config), + ]; + }) + .s("RestJson", "DuplexStreamWithInitialMessages", { + /** + * @internal + */ + eventStream: { + input: true, + output: true, + }, + }) + .n("RestJsonProtocolClient", "DuplexStreamWithInitialMessagesCommand") + .f(DuplexStreamWithInitialMessagesInputFilterSensitiveLog, DuplexStreamWithInitialMessagesOutputFilterSensitiveLog) + .ser(se_DuplexStreamWithInitialMessagesCommand) + .de(de_DuplexStreamWithInitialMessagesCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DuplexStreamWithInitialMessagesInput; + output: DuplexStreamWithInitialMessagesOutput; + }; + sdk: { + input: DuplexStreamWithInitialMessagesCommandInput; + output: DuplexStreamWithInitialMessagesCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/HttpQueryParamsOnlyOperationCommand.ts b/private/aws-protocoltests-restjson/src/commands/HttpQueryParamsOnlyOperationCommand.ts new file mode 100644 index 0000000000000..998b010c4a9b9 --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/HttpQueryParamsOnlyOperationCommand.ts @@ -0,0 +1,98 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { HttpQueryParamsOnlyInput } from "../models/models_0"; +import { + de_HttpQueryParamsOnlyOperationCommand, + se_HttpQueryParamsOnlyOperationCommand, +} from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link HttpQueryParamsOnlyOperationCommand}. + */ +export interface HttpQueryParamsOnlyOperationCommandInput extends HttpQueryParamsOnlyInput {} +/** + * @public + * + * The output of {@link HttpQueryParamsOnlyOperationCommand}. + */ +export interface HttpQueryParamsOnlyOperationCommandOutput extends __MetadataBearer {} + +/** + * This example tests httpQueryParams when no other query parameters exist. + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, HttpQueryParamsOnlyOperationCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, HttpQueryParamsOnlyOperationCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // HttpQueryParamsOnlyInput + * queryMap: { // QueryMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new HttpQueryParamsOnlyOperationCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param HttpQueryParamsOnlyOperationCommandInput - {@link HttpQueryParamsOnlyOperationCommandInput} + * @returns {@link HttpQueryParamsOnlyOperationCommandOutput} + * @see {@link HttpQueryParamsOnlyOperationCommandInput} for command's `input` shape. + * @see {@link HttpQueryParamsOnlyOperationCommandOutput} 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 HttpQueryParamsOnlyOperationCommand extends $Command + .classBuilder< + HttpQueryParamsOnlyOperationCommandInput, + HttpQueryParamsOnlyOperationCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("RestJson", "HttpQueryParamsOnlyOperation", {}) + .n("RestJsonProtocolClient", "HttpQueryParamsOnlyOperationCommand") + .f(void 0, void 0) + .ser(se_HttpQueryParamsOnlyOperationCommand) + .de(de_HttpQueryParamsOnlyOperationCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: HttpQueryParamsOnlyInput; + output: {}; + }; + sdk: { + input: HttpQueryParamsOnlyOperationCommandInput; + output: HttpQueryParamsOnlyOperationCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/InputStreamCommand.ts b/private/aws-protocoltests-restjson/src/commands/InputStreamCommand.ts new file mode 100644 index 0000000000000..9f9b10ca4ce18 --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/InputStreamCommand.ts @@ -0,0 +1,142 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { InputStreamInput, InputStreamInputFilterSensitiveLog } from "../models/models_0"; +import { de_InputStreamCommand, se_InputStreamCommand } from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InputStreamCommand}. + */ +export interface InputStreamCommandInput extends InputStreamInput {} +/** + * @public + * + * The output of {@link InputStreamCommand}. + */ +export interface InputStreamCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, InputStreamCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, InputStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // InputStreamInput + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new InputStreamCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param InputStreamCommandInput - {@link InputStreamCommandInput} + * @returns {@link InputStreamCommandOutput} + * @see {@link InputStreamCommandInput} for command's `input` shape. + * @see {@link InputStreamCommandOutput} 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 InputStreamCommand extends $Command + .classBuilder< + InputStreamCommandInput, + InputStreamCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getEventStreamPlugin(config), + ]; + }) + .s("RestJson", "InputStream", { + /** + * @internal + */ + eventStream: { + input: true, + }, + }) + .n("RestJsonProtocolClient", "InputStreamCommand") + .f(InputStreamInputFilterSensitiveLog, void 0) + .ser(se_InputStreamCommand) + .de(de_InputStreamCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: InputStreamInput; + output: {}; + }; + sdk: { + input: InputStreamCommandInput; + output: InputStreamCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/InputStreamWithInitialRequestCommand.ts b/private/aws-protocoltests-restjson/src/commands/InputStreamWithInitialRequestCommand.ts new file mode 100644 index 0000000000000..68b51e6925b89 --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/InputStreamWithInitialRequestCommand.ts @@ -0,0 +1,149 @@ +// smithy-typescript generated code +import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream"; +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + InputStreamWithInitialRequestInput, + InputStreamWithInitialRequestInputFilterSensitiveLog, +} from "../models/models_0"; +import { + de_InputStreamWithInitialRequestCommand, + se_InputStreamWithInitialRequestCommand, +} from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link InputStreamWithInitialRequestCommand}. + */ +export interface InputStreamWithInitialRequestCommandInput extends InputStreamWithInitialRequestInput {} +/** + * @public + * + * The output of {@link InputStreamWithInitialRequestCommand}. + */ +export interface InputStreamWithInitialRequestCommandOutput extends __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, InputStreamWithInitialRequestCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, InputStreamWithInitialRequestCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = { // InputStreamWithInitialRequestInput + * initialRequestMember: "STRING_VALUE", // required + * stream: { // EventStream Union: only one key present + * headers: { // HeadersEvent + * booleanHeader: true || false, + * byteHeader: 0, // BYTE_VALUE + * shortHeader: Number("short"), + * intHeader: Number("int"), + * longHeader: Number("long"), + * blobHeader: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * stringHeader: "STRING_VALUE", + * timestampHeader: new Date("TIMESTAMP"), + * }, + * blobPayload: { // BlobPayloadEvent + * payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * stringPayload: { // StringPayloadEvent + * payload: "STRING_VALUE", + * }, + * structurePayload: { // StructurePayloadEvent + * payload: { // PayloadStructure + * structureMember: "STRING_VALUE", + * }, + * }, + * unionPayload: { // UnionPayloadEvent + * payload: { // PayloadUnion Union: only one key present + * unionMember: "STRING_VALUE", + * }, + * }, + * headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * header: "STRING_VALUE", + * payload: { + * structureMember: "STRING_VALUE", + * }, + * }, + * headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * header: "STRING_VALUE", + * payload: "STRING_VALUE", + * }, + * error: { // ErrorEvent + * message: "STRING_VALUE", + * }, + * }, + * }; + * const command = new InputStreamWithInitialRequestCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param InputStreamWithInitialRequestCommandInput - {@link InputStreamWithInitialRequestCommandInput} + * @returns {@link InputStreamWithInitialRequestCommandOutput} + * @see {@link InputStreamWithInitialRequestCommandInput} for command's `input` shape. + * @see {@link InputStreamWithInitialRequestCommandOutput} 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 InputStreamWithInitialRequestCommand extends $Command + .classBuilder< + InputStreamWithInitialRequestCommandInput, + InputStreamWithInitialRequestCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + getEventStreamPlugin(config), + ]; + }) + .s("RestJson", "InputStreamWithInitialRequest", { + /** + * @internal + */ + eventStream: { + input: true, + }, + }) + .n("RestJsonProtocolClient", "InputStreamWithInitialRequestCommand") + .f(InputStreamWithInitialRequestInputFilterSensitiveLog, void 0) + .ser(se_InputStreamWithInitialRequestCommand) + .de(de_InputStreamWithInitialRequestCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: InputStreamWithInitialRequestInput; + output: {}; + }; + sdk: { + input: InputStreamWithInitialRequestCommandInput; + output: InputStreamWithInitialRequestCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/OutputStreamCommand.ts b/private/aws-protocoltests-restjson/src/commands/OutputStreamCommand.ts new file mode 100644 index 0000000000000..b8f63ea0431f5 --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/OutputStreamCommand.ts @@ -0,0 +1,142 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { OutputStreamOutput, OutputStreamOutputFilterSensitiveLog } from "../models/models_0"; +import { de_OutputStreamCommand, se_OutputStreamCommand } from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OutputStreamCommand}. + */ +export interface OutputStreamCommandInput {} +/** + * @public + * + * The output of {@link OutputStreamCommand}. + */ +export interface OutputStreamCommandOutput extends OutputStreamOutput, __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OutputStreamCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, OutputStreamCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new OutputStreamCommand(input); + * const response = await client.send(command); + * // { // OutputStreamOutput + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param OutputStreamCommandInput - {@link OutputStreamCommandInput} + * @returns {@link OutputStreamCommandOutput} + * @see {@link OutputStreamCommandInput} for command's `input` shape. + * @see {@link OutputStreamCommandOutput} for command's `response` shape. + * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape. + * + * @throws {@link ServiceUnavailableError} (server fault) + * + * @throws {@link RestJsonProtocolServiceException} + *

Base exception class for all service exceptions from RestJsonProtocol service.

+ * + * + */ +export class OutputStreamCommand extends $Command + .classBuilder< + OutputStreamCommandInput, + OutputStreamCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("RestJson", "OutputStream", { + /** + * @internal + */ + eventStream: { + output: true, + }, + }) + .n("RestJsonProtocolClient", "OutputStreamCommand") + .f(void 0, OutputStreamOutputFilterSensitiveLog) + .ser(se_OutputStreamCommand) + .de(de_OutputStreamCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: OutputStreamOutput; + }; + sdk: { + input: OutputStreamCommandInput; + output: OutputStreamCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/OutputStreamWithInitialResponseCommand.ts b/private/aws-protocoltests-restjson/src/commands/OutputStreamWithInitialResponseCommand.ts new file mode 100644 index 0000000000000..5ee9ac9fdabe4 --- /dev/null +++ b/private/aws-protocoltests-restjson/src/commands/OutputStreamWithInitialResponseCommand.ts @@ -0,0 +1,149 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { + OutputStreamWithInitialResponseOutput, + OutputStreamWithInitialResponseOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + de_OutputStreamWithInitialResponseCommand, + se_OutputStreamWithInitialResponseCommand, +} from "../protocols/Aws_restJson1"; +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link OutputStreamWithInitialResponseCommand}. + */ +export interface OutputStreamWithInitialResponseCommandInput {} +/** + * @public + * + * The output of {@link OutputStreamWithInitialResponseCommand}. + */ +export interface OutputStreamWithInitialResponseCommandOutput + extends OutputStreamWithInitialResponseOutput, + __MetadataBearer {} + +/** + * @public + * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { RestJsonProtocolClient, OutputStreamWithInitialResponseCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import + * // const { RestJsonProtocolClient, OutputStreamWithInitialResponseCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import + * // import type { RestJsonProtocolClientConfig } from "@aws-sdk/aws-protocoltests-restjson"; + * const config = {}; // type is RestJsonProtocolClientConfig + * const client = new RestJsonProtocolClient(config); + * const input = {}; + * const command = new OutputStreamWithInitialResponseCommand(input); + * const response = await client.send(command); + * // { // OutputStreamWithInitialResponseOutput + * // initialResponseMember: "STRING_VALUE", // required + * // stream: { // EventStream Union: only one key present + * // headers: { // HeadersEvent + * // booleanHeader: true || false, + * // byteHeader: 0, // BYTE_VALUE + * // shortHeader: Number("short"), + * // intHeader: Number("int"), + * // longHeader: Number("long"), + * // blobHeader: new Uint8Array(), + * // stringHeader: "STRING_VALUE", + * // timestampHeader: new Date("TIMESTAMP"), + * // }, + * // blobPayload: { // BlobPayloadEvent + * // payload: new Uint8Array(), + * // }, + * // stringPayload: { // StringPayloadEvent + * // payload: "STRING_VALUE", + * // }, + * // structurePayload: { // StructurePayloadEvent + * // payload: { // PayloadStructure + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // unionPayload: { // UnionPayloadEvent + * // payload: { // PayloadUnion Union: only one key present + * // unionMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndExplicitPayload: { // HeadersAndExplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: { + * // structureMember: "STRING_VALUE", + * // }, + * // }, + * // headersAndImplicitPayload: { // HeadersAndImplicitPayloadEvent + * // header: "STRING_VALUE", + * // payload: "STRING_VALUE", + * // }, + * // error: { // ErrorEvent + * // message: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param OutputStreamWithInitialResponseCommandInput - {@link OutputStreamWithInitialResponseCommandInput} + * @returns {@link OutputStreamWithInitialResponseCommandOutput} + * @see {@link OutputStreamWithInitialResponseCommandInput} for command's `input` shape. + * @see {@link OutputStreamWithInitialResponseCommandOutput} 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 OutputStreamWithInitialResponseCommand extends $Command + .classBuilder< + OutputStreamWithInitialResponseCommandInput, + OutputStreamWithInitialResponseCommandOutput, + RestJsonProtocolClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("RestJson", "OutputStreamWithInitialResponse", { + /** + * @internal + */ + eventStream: { + output: true, + }, + }) + .n("RestJsonProtocolClient", "OutputStreamWithInitialResponseCommand") + .f(void 0, OutputStreamWithInitialResponseOutputFilterSensitiveLog) + .ser(se_OutputStreamWithInitialResponseCommand) + .de(de_OutputStreamWithInitialResponseCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: {}; + output: OutputStreamWithInitialResponseOutput; + }; + sdk: { + input: OutputStreamWithInitialResponseCommandInput; + output: OutputStreamWithInitialResponseCommandOutput; + }; + }; +} diff --git a/private/aws-protocoltests-restjson/src/commands/index.ts b/private/aws-protocoltests-restjson/src/commands/index.ts index f7eda19004821..de51781237b5e 100644 --- a/private/aws-protocoltests-restjson/src/commands/index.ts +++ b/private/aws-protocoltests-restjson/src/commands/index.ts @@ -7,6 +7,9 @@ export * from "./DatetimeOffsetsCommand"; export * from "./DocumentTypeAsMapValueCommand"; export * from "./DocumentTypeAsPayloadCommand"; export * from "./DocumentTypeCommand"; +export * from "./DuplexStreamCommand"; +export * from "./DuplexStreamWithDistinctStreamsCommand"; +export * from "./DuplexStreamWithInitialMessagesCommand"; export * from "./EmptyInputAndEmptyOutputCommand"; export * from "./EndpointOperationCommand"; export * from "./EndpointWithHostLabelOperationCommand"; @@ -22,6 +25,7 @@ export * from "./HttpPayloadWithStructureCommand"; export * from "./HttpPayloadWithUnionCommand"; export * from "./HttpPrefixHeadersCommand"; export * from "./HttpPrefixHeadersInResponseCommand"; +export * from "./HttpQueryParamsOnlyOperationCommand"; export * from "./HttpRequestWithFloatLabelsCommand"; export * from "./HttpRequestWithGreedyLabelInPathCommand"; export * from "./HttpRequestWithLabelsAndTimestampFormatCommand"; @@ -31,6 +35,8 @@ export * from "./HttpResponseCodeCommand"; export * from "./HttpStringPayloadCommand"; export * from "./IgnoreQueryParamsInResponseCommand"; export * from "./InputAndOutputWithHeadersCommand"; +export * from "./InputStreamCommand"; +export * from "./InputStreamWithInitialRequestCommand"; export * from "./JsonBlobsCommand"; export * from "./JsonEnumsCommand"; export * from "./JsonIntEnumsCommand"; @@ -80,6 +86,8 @@ export * from "./OmitsNullSerializesEmptyStringCommand"; export * from "./OmitsSerializingEmptyListsCommand"; export * from "./OperationWithDefaultsCommand"; export * from "./OperationWithNestedStructureCommand"; +export * from "./OutputStreamCommand"; +export * from "./OutputStreamWithInitialResponseCommand"; export * from "./PostPlayerActionCommand"; export * from "./PostUnionWithJsonNameCommand"; export * from "./PutWithContentEncodingCommand"; diff --git a/private/aws-protocoltests-restjson/src/index.ts b/private/aws-protocoltests-restjson/src/index.ts index c9920e5b09f8c..378b1c6297a90 100644 --- a/private/aws-protocoltests-restjson/src/index.ts +++ b/private/aws-protocoltests-restjson/src/index.ts @@ -1,10 +1,5 @@ // 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"; diff --git a/private/aws-protocoltests-restjson/src/models/errors.ts b/private/aws-protocoltests-restjson/src/models/errors.ts index f6cbb02088ef0..bd41d2117bd95 100644 --- a/private/aws-protocoltests-restjson/src/models/errors.ts +++ b/private/aws-protocoltests-restjson/src/models/errors.ts @@ -30,6 +30,44 @@ export class ComplexError extends __BaseException { } } +/** + * @public + */ +export class ErrorEvent extends __BaseException { + readonly name = "ErrorEvent" as const; + readonly $fault = "client" as const; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ErrorEvent", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ErrorEvent.prototype); + } +} + +/** + * @public + */ +export class ServiceUnavailableError extends __BaseException { + readonly name = "ServiceUnavailableError" as const; + readonly $fault = "server" as const; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceUnavailableError", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, ServiceUnavailableError.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. diff --git a/private/aws-protocoltests-restjson/src/models/models_0.ts b/private/aws-protocoltests-restjson/src/models/models_0.ts index 99967ccdcecce..8a81292feeb14 100644 --- a/private/aws-protocoltests-restjson/src/models/models_0.ts +++ b/private/aws-protocoltests-restjson/src/models/models_0.ts @@ -3,6 +3,7 @@ import { AutomaticJsonStringConversion as __AutomaticJsonStringConversion } from import { DocumentType as __DocumentType, StreamingBlobTypes } from "@smithy/types"; import { FooEnum, IntegerEnum, StringEnum, TestEnum, TestIntEnum } from "./enums"; +import { ErrorEvent } from "./errors"; /** * @public @@ -38,6 +39,13 @@ export interface AllQueryStringTypesInput { queryParamsMapOfStringList?: Record | undefined; } +/** + * @public + */ +export interface BlobPayloadEvent { + payload?: Uint8Array | undefined; +} + /** * @public */ @@ -158,6 +166,397 @@ export interface DocumentTypeAsPayloadInputOutput { documentValue?: __DocumentType | undefined; } +/** + * @public + */ +export interface HeadersEvent { + booleanHeader?: boolean | undefined; + byteHeader?: number | undefined; + shortHeader?: number | undefined; + intHeader?: number | undefined; + longHeader?: number | undefined; + blobHeader?: Uint8Array | undefined; + stringHeader?: string | undefined; + timestampHeader?: Date | undefined; +} + +/** + * @public + */ +export interface PayloadStructure { + structureMember?: string | undefined; +} + +/** + * @public + */ +export interface HeadersAndExplicitPayloadEvent { + header?: string | undefined; + payload?: PayloadStructure | undefined; +} + +/** + * @public + */ +export interface HeadersAndImplicitPayloadEvent { + header?: string | undefined; + payload?: string | undefined; +} + +/** + * @public + */ +export interface StringPayloadEvent { + payload?: string | undefined; +} + +/** + * @public + */ +export interface StructurePayloadEvent { + payload?: PayloadStructure | undefined; +} + +/** + * @public + */ +export type PayloadUnion = PayloadUnion.UnionMemberMember | PayloadUnion.$UnknownMember; + +/** + * @public + */ +export namespace PayloadUnion { + export interface UnionMemberMember { + unionMember: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + unionMember?: never; + $unknown: [string, any]; + } + + export interface Visitor { + unionMember: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: PayloadUnion, visitor: Visitor): T => { + if (value.unionMember !== undefined) return visitor.unionMember(value.unionMember); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface UnionPayloadEvent { + payload?: PayloadUnion | undefined; +} + +/** + * @public + */ +export type EventStream = + | EventStream.BlobPayloadMember + | EventStream.ErrorMember + | EventStream.HeadersMember + | EventStream.HeadersAndExplicitPayloadMember + | EventStream.HeadersAndImplicitPayloadMember + | EventStream.StringPayloadMember + | EventStream.StructurePayloadMember + | EventStream.UnionPayloadMember + | EventStream.$UnknownMember; + +/** + * @public + */ +export namespace EventStream { + export interface HeadersMember { + headers: HeadersEvent; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface BlobPayloadMember { + headers?: never; + blobPayload: BlobPayloadEvent; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface StringPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload: StringPayloadEvent; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface StructurePayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload: StructurePayloadEvent; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface UnionPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload: UnionPayloadEvent; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface HeadersAndExplicitPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload: HeadersAndExplicitPayloadEvent; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface HeadersAndImplicitPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload: HeadersAndImplicitPayloadEvent; + error?: never; + $unknown?: never; + } + + export interface ErrorMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error: ErrorEvent; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown: [string, any]; + } + + export interface Visitor { + headers: (value: HeadersEvent) => T; + blobPayload: (value: BlobPayloadEvent) => T; + stringPayload: (value: StringPayloadEvent) => T; + structurePayload: (value: StructurePayloadEvent) => T; + unionPayload: (value: UnionPayloadEvent) => T; + headersAndExplicitPayload: (value: HeadersAndExplicitPayloadEvent) => T; + headersAndImplicitPayload: (value: HeadersAndImplicitPayloadEvent) => T; + error: (value: ErrorEvent) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: EventStream, visitor: Visitor): T => { + if (value.headers !== undefined) return visitor.headers(value.headers); + if (value.blobPayload !== undefined) return visitor.blobPayload(value.blobPayload); + if (value.stringPayload !== undefined) return visitor.stringPayload(value.stringPayload); + if (value.structurePayload !== undefined) return visitor.structurePayload(value.structurePayload); + if (value.unionPayload !== undefined) return visitor.unionPayload(value.unionPayload); + if (value.headersAndExplicitPayload !== undefined) + return visitor.headersAndExplicitPayload(value.headersAndExplicitPayload); + if (value.headersAndImplicitPayload !== undefined) + return visitor.headersAndImplicitPayload(value.headersAndImplicitPayload); + if (value.error !== undefined) return visitor.error(value.error); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} +/** + * @internal + */ +export const EventStreamFilterSensitiveLog = (obj: EventStream): any => { + if (obj.headers !== undefined) return { headers: obj.headers }; + if (obj.blobPayload !== undefined) return { blobPayload: obj.blobPayload }; + if (obj.stringPayload !== undefined) return { stringPayload: obj.stringPayload }; + if (obj.structurePayload !== undefined) return { structurePayload: obj.structurePayload }; + if (obj.unionPayload !== undefined) return { unionPayload: obj.unionPayload }; + if (obj.headersAndExplicitPayload !== undefined) return { headersAndExplicitPayload: obj.headersAndExplicitPayload }; + if (obj.headersAndImplicitPayload !== undefined) return { headersAndImplicitPayload: obj.headersAndImplicitPayload }; + if (obj.error !== undefined) return { error: obj.error }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @public + */ +export interface DuplexStreamInput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamInputFilterSensitiveLog = (obj: DuplexStreamInput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + +/** + * @public + */ +export interface DuplexStreamOutput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamOutputFilterSensitiveLog = (obj: DuplexStreamOutput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + +/** + * @public + */ +export interface DuplexStreamWithDistinctStreamsInput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamWithDistinctStreamsInputFilterSensitiveLog = ( + obj: DuplexStreamWithDistinctStreamsInput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + +/** + * @public + */ +export interface SingletonEvent { + value?: string | undefined; +} + +/** + * @public + */ +export type SingletonEventStream = SingletonEventStream.SingletonMember | SingletonEventStream.$UnknownMember; + +/** + * @public + */ +export namespace SingletonEventStream { + export interface SingletonMember { + singleton: SingletonEvent; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + singleton?: never; + $unknown: [string, any]; + } + + export interface Visitor { + singleton: (value: SingletonEvent) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: SingletonEventStream, visitor: Visitor): T => { + if (value.singleton !== undefined) return visitor.singleton(value.singleton); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + */ +export interface DuplexStreamWithDistinctStreamsOutput { + stream?: SingletonEventStream | undefined; +} + +/** + * @public + */ +export interface DuplexStreamWithInitialMessagesInput { + initialRequestMember: string | undefined; + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamWithInitialMessagesInputFilterSensitiveLog = ( + obj: DuplexStreamWithInitialMessagesInput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + +/** + * @public + */ +export interface DuplexStreamWithInitialMessagesOutput { + initialResponseMember: string | undefined; + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamWithInitialMessagesOutputFilterSensitiveLog = ( + obj: DuplexStreamWithInitialMessagesOutput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + /** * @public */ @@ -318,6 +717,13 @@ export interface HttpPrefixHeadersInResponseOutput { prefixHeaders?: Record | undefined; } +/** + * @public + */ +export interface HttpQueryParamsOnlyInput { + queryMap?: Record | undefined; +} + /** * @public */ @@ -422,6 +828,37 @@ export interface InputAndOutputWithHeadersIO { headerIntegerEnumList?: IntegerEnum[] | undefined; } +/** + * @public + */ +export interface InputStreamInput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const InputStreamInputFilterSensitiveLog = (obj: InputStreamInput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + +/** + * @public + */ +export interface InputStreamWithInitialRequestInput { + initialRequestMember: string | undefined; + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const InputStreamWithInitialRequestInputFilterSensitiveLog = (obj: InputStreamWithInitialRequestInput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + /** * @public */ @@ -1124,6 +1561,39 @@ export interface OperationWithNestedStructureOutput { dialogMap?: Record | undefined; } +/** + * @public + */ +export interface OutputStreamOutput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const OutputStreamOutputFilterSensitiveLog = (obj: OutputStreamOutput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + +/** + * @public + */ +export interface OutputStreamWithInitialResponseOutput { + initialResponseMember: string | undefined; + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const OutputStreamWithInitialResponseOutputFilterSensitiveLog = ( + obj: OutputStreamWithInitialResponseOutput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); + /** * @public */ diff --git a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts index b23ab0d961a12..51ce07fa49d4d 100644 --- a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts +++ b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts @@ -6,6 +6,7 @@ import { parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core"; import { requestBuilder as rb } from "@smithy/core"; +import { Int64 as __Int64 } from "@smithy/eventstream-codec"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -54,6 +55,9 @@ import { import { DocumentType as __DocumentType, Endpoint as __Endpoint, + EventStreamSerdeContext as __EventStreamSerdeContext, + Message as __Message, + MessageHeaders as __MessageHeaders, ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, SerdeContext as __SerdeContext, @@ -86,6 +90,15 @@ import { DocumentTypeAsPayloadCommandOutput, } from "../commands/DocumentTypeAsPayloadCommand"; import { DocumentTypeCommandInput, DocumentTypeCommandOutput } from "../commands/DocumentTypeCommand"; +import { DuplexStreamCommandInput, DuplexStreamCommandOutput } from "../commands/DuplexStreamCommand"; +import { + DuplexStreamWithDistinctStreamsCommandInput, + DuplexStreamWithDistinctStreamsCommandOutput, +} from "../commands/DuplexStreamWithDistinctStreamsCommand"; +import { + DuplexStreamWithInitialMessagesCommandInput, + DuplexStreamWithInitialMessagesCommandOutput, +} from "../commands/DuplexStreamWithInitialMessagesCommand"; import { EmptyInputAndEmptyOutputCommandInput, EmptyInputAndEmptyOutputCommandOutput, @@ -128,6 +141,10 @@ import { HttpPrefixHeadersInResponseCommandInput, HttpPrefixHeadersInResponseCommandOutput, } from "../commands/HttpPrefixHeadersInResponseCommand"; +import { + HttpQueryParamsOnlyOperationCommandInput, + HttpQueryParamsOnlyOperationCommandOutput, +} from "../commands/HttpQueryParamsOnlyOperationCommand"; import { HttpRequestWithFloatLabelsCommandInput, HttpRequestWithFloatLabelsCommandOutput, @@ -158,6 +175,11 @@ import { InputAndOutputWithHeadersCommandInput, InputAndOutputWithHeadersCommandOutput, } from "../commands/InputAndOutputWithHeadersCommand"; +import { InputStreamCommandInput, InputStreamCommandOutput } from "../commands/InputStreamCommand"; +import { + InputStreamWithInitialRequestCommandInput, + InputStreamWithInitialRequestCommandOutput, +} from "../commands/InputStreamWithInitialRequestCommand"; import { JsonBlobsCommandInput, JsonBlobsCommandOutput } from "../commands/JsonBlobsCommand"; import { JsonEnumsCommandInput, JsonEnumsCommandOutput } from "../commands/JsonEnumsCommand"; import { JsonIntEnumsCommandInput, JsonIntEnumsCommandOutput } from "../commands/JsonIntEnumsCommand"; @@ -288,6 +310,11 @@ import { OperationWithNestedStructureCommandInput, OperationWithNestedStructureCommandOutput, } from "../commands/OperationWithNestedStructureCommand"; +import { OutputStreamCommandInput, OutputStreamCommandOutput } from "../commands/OutputStreamCommand"; +import { + OutputStreamWithInitialResponseCommandInput, + OutputStreamWithInitialResponseCommandOutput, +} from "../commands/OutputStreamWithInitialResponseCommand"; import { PostPlayerActionCommandInput, PostPlayerActionCommandOutput } from "../commands/PostPlayerActionCommand"; import { PostUnionWithJsonNameCommandInput, @@ -352,26 +379,36 @@ import { } from "../commands/TimestampFormatHeadersCommand"; import { UnitInputAndOutputCommandInput, UnitInputAndOutputCommandOutput } from "../commands/UnitInputAndOutputCommand"; import { FooEnum, IntegerEnum } from "../models/enums"; -import { ComplexError, FooError, InvalidGreeting } from "../models/errors"; +import { ComplexError, ErrorEvent, FooError, InvalidGreeting, ServiceUnavailableError } from "../models/errors"; import { + BlobPayloadEvent, ClientOptionalDefaults, ComplexNestedErrorData, Defaults, Dialog, + EventStream, Farewell, GreetingStruct, + HeadersAndExplicitPayloadEvent, + HeadersAndImplicitPayloadEvent, + HeadersEvent, MyUnion, NestedPayload, PayloadConfig, + PayloadStructure, + PayloadUnion, PlayerAction, RecursiveShapesInputOutputNested1, RecursiveShapesInputOutputNested2, RenamedGreeting, SimpleUnion, + StringPayloadEvent, StructureListMember, + StructurePayloadEvent, TestConfig, TopLevel, UnionPayload, + UnionPayloadEvent, UnionWithJsonName, Unit, } from "../models/models_0"; @@ -586,6 +623,67 @@ export const se_DocumentTypeAsPayloadCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1DuplexStreamCommand + */ +export const se_DuplexStreamCommand = async ( + input: DuplexStreamCommandInput, + context: __SerdeContext & __EventStreamSerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/DuplexStream"); + let body: any; + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DuplexStreamWithDistinctStreamsCommand + */ +export const se_DuplexStreamWithDistinctStreamsCommand = async ( + input: DuplexStreamWithDistinctStreamsCommandInput, + context: __SerdeContext & __EventStreamSerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/DuplexStreamWithDistinctStreams"); + let body: any; + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DuplexStreamWithInitialMessagesCommand + */ +export const se_DuplexStreamWithInitialMessagesCommand = async ( + input: DuplexStreamWithInitialMessagesCommandInput, + context: __SerdeContext & __EventStreamSerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_irm]: input[_iRM]!, + }); + b.bp("/DuplexStreamWithInitialMessages"); + let body: any; + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1EmptyInputAndEmptyOutputCommand */ @@ -894,6 +992,24 @@ export const se_HttpPrefixHeadersInResponseCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1HttpQueryParamsOnlyOperationCommand + */ +export const se_HttpQueryParamsOnlyOperationCommand = async ( + input: HttpQueryParamsOnlyOperationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/http-query-params-only"); + const query: any = map({ + ...convertMap(input.queryMap), + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + /** * serializeAws_restJson1HttpRequestWithFloatLabelsCommand */ @@ -1103,6 +1219,47 @@ export const se_InputAndOutputWithHeadersCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1InputStreamCommand + */ +export const se_InputStreamCommand = async ( + input: InputStreamCommandInput, + context: __SerdeContext & __EventStreamSerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/InputStream"); + let body: any; + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1InputStreamWithInitialRequestCommand + */ +export const se_InputStreamWithInitialRequestCommand = async ( + input: InputStreamWithInitialRequestCommandInput, + context: __SerdeContext & __EventStreamSerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_irm]: input[_iRM]!, + }); + b.bp("/InputStreamWithInitialRequest"); + let body: any; + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1JsonBlobsCommand */ @@ -2178,6 +2335,36 @@ export const se_OperationWithNestedStructureCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1OutputStreamCommand + */ +export const se_OutputStreamCommand = async ( + input: OutputStreamCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/OutputStream"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1OutputStreamWithInitialResponseCommand + */ +export const se_OutputStreamWithInitialResponseCommand = async ( + input: OutputStreamWithInitialResponseCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/OutputStreamWithInitialResponse"); + let body: any; + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1PostPlayerActionCommand */ @@ -2817,6 +3004,63 @@ export const de_DocumentTypeAsPayloadCommand = async ( return contents; }; +/** + * deserializeAws_restJson1DuplexStreamCommand + */ +export const de_DuplexStreamCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + +/** + * deserializeAws_restJson1DuplexStreamWithDistinctStreamsCommand + */ +export const de_DuplexStreamWithDistinctStreamsCommand = 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.stream = __expectUnion(_json(data)); + } + return contents; +}; + +/** + * deserializeAws_restJson1DuplexStreamWithInitialMessagesCommand + */ +export const de_DuplexStreamWithInitialMessagesCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_iRMn]: [, output.headers[_irm_]], + }); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + /** * deserializeAws_restJson1EmptyInputAndEmptyOutputCommand */ @@ -3119,6 +3363,23 @@ export const de_HttpPrefixHeadersInResponseCommand = async ( return contents; }; +/** + * deserializeAws_restJson1HttpQueryParamsOnlyOperationCommand + */ +export const de_HttpQueryParamsOnlyOperationCommand = 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_restJson1HttpRequestWithFloatLabelsCommand */ @@ -3322,6 +3583,40 @@ export const de_InputAndOutputWithHeadersCommand = async ( return contents; }; +/** + * deserializeAws_restJson1InputStreamCommand + */ +export const de_InputStreamCommand = 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_restJson1InputStreamWithInitialRequestCommand + */ +export const de_InputStreamWithInitialRequestCommand = 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_restJson1JsonBlobsCommand */ @@ -4270,6 +4565,43 @@ export const de_OperationWithNestedStructureCommand = async ( return contents; }; +/** + * deserializeAws_restJson1OutputStreamCommand + */ +export const de_OutputStreamCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + +/** + * deserializeAws_restJson1OutputStreamWithInitialResponseCommand + */ +export const de_OutputStreamWithInitialResponseCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_iRMn]: [, output.headers[_irm_]], + }); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + /** * deserializeAws_restJson1PostPlayerActionCommand */ @@ -4767,6 +5099,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ServiceUnavailableError": + case "aws.protocoltests.restjson#ServiceUnavailableError": + throw await de_ServiceUnavailableErrorRes(parsedOutput, context); case "ComplexError": case "aws.protocoltests.restjson#ComplexError": throw await de_ComplexErrorRes(parsedOutput, context); @@ -4839,6 +5174,352 @@ const de_InvalidGreetingRes = async (parsedOutput: any, context: __SerdeContext) return __decorateServiceException(exception, parsedOutput.body); }; +/** + * deserializeAws_restJson1ServiceUnavailableErrorRes + */ +const de_ServiceUnavailableErrorRes = 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 ServiceUnavailableError({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * serializeAws_restJson1EventStream + */ +const se_EventStream = (input: any, context: __SerdeContext & __EventStreamSerdeContext): any => { + const eventMarshallingVisitor = (event: any): __Message => + EventStream.visit(event, { + headers: (value) => se_HeadersEvent_event(value, context), + blobPayload: (value) => se_BlobPayloadEvent_event(value, context), + stringPayload: (value) => se_StringPayloadEvent_event(value, context), + structurePayload: (value) => se_StructurePayloadEvent_event(value, context), + unionPayload: (value) => se_UnionPayloadEvent_event(value, context), + headersAndExplicitPayload: (value) => se_HeadersAndExplicitPayloadEvent_event(value, context), + headersAndImplicitPayload: (value) => se_HeadersAndImplicitPayloadEvent_event(value, context), + error: (value) => se_ErrorEvent_event(value, context), + _: (value) => value as any, + }); + return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor); +}; +const se_BlobPayloadEvent_event = (input: BlobPayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "blobPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/octet-stream" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = input.payload; + } + return { headers, body }; +}; +const se_ErrorEvent_event = (input: ErrorEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "error" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + let body = new Uint8Array(); + body = _json(input); + body = context.utf8Decoder(JSON.stringify(body)); + return { headers, body }; +}; +const se_HeadersAndExplicitPayloadEvent_event = ( + input: HeadersAndExplicitPayloadEvent, + context: __SerdeContext +): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "headersAndExplicitPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + if (input.header != null) { + headers["header"] = { type: "string", value: input.header }; + } + let body = new Uint8Array(); + if (input.payload != null) { + body = _json(input.payload); + body = context.utf8Decoder(JSON.stringify(body)); + } + return { headers, body }; +}; +const se_HeadersAndImplicitPayloadEvent_event = ( + input: HeadersAndImplicitPayloadEvent, + context: __SerdeContext +): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "headersAndImplicitPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + if (input.header != null) { + headers["header"] = { type: "string", value: input.header }; + } + let body = new Uint8Array(); + delete input["header"]; + body = _json(input); + body = context.utf8Decoder(JSON.stringify(body)); + return { headers, body }; +}; +const se_HeadersEvent_event = (input: HeadersEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "headers" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + if (input.booleanHeader != null) { + headers["booleanHeader"] = { type: "boolean", value: input.booleanHeader }; + } + if (input.byteHeader != null) { + headers["byteHeader"] = { type: "byte", value: input.byteHeader }; + } + if (input.shortHeader != null) { + headers["shortHeader"] = { type: "short", value: input.shortHeader }; + } + if (input.intHeader != null) { + headers["intHeader"] = { type: "integer", value: input.intHeader }; + } + if (input.longHeader != null) { + headers["longHeader"] = { type: "long", value: __Int64.fromNumber(input.longHeader) }; + } + if (input.blobHeader != null) { + headers["blobHeader"] = { type: "binary", value: input.blobHeader }; + } + if (input.stringHeader != null) { + headers["stringHeader"] = { type: "string", value: input.stringHeader }; + } + if (input.timestampHeader != null) { + headers["timestampHeader"] = { type: "timestamp", value: input.timestampHeader }; + } + let body = new Uint8Array(); + delete input["booleanHeader"]; + delete input["byteHeader"]; + delete input["shortHeader"]; + delete input["intHeader"]; + delete input["longHeader"]; + delete input["blobHeader"]; + delete input["stringHeader"]; + delete input["timestampHeader"]; + body = se_HeadersEvent(input, context); + body = context.utf8Decoder(JSON.stringify(body)); + return { headers, body }; +}; +const se_StringPayloadEvent_event = (input: StringPayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "stringPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "text/plain" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = context.utf8Decoder(input.payload); + } + return { headers, body }; +}; +const se_StructurePayloadEvent_event = (input: StructurePayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "structurePayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = _json(input.payload); + body = context.utf8Decoder(JSON.stringify(body)); + } + return { headers, body }; +}; +const se_UnionPayloadEvent_event = (input: UnionPayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "unionPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = _json(input.payload); + body = context.utf8Decoder(JSON.stringify(body)); + } + return { headers, body }; +}; +/** + * deserializeAws_restJson1EventStream + */ +const de_EventStream = ( + output: any, + context: __SerdeContext & __EventStreamSerdeContext +): AsyncIterable => { + return context.eventStreamMarshaller.deserialize(output, async (event) => { + if (event["headers"] != null) { + return { + headers: await de_HeadersEvent_event(event["headers"], context), + }; + } + if (event["blobPayload"] != null) { + return { + blobPayload: await de_BlobPayloadEvent_event(event["blobPayload"], context), + }; + } + if (event["stringPayload"] != null) { + return { + stringPayload: await de_StringPayloadEvent_event(event["stringPayload"], context), + }; + } + if (event["structurePayload"] != null) { + return { + structurePayload: await de_StructurePayloadEvent_event(event["structurePayload"], context), + }; + } + if (event["unionPayload"] != null) { + return { + unionPayload: await de_UnionPayloadEvent_event(event["unionPayload"], context), + }; + } + if (event["headersAndExplicitPayload"] != null) { + return { + headersAndExplicitPayload: await de_HeadersAndExplicitPayloadEvent_event( + event["headersAndExplicitPayload"], + context + ), + }; + } + if (event["headersAndImplicitPayload"] != null) { + return { + headersAndImplicitPayload: await de_HeadersAndImplicitPayloadEvent_event( + event["headersAndImplicitPayload"], + context + ), + }; + } + if (event["error"] != null) { + return { + error: await de_ErrorEvent_event(event["error"], context), + }; + } + return { $unknown: event as any }; + }); +}; +const de_BlobPayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: BlobPayloadEvent = {} as any; + contents.payload = output.body; + return contents; +}; +const de_ErrorEvent_event = async (output: any, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + return de_ErrorEventRes(parsedOutput, context); +}; +const de_HeadersAndExplicitPayloadEvent_event = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: HeadersAndExplicitPayloadEvent = {} as any; + if (output.headers[_he] !== undefined) { + contents[_he] = output.headers[_he].value; + } + + const data: any = await parseBody(output.body, context); + contents.payload = _json(data); + return contents; +}; +const de_HeadersAndImplicitPayloadEvent_event = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: HeadersAndImplicitPayloadEvent = {} as any; + if (output.headers[_he] !== undefined) { + contents[_he] = output.headers[_he].value; + } + + const data: any = await parseBody(output.body, context); + Object.assign(contents, _json(data)); + return contents; +}; +const de_HeadersEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: HeadersEvent = {} as any; + if (output.headers[_bH] !== undefined) { + contents[_bH] = output.headers[_bH].value; + } + + if (output.headers[_bHy] !== undefined) { + contents[_bHy] = output.headers[_bHy].value; + } + + if (output.headers[_sHh] !== undefined) { + contents[_sHh] = output.headers[_sHh].value; + } + + if (output.headers[_iH] !== undefined) { + contents[_iH] = output.headers[_iH].value; + } + + if (output.headers[_lH] !== undefined) { + contents[_lH] = output.headers[_lH].value; + } + + if (output.headers[_bHl] !== undefined) { + contents[_bHl] = output.headers[_bHl].value; + } + + if (output.headers[_sHt] !== undefined) { + contents[_sHt] = output.headers[_sHt].value; + } + + if (output.headers[_tH] !== undefined) { + contents[_tH] = output.headers[_tH].value; + } + + const data: any = await parseBody(output.body, context); + Object.assign(contents, de_HeadersEvent(data, context)); + return contents; +}; +const de_StringPayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: StringPayloadEvent = {} as any; + contents.payload = await collectBodyString(output.body, context); + return contents; +}; +const de_StructurePayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: StructurePayloadEvent = {} as any; + const data: any = await parseBody(output.body, context); + contents.payload = _json(data); + return contents; +}; +const de_UnionPayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: UnionPayloadEvent = {} as any; + const data: any = await parseBody(output.body, context); + contents.payload = _json(data); + return contents; +}; +/** + * deserializeAws_restJson1ErrorEventRes + */ +const de_ErrorEventRes = 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 ErrorEvent({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + // se_ClientOptionalDefaults omitted. /** @@ -4913,8 +5594,28 @@ const se_DocumentValuedMap = (input: Record, context: __ }, {}); }; +// se_ErrorEvent omitted. + // se_Farewell omitted. +// se_HeadersAndImplicitPayloadEvent omitted. + +/** + * serializeAws_restJson1HeadersEvent + */ +const se_HeadersEvent = (input: HeadersEvent, context: __SerdeContext): any => { + return take(input, { + blobHeader: context.base64Encoder, + booleanHeader: [], + byteHeader: [], + intHeader: [], + longHeader: [], + shortHeader: [], + stringHeader: [], + timestampHeader: __serializeDateTime, + }); +}; + /** * serializeAws_restJson1MyUnion */ @@ -4938,6 +5639,10 @@ const se_MyUnion = (input: MyUnion, context: __SerdeContext): any => { // se_PayloadConfig omitted. +// se_PayloadStructure omitted. + +// se_PayloadUnion omitted. + // se_PlayerAction omitted. /** @@ -5187,6 +5892,24 @@ const de_DocumentValuedMap = (output: any, context: __SerdeContext): Record { + return take(output, { + blobHeader: context.base64Decoder, + booleanHeader: __expectBoolean, + byteHeader: __expectByte, + intHeader: __expectInt32, + longHeader: __expectLong, + shortHeader: __expectShort, + stringHeader: __expectString, + timestampHeader: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + /** * deserializeAws_restJson1MyUnion */ @@ -5240,6 +5963,10 @@ const de_MyUnion = (output: any, context: __SerdeContext): MyUnion => { // de_PayloadConfig omitted. +// de_PayloadStructure omitted. + +// de_PayloadUnion omitted. + // de_PlayerAction omitted. /** @@ -5268,6 +5995,10 @@ const de_RecursiveShapesInputOutputNested2 = ( }) as any; }; +// de_SingletonEvent omitted. + +// de_SingletonEventStream omitted. + /** * deserializeAws_restJson1SparseBooleanMap */ @@ -5490,6 +6221,9 @@ const _TL = "TimestampList"; const _a = "a"; const _amth = "amz-media-typed-header"; const _b = "baz"; +const _bH = "booleanHeader"; +const _bHl = "blobHeader"; +const _bHy = "byteHeader"; const _bIH = "booleanInHeader"; const _bIHy = "byteInHeader"; const _bIQ = "booleanInQuery"; @@ -5536,10 +6270,16 @@ const _hTB = "headerTrueBool"; const _hTL = "headerTimestampList"; const _he = "header"; const _i = "integerinheader"; +const _iH = "intHeader"; const _iIH = "integerInHeader"; const _iIQ = "integerInQuery"; +const _iRM = "initialRequestMember"; +const _iRMn = "initialResponseMember"; +const _irm = "initial-request-member"; +const _irm_ = "initial-response-member"; const _j = "json"; const _l = "longinheader"; +const _lH = "longHeader"; const _lIH = "longInHeader"; const _lIQ = "longInQuery"; const _mDT = "memberDateTime"; @@ -5570,11 +6310,14 @@ const _qT = "queryTimestamp"; const _qTL = "queryTimestampList"; const _s = "shortinheader"; const _sH = "specificHeader"; +const _sHh = "shortHeader"; +const _sHt = "stringHeader"; const _sIH = "shortInHeader"; const _sIQ = "shortInQuery"; const _t = "timestamp"; const _tDT = "targetDateTime"; const _tES = "targetEpochSeconds"; +const _tH = "timestampHeader"; const _tHD = "targetHttpDate"; const _tI = "testId"; const _to = "token"; diff --git a/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts b/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts index 397966de10cf6..2b16c22f9d875 100644 --- a/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts @@ -5,9 +5,10 @@ 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 { eventStreamSerdeProvider } from "@smithy/eventstream-serde-browser"; 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 { invalidFunction, invalidProvider } from "@smithy/invalid-dependency"; import { Md5 } from "@smithy/md5-js"; import { DEFAULT_DISABLE_REQUEST_COMPRESSION, @@ -39,6 +40,10 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, + eventStreamPayloadHandlerProvider: + config?.eventStreamPayloadHandlerProvider ?? + (() => ({ handle: invalidFunction("event stream request is not supported in browser.") })), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, md5: config?.md5 ?? Md5, region: config?.region ?? invalidProvider("Region is missing"), diff --git a/private/aws-protocoltests-restjson/src/runtimeConfig.native.ts b/private/aws-protocoltests-restjson/src/runtimeConfig.native.ts index 48bc89d417bd9..413dc1c065160 100644 --- a/private/aws-protocoltests-restjson/src/runtimeConfig.native.ts +++ b/private/aws-protocoltests-restjson/src/runtimeConfig.native.ts @@ -1,5 +1,6 @@ // smithy-typescript generated code import { Sha256 } from "@aws-crypto/sha256-js"; +import { invalidFunction } from "@smithy/invalid-dependency"; import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; @@ -13,6 +14,9 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { ...browserDefaults, ...config, runtime: "react-native", + eventStreamPayloadHandlerProvider: + config?.eventStreamPayloadHandlerProvider ?? + (() => ({ handle: invalidFunction("event stream request is not supported in ReactNative.") })), sha256: config?.sha256 ?? Sha256, }; }; diff --git a/private/aws-protocoltests-restjson/src/runtimeConfig.ts b/private/aws-protocoltests-restjson/src/runtimeConfig.ts index f5f4b2fb3ca27..bdc0958ab8a38 100644 --- a/private/aws-protocoltests-restjson/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restjson/src/runtimeConfig.ts @@ -4,6 +4,7 @@ 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 { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node"; import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node"; import { NODE_REGION_CONFIG_FILE_OPTIONS, @@ -11,6 +12,7 @@ import { NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver"; +import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-node"; import { Hash } from "@smithy/hash-node"; import { fileStreamHasher as streamHasher } from "@smithy/hash-stream-node"; import { @@ -55,6 +57,8 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), md5: config?.md5 ?? Hash.bind(null, "md5"), region: diff --git a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts index 49e2e78849f01..1cd35f81ce592 100644 --- a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts +++ b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts @@ -28,6 +28,7 @@ import { HttpPayloadWithStructureCommand } from "../../src/commands/HttpPayloadW import { HttpPayloadWithUnionCommand } from "../../src/commands/HttpPayloadWithUnionCommand"; import { HttpPrefixHeadersCommand } from "../../src/commands/HttpPrefixHeadersCommand"; import { HttpPrefixHeadersInResponseCommand } from "../../src/commands/HttpPrefixHeadersInResponseCommand"; +import { HttpQueryParamsOnlyOperationCommand } from "../../src/commands/HttpQueryParamsOnlyOperationCommand"; import { HttpRequestWithFloatLabelsCommand } from "../../src/commands/HttpRequestWithFloatLabelsCommand"; import { HttpRequestWithGreedyLabelInPathCommand } from "../../src/commands/HttpRequestWithGreedyLabelInPathCommand"; import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../src/commands/HttpRequestWithLabelsAndTimestampFormatCommand"; @@ -3191,6 +3192,67 @@ it("HttpPrefixHeadersResponse:Response", async () => { }); }); +/** + * Test that httpQueryParams are included in request when no other query parameters exist + */ +it("HttpQueryParamsOnlyRequest:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpQueryParamsOnlyOperationCommand({ + queryMap: { + a: "b", + c: "d", + } 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("/http-query-params-only"); + + const queryString = buildQueryString(r.query); + expect(queryString).toContain("a=b"); + expect(queryString).toContain("c=d"); + } +}); + +/** + * Test that empty httpQueryParams map results in no query parameters + */ +it("HttpQueryParamsOnlyEmptyRequest:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpQueryParamsOnlyOperationCommand({ + queryMap: {} 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("/http-query-params-only"); + } +}); + /** * Supports handling NaN float label values. */ diff --git a/private/aws-protocoltests-restxml-schema/README.md b/private/aws-protocoltests-restxml-schema/README.md index 027ea898a421c..0a5ed752db09c 100644 --- a/private/aws-protocoltests-restxml-schema/README.md +++ b/private/aws-protocoltests-restxml-schema/README.md @@ -1018,6 +1018,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1162,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1242,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1650,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-protocoltests-restxml/README.md b/private/aws-protocoltests-restxml/README.md index b0f4fe83c0704..b99cc7eff0aff 100644 --- a/private/aws-protocoltests-restxml/README.md +++ b/private/aws-protocoltests-restxml/README.md @@ -1018,6 +1018,30 @@ 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/) +
+
+ +DuplexStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DuplexStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamCommandOutput/) + +
+
+ +DuplexStreamWithDistinctStreams + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DuplexStreamWithDistinctStreamsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithDistinctStreamsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithDistinctStreamsCommandOutput/) + +
+
+ +DuplexStreamWithInitialMessages + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/DuplexStreamWithInitialMessagesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithInitialMessagesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/DuplexStreamWithInitialMessagesCommandOutput/) +
@@ -1138,6 +1162,14 @@ 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/) +
+
+ +HttpQueryParamsOnlyOperation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/HttpQueryParamsOnlyOperationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpQueryParamsOnlyOperationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/HttpQueryParamsOnlyOperationCommandOutput/) +
@@ -1210,6 +1242,22 @@ 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/) +
+
+ +InputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/InputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamCommandOutput/) + +
+
+ +InputStreamWithInitialRequest + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/InputStreamWithInitialRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamWithInitialRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/InputStreamWithInitialRequestCommandOutput/) +
@@ -1602,6 +1650,22 @@ 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/) +
+
+ +OutputStream + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OutputStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamCommandOutput/) + +
+
+ +OutputStreamWithInitialResponse + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rest-xml-protocol/command/OutputStreamWithInitialResponseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamWithInitialResponseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rest-xml-protocol/Interface/OutputStreamWithInitialResponseCommandOutput/) +
diff --git a/private/aws-restjson-server/package.json b/private/aws-restjson-server/package.json index f3001dc4457bb..356c8c035df74 100644 --- a/private/aws-restjson-server/package.json +++ b/private/aws-restjson-server/package.json @@ -24,6 +24,7 @@ "@aws-sdk/types": "*", "@aws-smithy/server-common": "1.0.0-alpha.10", "@smithy/config-resolver": "^4.4.3", + "@smithy/eventstream-codec": "^4.2.5", "@smithy/fetch-http-handler": "^5.3.6", "@smithy/hash-node": "^4.2.5", "@smithy/invalid-dependency": "^4.2.5", diff --git a/private/aws-restjson-server/src/index.ts b/private/aws-restjson-server/src/index.ts index 3cd32cba1eacc..f0fc8f018680a 100644 --- a/private/aws-restjson-server/src/index.ts +++ b/private/aws-restjson-server/src/index.ts @@ -1,10 +1,5 @@ // smithy-typescript generated code /* eslint-disable */ -/** - * A REST JSON service that sends JSON requests and responses. - * - * @packageDocumentation - */ export * as Aws_restJson1 from "./protocols/Aws_restJson1"; export * from "./server/index"; diff --git a/private/aws-restjson-server/src/models/errors.ts b/private/aws-restjson-server/src/models/errors.ts index 78ccedf7f5909..4eb3b21dcefa1 100644 --- a/private/aws-restjson-server/src/models/errors.ts +++ b/private/aws-restjson-server/src/models/errors.ts @@ -27,6 +27,38 @@ export class ComplexError extends __BaseException { } } +/** + * @public + */ +export class ErrorEvent extends __BaseException { + readonly name = "ErrorEvent" as const; + readonly $fault = "client" as const; + constructor(opts: __ExceptionOptionType) { + super({ + name: "ErrorEvent", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ErrorEvent.prototype); + } +} + +/** + * @public + */ +export class ServiceUnavailableError extends __BaseException { + readonly name = "ServiceUnavailableError" as const; + readonly $fault = "server" as const; + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceUnavailableError", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, ServiceUnavailableError.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. diff --git a/private/aws-restjson-server/src/models/models_0.ts b/private/aws-restjson-server/src/models/models_0.ts index 047e82f602e1b..cc6c306a684b7 100644 --- a/private/aws-restjson-server/src/models/models_0.ts +++ b/private/aws-restjson-server/src/models/models_0.ts @@ -9,6 +9,7 @@ import { MultiConstraintValidator as __MultiConstraintValidator, NoOpValidator as __NoOpValidator, RequiredValidator as __RequiredValidator, + ServiceException as __BaseException, UniqueItemsValidator as __UniqueItemsValidator, ValidationFailure as __ValidationFailure, } from "@aws-smithy/server-common"; @@ -17,6 +18,7 @@ import { DocumentType as __DocumentType, StreamingBlobTypes } from "@smithy/type import { Readable } from "stream"; import { FooEnum, IntegerEnum, StringEnum, TestEnum, TestIntEnum } from "./enums"; +import { ErrorEvent } from "./errors"; /** * @public @@ -264,6 +266,38 @@ export namespace AllQueryStringTypesInput { }; } +/** + * @public + */ +export interface BlobPayloadEvent { + payload?: Uint8Array | undefined; +} + +export namespace BlobPayloadEvent { + const memberValidators: { + payload?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: BlobPayloadEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "payload": { + memberValidators["payload"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("payload").validate(obj.payload, `${path}/payload`)]; + }; +} + /** * @public */ @@ -768,33 +802,1000 @@ export interface Dialog { farewell?: Farewell | undefined; } -export namespace Dialog { +export namespace Dialog { + const memberValidators: { + language?: __MultiConstraintValidator; + greeting?: __MultiConstraintValidator; + farewell?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: Dialog, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "language": { + memberValidators["language"] = new __NoOpValidator(); + break; + } + case "greeting": { + memberValidators["greeting"] = new __NoOpValidator(); + break; + } + case "farewell": { + memberValidators["farewell"] = new __CompositeStructureValidator( + new __NoOpValidator(), + Farewell.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("language").validate(obj.language, `${path}/language`), + ...getMemberValidator("greeting").validate(obj.greeting, `${path}/greeting`), + ...getMemberValidator("farewell").validate(obj.farewell, `${path}/farewell`), + ]; + }; +} + +/** + * @public + */ +export interface DocumentTypeInputOutput { + stringValue?: string | undefined; + documentValue?: __DocumentType | undefined; +} + +export namespace DocumentTypeInputOutput { + const memberValidators: { + stringValue?: __MultiConstraintValidator; + documentValue?: __MultiConstraintValidator<__DocumentType>; + } = {}; + /** + * @internal + */ + export const validate = (obj: DocumentTypeInputOutput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "stringValue": { + memberValidators["stringValue"] = new __NoOpValidator(); + break; + } + case "documentValue": { + memberValidators["documentValue"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("stringValue").validate(obj.stringValue, `${path}/stringValue`), + ...getMemberValidator("documentValue").validate(obj.documentValue, `${path}/documentValue`), + ]; + }; +} + +/** + * @public + */ +export interface DocumentTypeAsMapValueInputOutput { + docValuedMap?: Record | undefined; +} + +export namespace DocumentTypeAsMapValueInputOutput { + const memberValidators: { + docValuedMap?: __MultiConstraintValidator>; + } = {}; + /** + * @internal + */ + export const validate = (obj: DocumentTypeAsMapValueInputOutput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "docValuedMap": { + memberValidators["docValuedMap"] = new __CompositeMapValidator<__DocumentType>( + new __NoOpValidator(), + new __NoOpValidator(), + new __NoOpValidator() + ); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("docValuedMap").validate(obj.docValuedMap, `${path}/docValuedMap`)]; + }; +} + +/** + * @public + */ +export interface DocumentTypeAsPayloadInputOutput { + documentValue?: __DocumentType | undefined; +} + +export namespace DocumentTypeAsPayloadInputOutput { + const memberValidators: { + documentValue?: __MultiConstraintValidator<__DocumentType>; + } = {}; + /** + * @internal + */ + export const validate = (obj: DocumentTypeAsPayloadInputOutput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "documentValue": { + memberValidators["documentValue"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("documentValue").validate(obj.documentValue, `${path}/documentValue`)]; + }; +} + +/** + * @public + */ +export interface HeadersEvent { + booleanHeader?: boolean | undefined; + byteHeader?: number | undefined; + shortHeader?: number | undefined; + intHeader?: number | undefined; + longHeader?: number | undefined; + blobHeader?: Uint8Array | undefined; + stringHeader?: string | undefined; + timestampHeader?: Date | undefined; +} + +export namespace HeadersEvent { + const memberValidators: { + booleanHeader?: __MultiConstraintValidator; + byteHeader?: __MultiConstraintValidator; + shortHeader?: __MultiConstraintValidator; + intHeader?: __MultiConstraintValidator; + longHeader?: __MultiConstraintValidator; + blobHeader?: __MultiConstraintValidator; + stringHeader?: __MultiConstraintValidator; + timestampHeader?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: HeadersEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "booleanHeader": { + memberValidators["booleanHeader"] = new __NoOpValidator(); + break; + } + case "byteHeader": { + memberValidators["byteHeader"] = new __NoOpValidator(); + break; + } + case "shortHeader": { + memberValidators["shortHeader"] = new __NoOpValidator(); + break; + } + case "intHeader": { + memberValidators["intHeader"] = new __NoOpValidator(); + break; + } + case "longHeader": { + memberValidators["longHeader"] = new __NoOpValidator(); + break; + } + case "blobHeader": { + memberValidators["blobHeader"] = new __NoOpValidator(); + break; + } + case "stringHeader": { + memberValidators["stringHeader"] = new __NoOpValidator(); + break; + } + case "timestampHeader": { + memberValidators["timestampHeader"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("booleanHeader").validate(obj.booleanHeader, `${path}/booleanHeader`), + ...getMemberValidator("byteHeader").validate(obj.byteHeader, `${path}/byteHeader`), + ...getMemberValidator("shortHeader").validate(obj.shortHeader, `${path}/shortHeader`), + ...getMemberValidator("intHeader").validate(obj.intHeader, `${path}/intHeader`), + ...getMemberValidator("longHeader").validate(obj.longHeader, `${path}/longHeader`), + ...getMemberValidator("blobHeader").validate(obj.blobHeader, `${path}/blobHeader`), + ...getMemberValidator("stringHeader").validate(obj.stringHeader, `${path}/stringHeader`), + ...getMemberValidator("timestampHeader").validate(obj.timestampHeader, `${path}/timestampHeader`), + ]; + }; +} + +/** + * @public + */ +export interface PayloadStructure { + structureMember?: string | undefined; +} + +export namespace PayloadStructure { + const memberValidators: { + structureMember?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: PayloadStructure, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "structureMember": { + memberValidators["structureMember"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("structureMember").validate(obj.structureMember, `${path}/structureMember`)]; + }; +} + +/** + * @public + */ +export interface HeadersAndExplicitPayloadEvent { + header?: string | undefined; + payload?: PayloadStructure | undefined; +} + +export namespace HeadersAndExplicitPayloadEvent { + const memberValidators: { + header?: __MultiConstraintValidator; + payload?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: HeadersAndExplicitPayloadEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "header": { + memberValidators["header"] = new __NoOpValidator(); + break; + } + case "payload": { + memberValidators["payload"] = new __CompositeStructureValidator( + new __NoOpValidator(), + PayloadStructure.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("header").validate(obj.header, `${path}/header`), + ...getMemberValidator("payload").validate(obj.payload, `${path}/payload`), + ]; + }; +} + +/** + * @public + */ +export interface HeadersAndImplicitPayloadEvent { + header?: string | undefined; + payload?: string | undefined; +} + +export namespace HeadersAndImplicitPayloadEvent { + const memberValidators: { + header?: __MultiConstraintValidator; + payload?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: HeadersAndImplicitPayloadEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "header": { + memberValidators["header"] = new __NoOpValidator(); + break; + } + case "payload": { + memberValidators["payload"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("header").validate(obj.header, `${path}/header`), + ...getMemberValidator("payload").validate(obj.payload, `${path}/payload`), + ]; + }; +} + +/** + * @public + */ +export interface StringPayloadEvent { + payload?: string | undefined; +} + +export namespace StringPayloadEvent { + const memberValidators: { + payload?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: StringPayloadEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "payload": { + memberValidators["payload"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("payload").validate(obj.payload, `${path}/payload`)]; + }; +} + +/** + * @public + */ +export interface StructurePayloadEvent { + payload?: PayloadStructure | undefined; +} + +export namespace StructurePayloadEvent { + const memberValidators: { + payload?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: StructurePayloadEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "payload": { + memberValidators["payload"] = new __CompositeStructureValidator( + new __NoOpValidator(), + PayloadStructure.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("payload").validate(obj.payload, `${path}/payload`)]; + }; +} + +/** + * @public + */ +export type PayloadUnion = PayloadUnion.UnionMemberMember | PayloadUnion.$UnknownMember; + +/** + * @public + */ +export namespace PayloadUnion { + export interface UnionMemberMember { + unionMember: string; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + unionMember?: never; + $unknown: [string, any]; + } + + export interface Visitor { + unionMember: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: PayloadUnion, visitor: Visitor): T => { + if (value.unionMember !== undefined) return visitor.unionMember(value.unionMember); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; + + const memberValidators: { + unionMember?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: PayloadUnion, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "unionMember": { + memberValidators["unionMember"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("unionMember").validate(obj.unionMember, `${path}/unionMember`)]; + }; +} + +/** + * @public + */ +export interface UnionPayloadEvent { + payload?: PayloadUnion | undefined; +} + +export namespace UnionPayloadEvent { + const memberValidators: { + payload?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: UnionPayloadEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "payload": { + memberValidators["payload"] = new __CompositeStructureValidator( + new __NoOpValidator(), + PayloadUnion.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("payload").validate(obj.payload, `${path}/payload`)]; + }; +} + +/** + * @public + */ +export type EventStream = + | EventStream.BlobPayloadMember + | EventStream.ErrorMember + | EventStream.HeadersMember + | EventStream.HeadersAndExplicitPayloadMember + | EventStream.HeadersAndImplicitPayloadMember + | EventStream.StringPayloadMember + | EventStream.StructurePayloadMember + | EventStream.UnionPayloadMember + | EventStream.$UnknownMember; + +/** + * @public + */ +export namespace EventStream { + export interface HeadersMember { + headers: HeadersEvent; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface BlobPayloadMember { + headers?: never; + blobPayload: BlobPayloadEvent; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface StringPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload: StringPayloadEvent; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface StructurePayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload: StructurePayloadEvent; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface UnionPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload: UnionPayloadEvent; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface HeadersAndExplicitPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload: HeadersAndExplicitPayloadEvent; + headersAndImplicitPayload?: never; + error?: never; + $unknown?: never; + } + + export interface HeadersAndImplicitPayloadMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload: HeadersAndImplicitPayloadEvent; + error?: never; + $unknown?: never; + } + + export interface ErrorMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error: ErrorEvent; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + headers?: never; + blobPayload?: never; + stringPayload?: never; + structurePayload?: never; + unionPayload?: never; + headersAndExplicitPayload?: never; + headersAndImplicitPayload?: never; + error?: never; + $unknown: [string, any]; + } + + export interface Visitor { + headers: (value: HeadersEvent) => T; + blobPayload: (value: BlobPayloadEvent) => T; + stringPayload: (value: StringPayloadEvent) => T; + structurePayload: (value: StructurePayloadEvent) => T; + unionPayload: (value: UnionPayloadEvent) => T; + headersAndExplicitPayload: (value: HeadersAndExplicitPayloadEvent) => T; + headersAndImplicitPayload: (value: HeadersAndImplicitPayloadEvent) => T; + error: (value: ErrorEvent) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: EventStream, visitor: Visitor): T => { + if (value.headers !== undefined) return visitor.headers(value.headers); + if (value.blobPayload !== undefined) return visitor.blobPayload(value.blobPayload); + if (value.stringPayload !== undefined) return visitor.stringPayload(value.stringPayload); + if (value.structurePayload !== undefined) return visitor.structurePayload(value.structurePayload); + if (value.unionPayload !== undefined) return visitor.unionPayload(value.unionPayload); + if (value.headersAndExplicitPayload !== undefined) + return visitor.headersAndExplicitPayload(value.headersAndExplicitPayload); + if (value.headersAndImplicitPayload !== undefined) + return visitor.headersAndImplicitPayload(value.headersAndImplicitPayload); + if (value.error !== undefined) return visitor.error(value.error); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; + + const memberValidators: { + headers?: __MultiConstraintValidator; + blobPayload?: __MultiConstraintValidator; + stringPayload?: __MultiConstraintValidator; + structurePayload?: __MultiConstraintValidator; + unionPayload?: __MultiConstraintValidator; + headersAndExplicitPayload?: __MultiConstraintValidator; + headersAndImplicitPayload?: __MultiConstraintValidator; + error?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: EventStream, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "headers": { + memberValidators["headers"] = new __CompositeStructureValidator( + new __NoOpValidator(), + HeadersEvent.validate + ); + break; + } + case "blobPayload": { + memberValidators["blobPayload"] = new __CompositeStructureValidator( + new __NoOpValidator(), + BlobPayloadEvent.validate + ); + break; + } + case "stringPayload": { + memberValidators["stringPayload"] = new __CompositeStructureValidator( + new __NoOpValidator(), + StringPayloadEvent.validate + ); + break; + } + case "structurePayload": { + memberValidators["structurePayload"] = new __CompositeStructureValidator( + new __NoOpValidator(), + StructurePayloadEvent.validate + ); + break; + } + case "unionPayload": { + memberValidators["unionPayload"] = new __CompositeStructureValidator( + new __NoOpValidator(), + UnionPayloadEvent.validate + ); + break; + } + case "headersAndExplicitPayload": { + memberValidators["headersAndExplicitPayload"] = + new __CompositeStructureValidator( + new __NoOpValidator(), + HeadersAndExplicitPayloadEvent.validate + ); + break; + } + case "headersAndImplicitPayload": { + memberValidators["headersAndImplicitPayload"] = + new __CompositeStructureValidator( + new __NoOpValidator(), + HeadersAndImplicitPayloadEvent.validate + ); + break; + } + case "error": { + memberValidators["error"] = new __CompositeStructureValidator(new __NoOpValidator(), () => [ + /*Error validator unsupported*/ + ]); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("headers").validate(obj.headers, `${path}/headers`), + ...getMemberValidator("blobPayload").validate(obj.blobPayload, `${path}/blobPayload`), + ...getMemberValidator("stringPayload").validate(obj.stringPayload, `${path}/stringPayload`), + ...getMemberValidator("structurePayload").validate(obj.structurePayload, `${path}/structurePayload`), + ...getMemberValidator("unionPayload").validate(obj.unionPayload, `${path}/unionPayload`), + ...getMemberValidator("headersAndExplicitPayload").validate( + obj.headersAndExplicitPayload, + `${path}/headersAndExplicitPayload` + ), + ...getMemberValidator("headersAndImplicitPayload").validate( + obj.headersAndImplicitPayload, + `${path}/headersAndImplicitPayload` + ), + ...getMemberValidator("error").validate(obj.error, `${path}/error`), + ]; + }; +} +/** + * @internal + */ +export const EventStreamFilterSensitiveLog = (obj: EventStream): any => { + if (obj.headers !== undefined) return { headers: obj.headers }; + if (obj.blobPayload !== undefined) return { blobPayload: obj.blobPayload }; + if (obj.stringPayload !== undefined) return { stringPayload: obj.stringPayload }; + if (obj.structurePayload !== undefined) return { structurePayload: obj.structurePayload }; + if (obj.unionPayload !== undefined) return { unionPayload: obj.unionPayload }; + if (obj.headersAndExplicitPayload !== undefined) return { headersAndExplicitPayload: obj.headersAndExplicitPayload }; + if (obj.headersAndImplicitPayload !== undefined) return { headersAndImplicitPayload: obj.headersAndImplicitPayload }; + if (obj.error !== undefined) return { error: obj.error }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @public + */ +export interface DuplexStreamInput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamInputFilterSensitiveLog = (obj: DuplexStreamInput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace DuplexStreamInput { + const memberValidators: { + stream?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: DuplexStreamInput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; + }; +} + +/** + * @public + */ +export interface DuplexStreamOutput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamOutputFilterSensitiveLog = (obj: DuplexStreamOutput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace DuplexStreamOutput { + const memberValidators: { + stream?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: DuplexStreamOutput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; + }; +} + +/** + * @public + */ +export interface DuplexStreamWithDistinctStreamsInput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const DuplexStreamWithDistinctStreamsInputFilterSensitiveLog = ( + obj: DuplexStreamWithDistinctStreamsInput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace DuplexStreamWithDistinctStreamsInput { + const memberValidators: { + stream?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: DuplexStreamWithDistinctStreamsInput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; + }; +} + +/** + * @public + */ +export interface SingletonEvent { + value?: string | undefined; +} + +export namespace SingletonEvent { + const memberValidators: { + value?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: SingletonEvent, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "value": { + memberValidators["value"] = new __NoOpValidator(); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("value").validate(obj.value, `${path}/value`)]; + }; +} + +/** + * @public + */ +export type SingletonEventStream = SingletonEventStream.SingletonMember | SingletonEventStream.$UnknownMember; + +/** + * @public + */ +export namespace SingletonEventStream { + export interface SingletonMember { + singleton: SingletonEvent; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + singleton?: never; + $unknown: [string, any]; + } + + export interface Visitor { + singleton: (value: SingletonEvent) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: SingletonEventStream, visitor: Visitor): T => { + if (value.singleton !== undefined) return visitor.singleton(value.singleton); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; + const memberValidators: { - language?: __MultiConstraintValidator; - greeting?: __MultiConstraintValidator; - farewell?: __MultiConstraintValidator; + singleton?: __MultiConstraintValidator; } = {}; /** * @internal */ - export const validate = (obj: Dialog, path = ""): __ValidationFailure[] => { + export const validate = (obj: SingletonEventStream, path = ""): __ValidationFailure[] => { function getMemberValidator( member: T ): NonNullable<(typeof memberValidators)[T]> { if (memberValidators[member] === undefined) { switch (member) { - case "language": { - memberValidators["language"] = new __NoOpValidator(); - break; - } - case "greeting": { - memberValidators["greeting"] = new __NoOpValidator(); - break; - } - case "farewell": { - memberValidators["farewell"] = new __CompositeStructureValidator( + case "singleton": { + memberValidators["singleton"] = new __CompositeStructureValidator( new __NoOpValidator(), - Farewell.validate + SingletonEvent.validate ); break; } @@ -802,80 +1803,84 @@ export namespace Dialog { } return memberValidators[member]!; } - return [ - ...getMemberValidator("language").validate(obj.language, `${path}/language`), - ...getMemberValidator("greeting").validate(obj.greeting, `${path}/greeting`), - ...getMemberValidator("farewell").validate(obj.farewell, `${path}/farewell`), - ]; + return [...getMemberValidator("singleton").validate(obj.singleton, `${path}/singleton`)]; }; } /** * @public */ -export interface DocumentTypeInputOutput { - stringValue?: string | undefined; - documentValue?: __DocumentType | undefined; +export interface DuplexStreamWithDistinctStreamsOutput { + stream?: SingletonEventStream | undefined; } -export namespace DocumentTypeInputOutput { +export namespace DuplexStreamWithDistinctStreamsOutput { const memberValidators: { - stringValue?: __MultiConstraintValidator; - documentValue?: __MultiConstraintValidator<__DocumentType>; + stream?: __MultiConstraintValidator; } = {}; /** * @internal */ - export const validate = (obj: DocumentTypeInputOutput, path = ""): __ValidationFailure[] => { + export const validate = (obj: DuplexStreamWithDistinctStreamsOutput, path = ""): __ValidationFailure[] => { function getMemberValidator( member: T ): NonNullable<(typeof memberValidators)[T]> { if (memberValidators[member] === undefined) { switch (member) { - case "stringValue": { - memberValidators["stringValue"] = new __NoOpValidator(); - break; - } - case "documentValue": { - memberValidators["documentValue"] = new __NoOpValidator(); + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + SingletonEventStream.validate + ); break; } } } return memberValidators[member]!; } - return [ - ...getMemberValidator("stringValue").validate(obj.stringValue, `${path}/stringValue`), - ...getMemberValidator("documentValue").validate(obj.documentValue, `${path}/documentValue`), - ]; + return [...getMemberValidator("stream").validate(obj.stream, `${path}/stream`)]; }; } /** * @public */ -export interface DocumentTypeAsMapValueInputOutput { - docValuedMap?: Record | undefined; +export interface DuplexStreamWithInitialMessagesInput { + initialRequestMember: string | undefined; + stream?: AsyncIterable | undefined; } -export namespace DocumentTypeAsMapValueInputOutput { +/** + * @internal + */ +export const DuplexStreamWithInitialMessagesInputFilterSensitiveLog = ( + obj: DuplexStreamWithInitialMessagesInput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace DuplexStreamWithInitialMessagesInput { const memberValidators: { - docValuedMap?: __MultiConstraintValidator>; + initialRequestMember?: __MultiConstraintValidator; + stream?: __MultiConstraintValidator; } = {}; /** * @internal */ - export const validate = (obj: DocumentTypeAsMapValueInputOutput, path = ""): __ValidationFailure[] => { + export const validate = (obj: DuplexStreamWithInitialMessagesInput, path = ""): __ValidationFailure[] => { function getMemberValidator( member: T ): NonNullable<(typeof memberValidators)[T]> { if (memberValidators[member] === undefined) { switch (member) { - case "docValuedMap": { - memberValidators["docValuedMap"] = new __CompositeMapValidator<__DocumentType>( - new __NoOpValidator(), + case "initialRequestMember": { + memberValidators["initialRequestMember"] = new __CompositeValidator([new __RequiredValidator()]); + break; + } + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( new __NoOpValidator(), - new __NoOpValidator() + EventStream.validate ); break; } @@ -883,39 +1888,68 @@ export namespace DocumentTypeAsMapValueInputOutput { } return memberValidators[member]!; } - return [...getMemberValidator("docValuedMap").validate(obj.docValuedMap, `${path}/docValuedMap`)]; + return [ + ...getMemberValidator("initialRequestMember").validate(obj.initialRequestMember, `${path}/initialRequestMember`), + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; }; } /** * @public */ -export interface DocumentTypeAsPayloadInputOutput { - documentValue?: __DocumentType | undefined; +export interface DuplexStreamWithInitialMessagesOutput { + initialResponseMember: string | undefined; + stream?: AsyncIterable | undefined; } -export namespace DocumentTypeAsPayloadInputOutput { +/** + * @internal + */ +export const DuplexStreamWithInitialMessagesOutputFilterSensitiveLog = ( + obj: DuplexStreamWithInitialMessagesOutput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace DuplexStreamWithInitialMessagesOutput { const memberValidators: { - documentValue?: __MultiConstraintValidator<__DocumentType>; + initialResponseMember?: __MultiConstraintValidator; + stream?: __MultiConstraintValidator; } = {}; /** * @internal */ - export const validate = (obj: DocumentTypeAsPayloadInputOutput, path = ""): __ValidationFailure[] => { + export const validate = (obj: DuplexStreamWithInitialMessagesOutput, path = ""): __ValidationFailure[] => { function getMemberValidator( member: T ): NonNullable<(typeof memberValidators)[T]> { if (memberValidators[member] === undefined) { switch (member) { - case "documentValue": { - memberValidators["documentValue"] = new __NoOpValidator(); + case "initialResponseMember": { + memberValidators["initialResponseMember"] = new __CompositeValidator([new __RequiredValidator()]); + break; + } + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); break; } } } return memberValidators[member]!; } - return [...getMemberValidator("documentValue").validate(obj.documentValue, `${path}/documentValue`)]; + return [ + ...getMemberValidator("initialResponseMember").validate( + obj.initialResponseMember, + `${path}/initialResponseMember` + ), + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; }; } @@ -1618,6 +2652,42 @@ export namespace HttpPrefixHeadersInResponseOutput { }; } +/** + * @public + */ +export interface HttpQueryParamsOnlyInput { + queryMap?: Record | undefined; +} + +export namespace HttpQueryParamsOnlyInput { + const memberValidators: { + queryMap?: __MultiConstraintValidator>; + } = {}; + /** + * @internal + */ + export const validate = (obj: HttpQueryParamsOnlyInput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "queryMap": { + memberValidators["queryMap"] = new __CompositeMapValidator( + new __NoOpValidator(), + new __NoOpValidator(), + new __NoOpValidator() + ); + break; + } + } + } + return memberValidators[member]!; + } + return [...getMemberValidator("queryMap").validate(obj.queryMap, `${path}/queryMap`)]; + }; +} + /** * @public */ @@ -2179,6 +3249,103 @@ export namespace InputAndOutputWithHeadersIO { }; } +/** + * @public + */ +export interface InputStreamInput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const InputStreamInputFilterSensitiveLog = (obj: InputStreamInput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace InputStreamInput { + const memberValidators: { + stream?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: InputStreamInput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; + }; +} + +/** + * @public + */ +export interface InputStreamWithInitialRequestInput { + initialRequestMember: string | undefined; + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const InputStreamWithInitialRequestInputFilterSensitiveLog = (obj: InputStreamWithInitialRequestInput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace InputStreamWithInitialRequestInput { + const memberValidators: { + initialRequestMember?: __MultiConstraintValidator; + stream?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: InputStreamWithInitialRequestInput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "initialRequestMember": { + memberValidators["initialRequestMember"] = new __CompositeValidator([new __RequiredValidator()]); + break; + } + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("initialRequestMember").validate(obj.initialRequestMember, `${path}/initialRequestMember`), + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; + }; +} + /** * @public */ @@ -5038,6 +6205,108 @@ export namespace OperationWithNestedStructureOutput { }; } +/** + * @public + */ +export interface OutputStreamOutput { + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const OutputStreamOutputFilterSensitiveLog = (obj: OutputStreamOutput): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace OutputStreamOutput { + const memberValidators: { + stream?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: OutputStreamOutput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; + }; +} + +/** + * @public + */ +export interface OutputStreamWithInitialResponseOutput { + initialResponseMember: string | undefined; + stream?: AsyncIterable | undefined; +} + +/** + * @internal + */ +export const OutputStreamWithInitialResponseOutputFilterSensitiveLog = ( + obj: OutputStreamWithInitialResponseOutput +): any => ({ + ...obj, + ...(obj.stream && { stream: "STREAMING_CONTENT" }), +}); +export namespace OutputStreamWithInitialResponseOutput { + const memberValidators: { + initialResponseMember?: __MultiConstraintValidator; + stream?: __MultiConstraintValidator; + } = {}; + /** + * @internal + */ + export const validate = (obj: OutputStreamWithInitialResponseOutput, path = ""): __ValidationFailure[] => { + function getMemberValidator( + member: T + ): NonNullable<(typeof memberValidators)[T]> { + if (memberValidators[member] === undefined) { + switch (member) { + case "initialResponseMember": { + memberValidators["initialResponseMember"] = new __CompositeValidator([new __RequiredValidator()]); + break; + } + case "stream": { + memberValidators["stream"] = new __CompositeStructureValidator( + new __NoOpValidator(), + EventStream.validate + ); + break; + } + } + } + return memberValidators[member]!; + } + return [ + ...getMemberValidator("initialResponseMember").validate( + obj.initialResponseMember, + `${path}/initialResponseMember` + ), + // unsupported event stream validation + // ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`), + ]; + }; +} + /** * @public */ diff --git a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts index 7fd328b36b04e..0887ac0c690c3 100644 --- a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts +++ b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts @@ -14,11 +14,13 @@ import { SmithyFrameworkException as __SmithyFrameworkException, UnsupportedMediaTypeException as __UnsupportedMediaTypeException, } from "@aws-smithy/server-common"; +import { Int64 as __Int64 } from "@smithy/eventstream-codec"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { _json, collectBody, dateToUtcString as __dateToUtcString, + decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectByte as __expectByte, expectInt32 as __expectInt32, @@ -53,32 +55,47 @@ import { import { DocumentType as __DocumentType, Endpoint as __Endpoint, + EventStreamSerdeContext as __EventStreamSerdeContext, + Message as __Message, + MessageHeaders as __MessageHeaders, ResponseMetadata as __ResponseMetadata, SerdeContext as __SerdeContext, } from "@smithy/types"; import { calculateBodyLength } from "@smithy/util-body-length-node"; import { FooEnum, IntegerEnum } from "../models/enums"; -import { ComplexError, FooError, InvalidGreeting } from "../models/errors"; +import { ComplexError, ErrorEvent, FooError, InvalidGreeting, ServiceUnavailableError } from "../models/errors"; import { + BlobPayloadEvent, ClientOptionalDefaults, ComplexNestedErrorData, Defaults, Dialog, + EventStream, Farewell, GreetingStruct, + HeadersAndExplicitPayloadEvent, + HeadersAndImplicitPayloadEvent, + HeadersEvent, MyUnion, NestedPayload, PayloadConfig, + PayloadStructure, + PayloadUnion, PlayerAction, RecursiveShapesInputOutputNested1, RecursiveShapesInputOutputNested2, RenamedGreeting, SimpleUnion, + SingletonEvent, + SingletonEventStream, + StringPayloadEvent, StructureListMember, + StructurePayloadEvent, TestConfig, TopLevel, UnionPayload, + UnionPayloadEvent, UnionWithJsonName, Unit, } from "../models/models_0"; @@ -108,6 +125,15 @@ import { DocumentTypeAsPayloadServerInput, DocumentTypeAsPayloadServerOutput, } from "../server/operations/DocumentTypeAsPayload"; +import { DuplexStreamServerInput, DuplexStreamServerOutput } from "../server/operations/DuplexStream"; +import { + DuplexStreamWithDistinctStreamsServerInput, + DuplexStreamWithDistinctStreamsServerOutput, +} from "../server/operations/DuplexStreamWithDistinctStreams"; +import { + DuplexStreamWithInitialMessagesServerInput, + DuplexStreamWithInitialMessagesServerOutput, +} from "../server/operations/DuplexStreamWithInitialMessages"; import { EmptyInputAndEmptyOutputServerInput, EmptyInputAndEmptyOutputServerOutput, @@ -150,6 +176,10 @@ import { HttpPrefixHeadersInResponseServerInput, HttpPrefixHeadersInResponseServerOutput, } from "../server/operations/HttpPrefixHeadersInResponse"; +import { + HttpQueryParamsOnlyOperationServerInput, + HttpQueryParamsOnlyOperationServerOutput, +} from "../server/operations/HttpQueryParamsOnlyOperation"; import { HttpRequestWithFloatLabelsServerInput, HttpRequestWithFloatLabelsServerOutput, @@ -180,6 +210,11 @@ import { InputAndOutputWithHeadersServerInput, InputAndOutputWithHeadersServerOutput, } from "../server/operations/InputAndOutputWithHeaders"; +import { InputStreamServerInput, InputStreamServerOutput } from "../server/operations/InputStream"; +import { + InputStreamWithInitialRequestServerInput, + InputStreamWithInitialRequestServerOutput, +} from "../server/operations/InputStreamWithInitialRequest"; import { JsonBlobsServerInput, JsonBlobsServerOutput } from "../server/operations/JsonBlobs"; import { JsonEnumsServerInput, JsonEnumsServerOutput } from "../server/operations/JsonEnums"; import { JsonIntEnumsServerInput, JsonIntEnumsServerOutput } from "../server/operations/JsonIntEnums"; @@ -310,6 +345,11 @@ import { OperationWithNestedStructureServerInput, OperationWithNestedStructureServerOutput, } from "../server/operations/OperationWithNestedStructure"; +import { OutputStreamServerInput, OutputStreamServerOutput } from "../server/operations/OutputStream"; +import { + OutputStreamWithInitialResponseServerInput, + OutputStreamWithInitialResponseServerOutput, +} from "../server/operations/OutputStreamWithInitialResponse"; import { PostPlayerActionServerInput, PostPlayerActionServerOutput } from "../server/operations/PostPlayerAction"; import { PostUnionWithJsonNameServerInput, @@ -830,6 +870,86 @@ export const deserializeDocumentTypeAsPayloadRequest = async ( return contents; }; +export const deserializeDuplexStreamRequest = async ( + output: __HttpRequest, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined && contentType !== "application/json") { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({}); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + +export const deserializeDuplexStreamWithDistinctStreamsRequest = async ( + output: __HttpRequest, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined && contentType !== "application/json") { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({}); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + +export const deserializeDuplexStreamWithInitialMessagesRequest = async ( + output: __HttpRequest, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined && contentType !== "application/json") { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({ + [_iRM]: [, output.headers[_irm]], + }); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + export const deserializeEmptyInputAndEmptyOutputRequest = async ( output: __HttpRequest, context: __SerdeContext @@ -1235,6 +1355,49 @@ export const deserializeHttpPrefixHeadersInResponseRequest = async ( return contents; }; +export const deserializeHttpQueryParamsOnlyOperationRequest = async ( + output: __HttpRequest, + context: __SerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined && contentType !== "application/json") { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({}); + const query = output.query; + if (query != null) { + const parsedQuery: Record = {}; + for (const [key, value] of Object.entries(query)) { + let queryValue: string; + if (Array.isArray(value)) { + if (value.length === 1) { + queryValue = value[0]; + } else { + throw new __SerializationException(); + } + } else { + queryValue = value as string; + } + parsedQuery[key] = queryValue; + } + contents.queryMap = parsedQuery; + } + await collectBody(output.body, context); + return contents; +}; + export const deserializeHttpRequestWithFloatLabelsRequest = async ( output: __HttpRequest, context: __SerdeContext @@ -1562,6 +1725,60 @@ export const deserializeInputAndOutputWithHeadersRequest = async ( return contents; }; +export const deserializeInputStreamRequest = async ( + output: __HttpRequest, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined && contentType !== "application/json") { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({}); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + +export const deserializeInputStreamWithInitialRequestRequest = async ( + output: __HttpRequest, + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined && contentType !== "application/json") { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({ + [_iRM]: [, output.headers[_irm]], + }); + const data: any = output.body; + contents.stream = de_EventStream(data, context); + return contents; +}; + export const deserializeJsonBlobsRequest = async ( output: __HttpRequest, context: __SerdeContext @@ -3251,6 +3468,56 @@ export const deserializeOperationWithNestedStructureRequest = async ( return contents; }; +export const deserializeOutputStreamRequest = async ( + output: __HttpRequest, + context: __SerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined) { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({}); + await collectBody(output.body, context); + return contents; +}; + +export const deserializeOutputStreamWithInitialResponseRequest = async ( + output: __HttpRequest, + context: __SerdeContext +): Promise => { + const contentTypeHeaderKey: string | undefined = Object.keys(output.headers).find( + (key) => key.toLowerCase() === "content-type" + ); + if (contentTypeHeaderKey != null) { + const contentType = output.headers[contentTypeHeaderKey]; + if (contentType !== undefined) { + throw new __UnsupportedMediaTypeException(); + } + } + const acceptHeaderKey: string | undefined = Object.keys(output.headers).find((key) => key.toLowerCase() === "accept"); + if (acceptHeaderKey != null) { + const accept = output.headers[acceptHeaderKey]; + if (!__acceptMatches(accept, "application/json")) { + throw new __NotAcceptableException(); + } + } + const contents: any = map({}); + await collectBody(output.body, context); + return contents; +}; + export const deserializePostPlayerActionRequest = async ( output: __HttpRequest, context: __SerdeContext @@ -4277,11 +4544,11 @@ export const serializeDocumentTypeAsPayloadResponse = async ( }); }; -export const serializeEmptyInputAndEmptyOutputResponse = async ( - input: EmptyInputAndEmptyOutputServerOutput, +export const serializeDuplexStreamResponse = async ( + input: DuplexStreamServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { - const context: __SerdeContext = { + const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = { ...ctx, endpoint: () => Promise.resolve({ @@ -4295,7 +4562,9 @@ export const serializeEmptyInputAndEmptyOutputResponse = async ( "content-type": "application/json", }); let body: any; - body = "{}"; + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } if ( body && Object.keys(headers) @@ -4314,8 +4583,8 @@ export const serializeEmptyInputAndEmptyOutputResponse = async ( }); }; -export const serializeEndpointOperationResponse = async ( - input: EndpointOperationServerOutput, +export const serializeDuplexStreamWithDistinctStreamsResponse = async ( + input: DuplexStreamWithDistinctStreamsServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -4328,8 +4597,17 @@ export const serializeEndpointOperationResponse = async ( }), }; const statusCode = 200; - let headers: any = map({}, isSerializableHeaderValue, {}); + let headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + }); let body: any; + if (input.stream !== undefined) { + body = se_SingletonEventStream(input.stream, context); + } + if (body === undefined) { + body = {}; + } + body = JSON.stringify(body); if ( body && Object.keys(headers) @@ -4348,11 +4626,11 @@ export const serializeEndpointOperationResponse = async ( }); }; -export const serializeEndpointWithHostLabelOperationResponse = async ( - input: EndpointWithHostLabelOperationServerOutput, +export const serializeDuplexStreamWithInitialMessagesResponse = async ( + input: DuplexStreamWithInitialMessagesServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { - const context: __SerdeContext = { + const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = { ...ctx, endpoint: () => Promise.resolve({ @@ -4362,8 +4640,14 @@ export const serializeEndpointWithHostLabelOperationResponse = async ( }), }; const statusCode = 200; - let headers: any = map({}, isSerializableHeaderValue, {}); + let headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_irm_]: input[_iRMn]!, + }); let body: any; + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } if ( body && Object.keys(headers) @@ -4382,8 +4666,8 @@ export const serializeEndpointWithHostLabelOperationResponse = async ( }); }; -export const serializeFractionalSecondsResponse = async ( - input: FractionalSecondsServerOutput, +export const serializeEmptyInputAndEmptyOutputResponse = async ( + input: EmptyInputAndEmptyOutputServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -4400,11 +4684,7 @@ export const serializeFractionalSecondsResponse = async ( "content-type": "application/json", }); let body: any; - body = JSON.stringify( - take(input, { - datetime: (_) => __serializeDateTime(_), - }) - ); + body = "{}"; if ( body && Object.keys(headers) @@ -4423,8 +4703,8 @@ export const serializeFractionalSecondsResponse = async ( }); }; -export const serializeGreetingWithErrorsResponse = async ( - input: GreetingWithErrorsServerOutput, +export const serializeEndpointOperationResponse = async ( + input: EndpointOperationServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -4437,12 +4717,8 @@ export const serializeGreetingWithErrorsResponse = async ( }), }; const statusCode = 200; - let headers: any = map({}, isSerializableHeaderValue, { - "content-type": "application/json", - [_xg]: input[_g]!, - }); + let headers: any = map({}, isSerializableHeaderValue, {}); let body: any; - body = "{}"; if ( body && Object.keys(headers) @@ -4461,8 +4737,8 @@ export const serializeGreetingWithErrorsResponse = async ( }); }; -export const serializeHostWithPathOperationResponse = async ( - input: HostWithPathOperationServerOutput, +export const serializeEndpointWithHostLabelOperationResponse = async ( + input: EndpointWithHostLabelOperationServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -4495,8 +4771,8 @@ export const serializeHostWithPathOperationResponse = async ( }); }; -export const serializeHttpChecksumRequiredResponse = async ( - input: HttpChecksumRequiredServerOutput, +export const serializeFractionalSecondsResponse = async ( + input: FractionalSecondsServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -4515,7 +4791,120 @@ export const serializeHttpChecksumRequiredResponse = async ( let body: any; body = JSON.stringify( take(input, { - foo: [], + datetime: (_) => __serializeDateTime(_), + }) + ); + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + +export const serializeGreetingWithErrorsResponse = async ( + input: GreetingWithErrorsServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + [_xg]: input[_g]!, + }); + let body: any; + body = "{}"; + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + +export const serializeHostWithPathOperationResponse = async ( + input: HostWithPathOperationServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, {}); + let body: any; + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + +export const serializeHttpChecksumRequiredResponse = async ( + input: HttpChecksumRequiredServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + }); + let body: any; + body = JSON.stringify( + take(input, { + foo: [], }) ); if ( @@ -4869,6 +5258,40 @@ export const serializeHttpPrefixHeadersInResponseResponse = async ( }); }; +export const serializeHttpQueryParamsOnlyOperationResponse = async ( + input: HttpQueryParamsOnlyOperationServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, {}); + let body: any; + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + export const serializeHttpRequestWithFloatLabelsResponse = async ( input: HttpRequestWithFloatLabelsServerOutput, ctx: ServerSerdeContext @@ -5232,6 +5655,74 @@ export const serializeInputAndOutputWithHeadersResponse = async ( }); }; +export const serializeInputStreamResponse = async ( + input: InputStreamServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, {}); + let body: any; + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + +export const serializeInputStreamWithInitialRequestResponse = async ( + input: InputStreamWithInitialRequestServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, {}); + let body: any; + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + export const serializeJsonBlobsResponse = async ( input: JsonBlobsServerOutput, ctx: ServerSerdeContext @@ -7057,11 +7548,11 @@ export const serializeOperationWithNestedStructureResponse = async ( }); }; -export const serializePostPlayerActionResponse = async ( - input: PostPlayerActionServerOutput, +export const serializeOutputStreamResponse = async ( + input: OutputStreamServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { - const context: __SerdeContext = { + const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = { ...ctx, endpoint: () => Promise.resolve({ @@ -7075,11 +7566,9 @@ export const serializePostPlayerActionResponse = async ( "content-type": "application/json", }); let body: any; - body = JSON.stringify( - take(input, { - action: (_) => se_PlayerAction(_, context), - }) - ); + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } if ( body && Object.keys(headers) @@ -7098,11 +7587,11 @@ export const serializePostPlayerActionResponse = async ( }); }; -export const serializePostUnionWithJsonNameResponse = async ( - input: PostUnionWithJsonNameServerOutput, +export const serializeOutputStreamWithInitialResponseResponse = async ( + input: OutputStreamWithInitialResponseServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { - const context: __SerdeContext = { + const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = { ...ctx, endpoint: () => Promise.resolve({ @@ -7114,13 +7603,12 @@ export const serializePostUnionWithJsonNameResponse = async ( const statusCode = 200; let headers: any = map({}, isSerializableHeaderValue, { "content-type": "application/json", + [_irm_]: input[_iRMn]!, }); let body: any; - body = JSON.stringify( - take(input, { - value: (_) => se_UnionWithJsonName(_, context), - }) - ); + if (input.stream !== undefined) { + body = se_EventStream(input.stream, context); + } if ( body && Object.keys(headers) @@ -7139,8 +7627,8 @@ export const serializePostUnionWithJsonNameResponse = async ( }); }; -export const serializePutWithContentEncodingResponse = async ( - input: PutWithContentEncodingServerOutput, +export const serializePostPlayerActionResponse = async ( + input: PostPlayerActionServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -7153,8 +7641,15 @@ export const serializePutWithContentEncodingResponse = async ( }), }; const statusCode = 200; - let headers: any = map({}, isSerializableHeaderValue, {}); + let headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + }); let body: any; + body = JSON.stringify( + take(input, { + action: (_) => se_PlayerAction(_, context), + }) + ); if ( body && Object.keys(headers) @@ -7173,8 +7668,8 @@ export const serializePutWithContentEncodingResponse = async ( }); }; -export const serializeQueryIdempotencyTokenAutoFillResponse = async ( - input: QueryIdempotencyTokenAutoFillServerOutput, +export const serializePostUnionWithJsonNameResponse = async ( + input: PostUnionWithJsonNameServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -7187,8 +7682,15 @@ export const serializeQueryIdempotencyTokenAutoFillResponse = async ( }), }; const statusCode = 200; - let headers: any = map({}, isSerializableHeaderValue, {}); + let headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + }); let body: any; + body = JSON.stringify( + take(input, { + value: (_) => se_UnionWithJsonName(_, context), + }) + ); if ( body && Object.keys(headers) @@ -7207,8 +7709,76 @@ export const serializeQueryIdempotencyTokenAutoFillResponse = async ( }); }; -export const serializeQueryParamsAsStringListMapResponse = async ( - input: QueryParamsAsStringListMapServerOutput, +export const serializePutWithContentEncodingResponse = async ( + input: PutWithContentEncodingServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, {}); + let body: any; + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + +export const serializeQueryIdempotencyTokenAutoFillResponse = async ( + input: QueryIdempotencyTokenAutoFillServerOutput, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 200; + let headers: any = map({}, isSerializableHeaderValue, {}); + let body: any; + if ( + body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf("content-length") === -1 + ) { + const length = calculateBodyLength(body); + if (length !== undefined) { + headers = { ...headers, "content-length": String(length) }; + } + } + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + +export const serializeQueryParamsAsStringListMapResponse = async ( + input: QueryParamsAsStringListMapServerOutput, ctx: ServerSerdeContext ): Promise<__HttpResponse> => { const context: __SerdeContext = { @@ -8174,6 +8744,372 @@ export const serializeInvalidGreetingError = async ( }); }; +export const serializeServiceUnavailableErrorError = async ( + input: ServiceUnavailableError, + ctx: ServerSerdeContext +): Promise<__HttpResponse> => { + const context: __SerdeContext = { + ...ctx, + endpoint: () => + Promise.resolve({ + protocol: "", + hostname: "", + path: "", + }), + }; + const statusCode = 500; + const headers: any = map({}, isSerializableHeaderValue, { + "x-amzn-errortype": "ServiceUnavailableError", + "content-type": "application/json", + }); + let body: any; + body = JSON.stringify( + take(input, { + message: [], + }) + ); + return new __HttpResponse({ + headers, + body, + statusCode, + }); +}; + +/** + * serializeAws_restJson1EventStream + */ +const se_EventStream = (input: any, context: __SerdeContext & __EventStreamSerdeContext): any => { + const eventMarshallingVisitor = (event: any): __Message => + EventStream.visit(event, { + headers: (value) => se_HeadersEvent_event(value, context), + blobPayload: (value) => se_BlobPayloadEvent_event(value, context), + stringPayload: (value) => se_StringPayloadEvent_event(value, context), + structurePayload: (value) => se_StructurePayloadEvent_event(value, context), + unionPayload: (value) => se_UnionPayloadEvent_event(value, context), + headersAndExplicitPayload: (value) => se_HeadersAndExplicitPayloadEvent_event(value, context), + headersAndImplicitPayload: (value) => se_HeadersAndImplicitPayloadEvent_event(value, context), + error: (value) => se_ErrorEvent_event(value, context), + _: (value) => value as any, + }); + return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor); +}; +const se_BlobPayloadEvent_event = (input: BlobPayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "blobPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/octet-stream" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = input.payload; + } + return { headers, body }; +}; +const se_ErrorEvent_event = (input: ErrorEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "error" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + let body = new Uint8Array(); + body = _json(input); + body = context.utf8Decoder(JSON.stringify(body)); + return { headers, body }; +}; +const se_HeadersAndExplicitPayloadEvent_event = ( + input: HeadersAndExplicitPayloadEvent, + context: __SerdeContext +): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "headersAndExplicitPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + if (input.header != null) { + headers["header"] = { type: "string", value: input.header }; + } + let body = new Uint8Array(); + if (input.payload != null) { + body = _json(input.payload); + body = context.utf8Decoder(JSON.stringify(body)); + } + return { headers, body }; +}; +const se_HeadersAndImplicitPayloadEvent_event = ( + input: HeadersAndImplicitPayloadEvent, + context: __SerdeContext +): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "headersAndImplicitPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + if (input.header != null) { + headers["header"] = { type: "string", value: input.header }; + } + let body = new Uint8Array(); + delete input["header"]; + body = _json(input); + body = context.utf8Decoder(JSON.stringify(body)); + return { headers, body }; +}; +const se_HeadersEvent_event = (input: HeadersEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "headers" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + if (input.booleanHeader != null) { + headers["booleanHeader"] = { type: "boolean", value: input.booleanHeader }; + } + if (input.byteHeader != null) { + headers["byteHeader"] = { type: "byte", value: input.byteHeader }; + } + if (input.shortHeader != null) { + headers["shortHeader"] = { type: "short", value: input.shortHeader }; + } + if (input.intHeader != null) { + headers["intHeader"] = { type: "integer", value: input.intHeader }; + } + if (input.longHeader != null) { + headers["longHeader"] = { type: "long", value: __Int64.fromNumber(input.longHeader) }; + } + if (input.blobHeader != null) { + headers["blobHeader"] = { type: "binary", value: input.blobHeader }; + } + if (input.stringHeader != null) { + headers["stringHeader"] = { type: "string", value: input.stringHeader }; + } + if (input.timestampHeader != null) { + headers["timestampHeader"] = { type: "timestamp", value: input.timestampHeader }; + } + let body = new Uint8Array(); + delete input["booleanHeader"]; + delete input["byteHeader"]; + delete input["shortHeader"]; + delete input["intHeader"]; + delete input["longHeader"]; + delete input["blobHeader"]; + delete input["stringHeader"]; + delete input["timestampHeader"]; + body = se_HeadersEvent(input, context); + body = context.utf8Decoder(JSON.stringify(body)); + return { headers, body }; +}; +const se_StringPayloadEvent_event = (input: StringPayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "stringPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "text/plain" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = context.utf8Decoder(input.payload); + } + return { headers, body }; +}; +const se_StructurePayloadEvent_event = (input: StructurePayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "structurePayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = _json(input.payload); + body = context.utf8Decoder(JSON.stringify(body)); + } + return { headers, body }; +}; +const se_UnionPayloadEvent_event = (input: UnionPayloadEvent, context: __SerdeContext): __Message => { + const headers: __MessageHeaders = { + ":event-type": { type: "string", value: "unionPayload" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: "application/json" }, + }; + let body = new Uint8Array(); + if (input.payload != null) { + body = _json(input.payload); + body = context.utf8Decoder(JSON.stringify(body)); + } + return { headers, body }; +}; +/** + * deserializeAws_restJson1EventStream + */ +const de_EventStream = ( + output: any, + context: __SerdeContext & __EventStreamSerdeContext +): AsyncIterable => { + return context.eventStreamMarshaller.deserialize(output, async (event) => { + if (event["headers"] != null) { + return { + headers: await de_HeadersEvent_event(event["headers"], context), + }; + } + if (event["blobPayload"] != null) { + return { + blobPayload: await de_BlobPayloadEvent_event(event["blobPayload"], context), + }; + } + if (event["stringPayload"] != null) { + return { + stringPayload: await de_StringPayloadEvent_event(event["stringPayload"], context), + }; + } + if (event["structurePayload"] != null) { + return { + structurePayload: await de_StructurePayloadEvent_event(event["structurePayload"], context), + }; + } + if (event["unionPayload"] != null) { + return { + unionPayload: await de_UnionPayloadEvent_event(event["unionPayload"], context), + }; + } + if (event["headersAndExplicitPayload"] != null) { + return { + headersAndExplicitPayload: await de_HeadersAndExplicitPayloadEvent_event( + event["headersAndExplicitPayload"], + context + ), + }; + } + if (event["headersAndImplicitPayload"] != null) { + return { + headersAndImplicitPayload: await de_HeadersAndImplicitPayloadEvent_event( + event["headersAndImplicitPayload"], + context + ), + }; + } + if (event["error"] != null) { + return { + error: await de_ErrorEvent_event(event["error"], context), + }; + } + return { $unknown: event as any }; + }); +}; +const de_BlobPayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: BlobPayloadEvent = {} as any; + contents.payload = output.body; + return contents; +}; +const de_ErrorEvent_event = async (output: any, context: __SerdeContext): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + return de_ErrorEventRes(parsedOutput, context); +}; +const de_HeadersAndExplicitPayloadEvent_event = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: HeadersAndExplicitPayloadEvent = {} as any; + if (output.headers[_he] !== undefined) { + contents[_he] = output.headers[_he].value; + } + + const data: any = await parseBody(output.body, context); + contents.payload = _json(data); + return contents; +}; +const de_HeadersAndImplicitPayloadEvent_event = async ( + output: any, + context: __SerdeContext +): Promise => { + const contents: HeadersAndImplicitPayloadEvent = {} as any; + if (output.headers[_he] !== undefined) { + contents[_he] = output.headers[_he].value; + } + + const data: any = await parseBody(output.body, context); + Object.assign(contents, _json(data)); + return contents; +}; +const de_HeadersEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: HeadersEvent = {} as any; + if (output.headers[_bH] !== undefined) { + contents[_bH] = output.headers[_bH].value; + } + + if (output.headers[_bHy] !== undefined) { + contents[_bHy] = output.headers[_bHy].value; + } + + if (output.headers[_sHh] !== undefined) { + contents[_sHh] = output.headers[_sHh].value; + } + + if (output.headers[_iH] !== undefined) { + contents[_iH] = output.headers[_iH].value; + } + + if (output.headers[_lH] !== undefined) { + contents[_lH] = output.headers[_lH].value; + } + + if (output.headers[_bHl] !== undefined) { + contents[_bHl] = output.headers[_bHl].value; + } + + if (output.headers[_sHt] !== undefined) { + contents[_sHt] = output.headers[_sHt].value; + } + + if (output.headers[_tH] !== undefined) { + contents[_tH] = output.headers[_tH].value; + } + + const data: any = await parseBody(output.body, context); + Object.assign(contents, de_HeadersEvent(data, context)); + return contents; +}; +const de_StringPayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: StringPayloadEvent = {} as any; + contents.payload = await collectBodyString(output.body, context); + return contents; +}; +const de_StructurePayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: StructurePayloadEvent = {} as any; + const data: any = await parseBody(output.body, context); + contents.payload = _json(data); + return contents; +}; +const de_UnionPayloadEvent_event = async (output: any, context: __SerdeContext): Promise => { + const contents: UnionPayloadEvent = {} as any; + const data: any = await parseBody(output.body, context); + contents.payload = _json(data); + return contents; +}; +/** + * deserializeAws_restJson1ErrorEventRes + */ +const de_ErrorEventRes = 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: any /* $metadata unsupported on ssdk error */ = new ErrorEvent({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * serializeAws_restJson1BlobPayloadEvent + */ +const se_BlobPayloadEvent = (input: BlobPayloadEvent, context: __SerdeContext): any => { + return take(input, { + payload: context.base64Encoder, + }); +}; + /** * serializeAws_restJson1ComplexNestedErrorData */ @@ -8303,6 +9239,15 @@ const se_DocumentValuedMap = (input: Record, context: __ }, {}); }; +/** + * serializeAws_restJson1ErrorEvent + */ +const se_ErrorEvent = (input: ErrorEvent, context: __SerdeContext): any => { + return take(input, { + message: [], + }); +}; + /** * serializeAws_restJson1Farewell */ @@ -8312,6 +9257,42 @@ const se_Farewell = (input: Farewell, context: __SerdeContext): any => { }); }; +/** + * serializeAws_restJson1HeadersAndExplicitPayloadEvent + */ +const se_HeadersAndExplicitPayloadEvent = (input: HeadersAndExplicitPayloadEvent, context: __SerdeContext): any => { + return take(input, { + header: [], + payload: (_) => se_PayloadStructure(_, context), + }); +}; + +/** + * serializeAws_restJson1HeadersAndImplicitPayloadEvent + */ +const se_HeadersAndImplicitPayloadEvent = (input: HeadersAndImplicitPayloadEvent, context: __SerdeContext): any => { + return take(input, { + header: [], + payload: [], + }); +}; + +/** + * serializeAws_restJson1HeadersEvent + */ +const se_HeadersEvent = (input: HeadersEvent, context: __SerdeContext): any => { + return take(input, { + blobHeader: context.base64Encoder, + booleanHeader: [], + byteHeader: [], + intHeader: [], + longHeader: [], + shortHeader: [], + stringHeader: [], + timestampHeader: __serializeDateTime, + }); +}; + /** * serializeAws_restJson1MyUnion */ @@ -8350,6 +9331,25 @@ const se_PayloadConfig = (input: PayloadConfig, context: __SerdeContext): any => }); }; +/** + * serializeAws_restJson1PayloadStructure + */ +const se_PayloadStructure = (input: PayloadStructure, context: __SerdeContext): any => { + return take(input, { + structureMember: [], + }); +}; + +/** + * serializeAws_restJson1PayloadUnion + */ +const se_PayloadUnion = (input: PayloadUnion, context: __SerdeContext): any => { + return PayloadUnion.visit(input, { + unionMember: (value) => ({ unionMember: value }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + /** * serializeAws_restJson1PlayerAction */ @@ -8386,6 +9386,25 @@ const se_RecursiveShapesInputOutputNested2 = ( }); }; +/** + * serializeAws_restJson1SingletonEvent + */ +const se_SingletonEvent = (input: SingletonEvent, context: __SerdeContext): any => { + return take(input, { + value: [], + }); +}; + +/** + * serializeAws_restJson1SingletonEventStream + */ +const se_SingletonEventStream = (input: SingletonEventStream, context: __SerdeContext): any => { + return SingletonEventStream.visit(input, { + singleton: (value) => ({ singleton: se_SingletonEvent(value, context) }), + _: (name, value) => ({ [name]: value } as any), + }); +}; + /** * serializeAws_restJson1SparseBooleanMap */ @@ -8442,6 +9461,15 @@ const se_SparseStructMap = (input: Record, context: __Se }, {}); }; +/** + * serializeAws_restJson1StringPayloadEvent + */ +const se_StringPayloadEvent = (input: StringPayloadEvent, context: __SerdeContext): any => { + return take(input, { + payload: [], + }); +}; + /** * serializeAws_restJson1StructureList */ @@ -8463,6 +9491,15 @@ const se_StructureListMember = (input: StructureListMember, context: __SerdeCont }); }; +/** + * serializeAws_restJson1StructurePayloadEvent + */ +const se_StructurePayloadEvent = (input: StructurePayloadEvent, context: __SerdeContext): any => { + return take(input, { + payload: (_) => se_PayloadStructure(_, context), + }); +}; + /** * serializeAws_restJson1TestConfig */ @@ -8502,6 +9539,15 @@ const se_UnionPayload = (input: UnionPayload, context: __SerdeContext): any => { }); }; +/** + * serializeAws_restJson1UnionPayloadEvent + */ +const se_UnionPayloadEvent = (input: UnionPayloadEvent, context: __SerdeContext): any => { + return take(input, { + payload: (_) => se_PayloadUnion(_, context), + }); +}; + /** * serializeAws_restJson1UnionWithJsonName */ @@ -8684,6 +9730,15 @@ const se_Unit = (input: Unit, context: __SerdeContext): any => { return take(input, {}); }; +/** + * deserializeAws_restJson1BlobPayloadEvent + */ +const de_BlobPayloadEvent = (output: any, context: __SerdeContext): BlobPayloadEvent => { + return take(output, { + payload: context.base64Decoder, + }) as any; +}; + /** * deserializeAws_restJson1ClientOptionalDefaults */ @@ -8853,6 +9908,15 @@ const de_DocumentValuedMap = (output: any, context: __SerdeContext): Record); }; +/** + * deserializeAws_restJson1ErrorEvent + */ +const de_ErrorEvent = (output: any, context: __SerdeContext): ErrorEvent => { + return take(output, { + message: __expectString, + }) as any; +}; + /** * deserializeAws_restJson1Farewell */ @@ -8862,6 +9926,42 @@ const de_Farewell = (output: any, context: __SerdeContext): Farewell => { }) as any; }; +/** + * deserializeAws_restJson1HeadersAndExplicitPayloadEvent + */ +const de_HeadersAndExplicitPayloadEvent = (output: any, context: __SerdeContext): HeadersAndExplicitPayloadEvent => { + return take(output, { + header: __expectString, + payload: (_: any) => de_PayloadStructure(_, context), + }) as any; +}; + +/** + * deserializeAws_restJson1HeadersAndImplicitPayloadEvent + */ +const de_HeadersAndImplicitPayloadEvent = (output: any, context: __SerdeContext): HeadersAndImplicitPayloadEvent => { + return take(output, { + header: __expectString, + payload: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1HeadersEvent + */ +const de_HeadersEvent = (output: any, context: __SerdeContext): HeadersEvent => { + return take(output, { + blobHeader: context.base64Decoder, + booleanHeader: __expectBoolean, + byteHeader: __expectByte, + intHeader: __expectInt32, + longHeader: __expectLong, + shortHeader: __expectShort, + stringHeader: __expectString, + timestampHeader: (_: any) => __expectNonNull(__parseRfc3339DateTime(_)), + }) as any; +}; + /** * deserializeAws_restJson1MyUnion */ @@ -8930,6 +10030,25 @@ const de_PayloadConfig = (output: any, context: __SerdeContext): PayloadConfig = }) as any; }; +/** + * deserializeAws_restJson1PayloadStructure + */ +const de_PayloadStructure = (output: any, context: __SerdeContext): PayloadStructure => { + return take(output, { + structureMember: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1PayloadUnion + */ +const de_PayloadUnion = (output: any, context: __SerdeContext): PayloadUnion => { + if (__expectString(output.unionMember) !== undefined) { + return { unionMember: __expectString(output.unionMember) as any }; + } + return { $unknown: Object.entries(output)[0] }; +}; + /** * deserializeAws_restJson1PlayerAction */ @@ -9065,6 +10184,15 @@ const de_SparseStructMap = (output: any, context: __SerdeContext): Record); }; +/** + * deserializeAws_restJson1StringPayloadEvent + */ +const de_StringPayloadEvent = (output: any, context: __SerdeContext): StringPayloadEvent => { + return take(output, { + payload: __expectString, + }) as any; +}; + /** * deserializeAws_restJson1StructureList */ @@ -9090,6 +10218,15 @@ const de_StructureListMember = (output: any, context: __SerdeContext): Structure }) as any; }; +/** + * deserializeAws_restJson1StructurePayloadEvent + */ +const de_StructurePayloadEvent = (output: any, context: __SerdeContext): StructurePayloadEvent => { + return take(output, { + payload: (_: any) => de_PayloadStructure(_, context), + }) as any; +}; + /** * deserializeAws_restJson1TestConfig */ @@ -9148,6 +10285,15 @@ const de_UnionPayload = (output: any, context: __SerdeContext): UnionPayload => return { $unknown: Object.entries(output)[0] }; }; +/** + * deserializeAws_restJson1UnionPayloadEvent + */ +const de_UnionPayloadEvent = (output: any, context: __SerdeContext): UnionPayloadEvent => { + return take(output, { + payload: (_: any) => de_PayloadUnion(__expectUnion(_), context), + }) as any; +}; + /** * deserializeAws_restJson1UnionWithJsonName */ @@ -9432,6 +10578,9 @@ const _H = "Header"; const _a = "a"; const _amth = "amz-media-typed-header"; const _b = "booleaninheader"; +const _bH = "booleanHeader"; +const _bHl = "blobHeader"; +const _bHy = "byteHeader"; const _bIH = "booleanInHeader"; const _bIHy = "byteInHeader"; const _b_ = "b"; @@ -9470,19 +10619,28 @@ const _hTB = "headerTrueBool"; const _hTL = "headerTimestampList"; const _he = "header"; const _i = "integerinheader"; +const _iH = "intHeader"; const _iIH = "integerInHeader"; +const _iRM = "initialRequestMember"; +const _iRMn = "initialResponseMember"; +const _irm = "initial-request-member"; +const _irm_ = "initial-response-member"; const _j = "json"; const _l = "longinheader"; +const _lH = "longHeader"; const _lIH = "longInHeader"; const _mDT = "memberDateTime"; const _mES = "memberEpochSeconds"; const _mHD = "memberHttpDate"; const _s = "shortinheader"; const _sH = "specificHeader"; +const _sHh = "shortHeader"; +const _sHt = "stringHeader"; const _sIH = "shortInHeader"; const _t = "timestamp"; const _tDT = "targetDateTime"; const _tES = "targetEpochSeconds"; +const _tH = "timestampHeader"; const _tHD = "targetHttpDate"; const _tI = "testId"; const _xa = "x-a"; diff --git a/private/aws-restjson-server/src/server/RestJsonService.ts b/private/aws-restjson-server/src/server/RestJsonService.ts index 11b44241d0614..0e555e1799cf5 100644 --- a/private/aws-restjson-server/src/server/RestJsonService.ts +++ b/private/aws-restjson-server/src/server/RestJsonService.ts @@ -55,6 +55,17 @@ import { DocumentTypeAsPayloadSerializer, DocumentTypeAsPayloadServerInput, } from "./operations/DocumentTypeAsPayload"; +import { DuplexStream, DuplexStreamSerializer, DuplexStreamServerInput } from "./operations/DuplexStream"; +import { + DuplexStreamWithDistinctStreams, + DuplexStreamWithDistinctStreamsSerializer, + DuplexStreamWithDistinctStreamsServerInput, +} from "./operations/DuplexStreamWithDistinctStreams"; +import { + DuplexStreamWithInitialMessages, + DuplexStreamWithInitialMessagesSerializer, + DuplexStreamWithInitialMessagesServerInput, +} from "./operations/DuplexStreamWithInitialMessages"; import { EmptyInputAndEmptyOutput, EmptyInputAndEmptyOutputSerializer, @@ -126,6 +137,11 @@ import { HttpPrefixHeadersInResponseSerializer, HttpPrefixHeadersInResponseServerInput, } from "./operations/HttpPrefixHeadersInResponse"; +import { + HttpQueryParamsOnlyOperation, + HttpQueryParamsOnlyOperationSerializer, + HttpQueryParamsOnlyOperationServerInput, +} from "./operations/HttpQueryParamsOnlyOperation"; import { HttpRequestWithFloatLabels, HttpRequestWithFloatLabelsSerializer, @@ -171,6 +187,12 @@ import { InputAndOutputWithHeadersSerializer, InputAndOutputWithHeadersServerInput, } from "./operations/InputAndOutputWithHeaders"; +import { InputStream, InputStreamSerializer, InputStreamServerInput } from "./operations/InputStream"; +import { + InputStreamWithInitialRequest, + InputStreamWithInitialRequestSerializer, + InputStreamWithInitialRequestServerInput, +} from "./operations/InputStreamWithInitialRequest"; import { JsonBlobs, JsonBlobsSerializer, JsonBlobsServerInput } from "./operations/JsonBlobs"; import { JsonEnums, JsonEnumsSerializer, JsonEnumsServerInput } from "./operations/JsonEnums"; import { JsonIntEnums, JsonIntEnumsSerializer, JsonIntEnumsServerInput } from "./operations/JsonIntEnums"; @@ -344,6 +366,12 @@ import { OperationWithNestedStructureSerializer, OperationWithNestedStructureServerInput, } from "./operations/OperationWithNestedStructure"; +import { OutputStream, OutputStreamSerializer, OutputStreamServerInput } from "./operations/OutputStream"; +import { + OutputStreamWithInitialResponse, + OutputStreamWithInitialResponseSerializer, + OutputStreamWithInitialResponseServerInput, +} from "./operations/OutputStreamWithInitialResponse"; import { PostPlayerAction, PostPlayerActionSerializer, @@ -450,6 +478,9 @@ export type RestJsonServiceOperations = | "DocumentType" | "DocumentTypeAsMapValue" | "DocumentTypeAsPayload" + | "DuplexStream" + | "DuplexStreamWithDistinctStreams" + | "DuplexStreamWithInitialMessages" | "EmptyInputAndEmptyOutput" | "EndpointOperation" | "EndpointWithHostLabelOperation" @@ -465,6 +496,7 @@ export type RestJsonServiceOperations = | "HttpPayloadWithUnion" | "HttpPrefixHeaders" | "HttpPrefixHeadersInResponse" + | "HttpQueryParamsOnlyOperation" | "HttpRequestWithFloatLabels" | "HttpRequestWithGreedyLabelInPath" | "HttpRequestWithLabels" @@ -474,6 +506,8 @@ export type RestJsonServiceOperations = | "HttpStringPayload" | "IgnoreQueryParamsInResponse" | "InputAndOutputWithHeaders" + | "InputStream" + | "InputStreamWithInitialRequest" | "JsonBlobs" | "JsonEnums" | "JsonIntEnums" @@ -523,6 +557,8 @@ export type RestJsonServiceOperations = | "OmitsSerializingEmptyLists" | "OperationWithDefaults" | "OperationWithNestedStructure" + | "OutputStream" + | "OutputStreamWithInitialResponse" | "PostPlayerAction" | "PostUnionWithJsonName" | "PutWithContentEncoding" @@ -556,6 +592,9 @@ export interface RestJsonService { DocumentType: DocumentType; DocumentTypeAsMapValue: DocumentTypeAsMapValue; DocumentTypeAsPayload: DocumentTypeAsPayload; + DuplexStream: DuplexStream; + DuplexStreamWithDistinctStreams: DuplexStreamWithDistinctStreams; + DuplexStreamWithInitialMessages: DuplexStreamWithInitialMessages; EmptyInputAndEmptyOutput: EmptyInputAndEmptyOutput; EndpointOperation: EndpointOperation; EndpointWithHostLabelOperation: EndpointWithHostLabelOperation; @@ -571,6 +610,7 @@ export interface RestJsonService { HttpPayloadWithUnion: HttpPayloadWithUnion; HttpPrefixHeaders: HttpPrefixHeaders; HttpPrefixHeadersInResponse: HttpPrefixHeadersInResponse; + HttpQueryParamsOnlyOperation: HttpQueryParamsOnlyOperation; HttpRequestWithFloatLabels: HttpRequestWithFloatLabels; HttpRequestWithGreedyLabelInPath: HttpRequestWithGreedyLabelInPath; HttpRequestWithLabels: HttpRequestWithLabels; @@ -580,6 +620,8 @@ export interface RestJsonService { HttpStringPayload: HttpStringPayload; IgnoreQueryParamsInResponse: IgnoreQueryParamsInResponse; InputAndOutputWithHeaders: InputAndOutputWithHeaders; + InputStream: InputStream; + InputStreamWithInitialRequest: InputStreamWithInitialRequest; JsonBlobs: JsonBlobs; JsonEnums: JsonEnums; JsonIntEnums: JsonIntEnums; @@ -629,6 +671,8 @@ export interface RestJsonService { OmitsSerializingEmptyLists: OmitsSerializingEmptyLists; OperationWithDefaults: OperationWithDefaults; OperationWithNestedStructure: OperationWithNestedStructure; + OutputStream: OutputStream; + OutputStreamWithInitialResponse: OutputStreamWithInitialResponse; PostPlayerAction: PostPlayerAction; PostUnionWithJsonName: PostUnionWithJsonName; PutWithContentEncoding: PutWithContentEncoding; @@ -840,6 +884,42 @@ export class RestJsonServiceHandler implements __ServiceHandler implements __ServiceHandler implements __ServiceHandler implements __ServiceHandler( [], { service: "RestJson", operation: "DocumentTypeAsPayload" } ), + new httpbinding.UriSpec<"RestJson", "DuplexStream">("POST", [{ type: "path_literal", value: "DuplexStream" }], [], { + service: "RestJson", + operation: "DuplexStream", + }), + new httpbinding.UriSpec<"RestJson", "DuplexStreamWithDistinctStreams">( + "POST", + [{ type: "path_literal", value: "DuplexStreamWithDistinctStreams" }], + [], + { service: "RestJson", operation: "DuplexStreamWithDistinctStreams" } + ), + new httpbinding.UriSpec<"RestJson", "DuplexStreamWithInitialMessages">( + "POST", + [{ type: "path_literal", value: "DuplexStreamWithInitialMessages" }], + [], + { service: "RestJson", operation: "DuplexStreamWithInitialMessages" } + ), new httpbinding.UriSpec<"RestJson", "EmptyInputAndEmptyOutput">( "POST", [{ type: "path_literal", value: "EmptyInputAndEmptyOutput" }], @@ -2152,6 +2308,12 @@ export const getRestJsonServiceHandler = ( [], { service: "RestJson", operation: "HttpPrefixHeadersInResponse" } ), + new httpbinding.UriSpec<"RestJson", "HttpQueryParamsOnlyOperation">( + "GET", + [{ type: "path_literal", value: "http-query-params-only" }], + [], + { service: "RestJson", operation: "HttpQueryParamsOnlyOperation" } + ), new httpbinding.UriSpec<"RestJson", "HttpRequestWithFloatLabels">( "GET", [{ type: "path_literal", value: "FloatHttpLabels" }, { type: "path" }, { type: "path" }], @@ -2231,6 +2393,16 @@ export const getRestJsonServiceHandler = ( [], { service: "RestJson", operation: "InputAndOutputWithHeaders" } ), + new httpbinding.UriSpec<"RestJson", "InputStream">("POST", [{ type: "path_literal", value: "InputStream" }], [], { + service: "RestJson", + operation: "InputStream", + }), + new httpbinding.UriSpec<"RestJson", "InputStreamWithInitialRequest">( + "POST", + [{ type: "path_literal", value: "InputStreamWithInitialRequest" }], + [], + { service: "RestJson", operation: "InputStreamWithInitialRequest" } + ), new httpbinding.UriSpec<"RestJson", "JsonBlobs">("POST", [{ type: "path_literal", value: "JsonBlobs" }], [], { service: "RestJson", operation: "JsonBlobs", @@ -2511,6 +2683,16 @@ export const getRestJsonServiceHandler = ( [], { service: "RestJson", operation: "OperationWithNestedStructure" } ), + new httpbinding.UriSpec<"RestJson", "OutputStream">("POST", [{ type: "path_literal", value: "OutputStream" }], [], { + service: "RestJson", + operation: "OutputStream", + }), + new httpbinding.UriSpec<"RestJson", "OutputStreamWithInitialResponse">( + "POST", + [{ type: "path_literal", value: "OutputStreamWithInitialResponse" }], + [], + { service: "RestJson", operation: "OutputStreamWithInitialResponse" } + ), new httpbinding.UriSpec<"RestJson", "PostPlayerAction">( "POST", [{ type: "path_literal", value: "PostPlayerAction" }], @@ -2677,6 +2859,12 @@ export const getRestJsonServiceHandler = ( return new DocumentTypeAsMapValueSerializer(); case "DocumentTypeAsPayload": return new DocumentTypeAsPayloadSerializer(); + case "DuplexStream": + return new DuplexStreamSerializer(); + case "DuplexStreamWithDistinctStreams": + return new DuplexStreamWithDistinctStreamsSerializer(); + case "DuplexStreamWithInitialMessages": + return new DuplexStreamWithInitialMessagesSerializer(); case "EmptyInputAndEmptyOutput": return new EmptyInputAndEmptyOutputSerializer(); case "EndpointOperation": @@ -2707,6 +2895,8 @@ export const getRestJsonServiceHandler = ( return new HttpPrefixHeadersSerializer(); case "HttpPrefixHeadersInResponse": return new HttpPrefixHeadersInResponseSerializer(); + case "HttpQueryParamsOnlyOperation": + return new HttpQueryParamsOnlyOperationSerializer(); case "HttpRequestWithFloatLabels": return new HttpRequestWithFloatLabelsSerializer(); case "HttpRequestWithGreedyLabelInPath": @@ -2725,6 +2915,10 @@ export const getRestJsonServiceHandler = ( return new IgnoreQueryParamsInResponseSerializer(); case "InputAndOutputWithHeaders": return new InputAndOutputWithHeadersSerializer(); + case "InputStream": + return new InputStreamSerializer(); + case "InputStreamWithInitialRequest": + return new InputStreamWithInitialRequestSerializer(); case "JsonBlobs": return new JsonBlobsSerializer(); case "JsonEnums": @@ -2823,6 +3017,10 @@ export const getRestJsonServiceHandler = ( return new OperationWithDefaultsSerializer(); case "OperationWithNestedStructure": return new OperationWithNestedStructureSerializer(); + case "OutputStream": + return new OutputStreamSerializer(); + case "OutputStreamWithInitialResponse": + return new OutputStreamWithInitialResponseSerializer(); case "PostPlayerAction": return new PostPlayerActionSerializer(); case "PostUnionWithJsonName": diff --git a/private/aws-restjson-server/src/server/operations/DuplexStream.ts b/private/aws-restjson-server/src/server/operations/DuplexStream.ts new file mode 100644 index 0000000000000..daa8b11bf7418 --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/DuplexStream.ts @@ -0,0 +1,174 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { DuplexStreamInput, DuplexStreamOutput } from "../../models/models_0"; +import { + deserializeDuplexStreamRequest, + serializeDuplexStreamResponse, + serializeFrameworkException, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type DuplexStream = __Operation; + +export interface DuplexStreamServerInput extends DuplexStreamInput {} +export namespace DuplexStreamServerInput { + /** + * @internal + */ + export const validate: (obj: Parameters[0]) => __ValidationFailure[] = + DuplexStreamInput.validate; +} +export interface DuplexStreamServerOutput extends DuplexStreamOutput {} + +export type DuplexStreamErrors = never; + +export class DuplexStreamSerializer + implements __OperationSerializer, "DuplexStream", DuplexStreamErrors> +{ + serialize = serializeDuplexStreamResponse; + deserialize = deserializeDuplexStreamRequest; + + isOperationError(error: any): error is DuplexStreamErrors { + return false; + } + + serializeError(error: DuplexStreamErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + throw error; + } +} + +export const getDuplexStreamHandler = ( + operation: __Operation, + customizer: __ValidationCustomizer<"DuplexStream"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "DuplexStream">([ + new httpbinding.UriSpec<"RestJson", "DuplexStream">("POST", [{ type: "path_literal", value: "DuplexStream" }], [], { + service: "RestJson", + operation: "DuplexStream", + }), + ]); + return new DuplexStreamHandler(operation, mux, new DuplexStreamSerializer(), serializeFrameworkException, customizer); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class DuplexStreamHandler implements __ServiceHandler { + private readonly operation: __Operation; + private readonly mux: __Mux<"RestJson", "DuplexStream">; + private readonly serializer: __OperationSerializer, "DuplexStream", DuplexStreamErrors>; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"DuplexStream">; + /** + * Construct a DuplexStream handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for DuplexStream + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for DuplexStream that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation, + mux: __Mux<"RestJson", "DuplexStream">, + serializer: __OperationSerializer, "DuplexStream", DuplexStreamErrors>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"DuplexStream"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.DuplexStream. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "DuplexStream", + this.serializer, + this.operation, + this.serializeFrameworkException, + DuplexStreamServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/DuplexStreamWithDistinctStreams.ts b/private/aws-restjson-server/src/server/operations/DuplexStreamWithDistinctStreams.ts new file mode 100644 index 0000000000000..d06ff5bb9110a --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/DuplexStreamWithDistinctStreams.ts @@ -0,0 +1,212 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { DuplexStreamWithDistinctStreamsInput, DuplexStreamWithDistinctStreamsOutput } from "../../models/models_0"; +import { + deserializeDuplexStreamWithDistinctStreamsRequest, + serializeDuplexStreamWithDistinctStreamsResponse, + serializeFrameworkException, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type DuplexStreamWithDistinctStreams = __Operation< + DuplexStreamWithDistinctStreamsServerInput, + DuplexStreamWithDistinctStreamsServerOutput, + Context +>; + +export interface DuplexStreamWithDistinctStreamsServerInput extends DuplexStreamWithDistinctStreamsInput {} +export namespace DuplexStreamWithDistinctStreamsServerInput { + /** + * @internal + */ + export const validate: ( + obj: Parameters[0] + ) => __ValidationFailure[] = DuplexStreamWithDistinctStreamsInput.validate; +} +export interface DuplexStreamWithDistinctStreamsServerOutput extends DuplexStreamWithDistinctStreamsOutput {} + +export type DuplexStreamWithDistinctStreamsErrors = never; + +export class DuplexStreamWithDistinctStreamsSerializer + implements + __OperationSerializer< + RestJsonService, + "DuplexStreamWithDistinctStreams", + DuplexStreamWithDistinctStreamsErrors + > +{ + serialize = serializeDuplexStreamWithDistinctStreamsResponse; + deserialize = deserializeDuplexStreamWithDistinctStreamsRequest; + + isOperationError(error: any): error is DuplexStreamWithDistinctStreamsErrors { + return false; + } + + serializeError(error: DuplexStreamWithDistinctStreamsErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + throw error; + } +} + +export const getDuplexStreamWithDistinctStreamsHandler = ( + operation: __Operation< + DuplexStreamWithDistinctStreamsServerInput, + DuplexStreamWithDistinctStreamsServerOutput, + Context + >, + customizer: __ValidationCustomizer<"DuplexStreamWithDistinctStreams"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "DuplexStreamWithDistinctStreams">([ + new httpbinding.UriSpec<"RestJson", "DuplexStreamWithDistinctStreams">( + "POST", + [{ type: "path_literal", value: "DuplexStreamWithDistinctStreams" }], + [], + { service: "RestJson", operation: "DuplexStreamWithDistinctStreams" } + ), + ]); + return new DuplexStreamWithDistinctStreamsHandler( + operation, + mux, + new DuplexStreamWithDistinctStreamsSerializer(), + serializeFrameworkException, + customizer + ); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class DuplexStreamWithDistinctStreamsHandler implements __ServiceHandler { + private readonly operation: __Operation< + DuplexStreamWithDistinctStreamsServerInput, + DuplexStreamWithDistinctStreamsServerOutput, + Context + >; + private readonly mux: __Mux<"RestJson", "DuplexStreamWithDistinctStreams">; + private readonly serializer: __OperationSerializer< + RestJsonService, + "DuplexStreamWithDistinctStreams", + DuplexStreamWithDistinctStreamsErrors + >; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"DuplexStreamWithDistinctStreams">; + /** + * Construct a DuplexStreamWithDistinctStreams handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for DuplexStreamWithDistinctStreams + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for DuplexStreamWithDistinctStreams that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation< + DuplexStreamWithDistinctStreamsServerInput, + DuplexStreamWithDistinctStreamsServerOutput, + Context + >, + mux: __Mux<"RestJson", "DuplexStreamWithDistinctStreams">, + serializer: __OperationSerializer< + RestJsonService, + "DuplexStreamWithDistinctStreams", + DuplexStreamWithDistinctStreamsErrors + >, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"DuplexStreamWithDistinctStreams"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.DuplexStreamWithDistinctStreams. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "DuplexStreamWithDistinctStreams", + this.serializer, + this.operation, + this.serializeFrameworkException, + DuplexStreamWithDistinctStreamsServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/DuplexStreamWithInitialMessages.ts b/private/aws-restjson-server/src/server/operations/DuplexStreamWithInitialMessages.ts new file mode 100644 index 0000000000000..b89270a8ef95c --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/DuplexStreamWithInitialMessages.ts @@ -0,0 +1,223 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __BaseException, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { ServiceUnavailableError } from "../../models/errors"; +import { DuplexStreamWithInitialMessagesInput, DuplexStreamWithInitialMessagesOutput } from "../../models/models_0"; +import { + deserializeDuplexStreamWithInitialMessagesRequest, + serializeDuplexStreamWithInitialMessagesResponse, + serializeFrameworkException, + serializeServiceUnavailableErrorError, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type DuplexStreamWithInitialMessages = __Operation< + DuplexStreamWithInitialMessagesServerInput, + DuplexStreamWithInitialMessagesServerOutput, + Context +>; + +export interface DuplexStreamWithInitialMessagesServerInput extends DuplexStreamWithInitialMessagesInput {} +export namespace DuplexStreamWithInitialMessagesServerInput { + /** + * @internal + */ + export const validate: ( + obj: Parameters[0] + ) => __ValidationFailure[] = DuplexStreamWithInitialMessagesInput.validate; +} +export interface DuplexStreamWithInitialMessagesServerOutput extends DuplexStreamWithInitialMessagesOutput {} + +export type DuplexStreamWithInitialMessagesErrors = ServiceUnavailableError; + +export class DuplexStreamWithInitialMessagesSerializer + implements + __OperationSerializer< + RestJsonService, + "DuplexStreamWithInitialMessages", + DuplexStreamWithInitialMessagesErrors + > +{ + serialize = serializeDuplexStreamWithInitialMessagesResponse; + deserialize = deserializeDuplexStreamWithInitialMessagesRequest; + + isOperationError(error: any): error is DuplexStreamWithInitialMessagesErrors { + const names: DuplexStreamWithInitialMessagesErrors["name"][] = ["ServiceUnavailableError"]; + return names.includes(error.name); + } + + serializeError(error: DuplexStreamWithInitialMessagesErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + switch (error.name) { + case "ServiceUnavailableError": { + return serializeServiceUnavailableErrorError(error, ctx); + } + default: { + throw error; + } + } + } +} + +export const getDuplexStreamWithInitialMessagesHandler = ( + operation: __Operation< + DuplexStreamWithInitialMessagesServerInput, + DuplexStreamWithInitialMessagesServerOutput, + Context + >, + customizer: __ValidationCustomizer<"DuplexStreamWithInitialMessages"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "DuplexStreamWithInitialMessages">([ + new httpbinding.UriSpec<"RestJson", "DuplexStreamWithInitialMessages">( + "POST", + [{ type: "path_literal", value: "DuplexStreamWithInitialMessages" }], + [], + { service: "RestJson", operation: "DuplexStreamWithInitialMessages" } + ), + ]); + return new DuplexStreamWithInitialMessagesHandler( + operation, + mux, + new DuplexStreamWithInitialMessagesSerializer(), + serializeFrameworkException, + customizer + ); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class DuplexStreamWithInitialMessagesHandler implements __ServiceHandler { + private readonly operation: __Operation< + DuplexStreamWithInitialMessagesServerInput, + DuplexStreamWithInitialMessagesServerOutput, + Context + >; + private readonly mux: __Mux<"RestJson", "DuplexStreamWithInitialMessages">; + private readonly serializer: __OperationSerializer< + RestJsonService, + "DuplexStreamWithInitialMessages", + DuplexStreamWithInitialMessagesErrors + >; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"DuplexStreamWithInitialMessages">; + /** + * Construct a DuplexStreamWithInitialMessages handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for DuplexStreamWithInitialMessages + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for DuplexStreamWithInitialMessages that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation< + DuplexStreamWithInitialMessagesServerInput, + DuplexStreamWithInitialMessagesServerOutput, + Context + >, + mux: __Mux<"RestJson", "DuplexStreamWithInitialMessages">, + serializer: __OperationSerializer< + RestJsonService, + "DuplexStreamWithInitialMessages", + DuplexStreamWithInitialMessagesErrors + >, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"DuplexStreamWithInitialMessages"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.DuplexStreamWithInitialMessages. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "DuplexStreamWithInitialMessages", + this.serializer, + this.operation, + this.serializeFrameworkException, + DuplexStreamWithInitialMessagesServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/HttpQueryParamsOnlyOperation.ts b/private/aws-restjson-server/src/server/operations/HttpQueryParamsOnlyOperation.ts new file mode 100644 index 0000000000000..f26a443562810 --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/HttpQueryParamsOnlyOperation.ts @@ -0,0 +1,199 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { HttpQueryParamsOnlyInput } from "../../models/models_0"; +import { + deserializeHttpQueryParamsOnlyOperationRequest, + serializeFrameworkException, + serializeHttpQueryParamsOnlyOperationResponse, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type HttpQueryParamsOnlyOperation = __Operation< + HttpQueryParamsOnlyOperationServerInput, + HttpQueryParamsOnlyOperationServerOutput, + Context +>; + +export interface HttpQueryParamsOnlyOperationServerInput extends HttpQueryParamsOnlyInput {} +export namespace HttpQueryParamsOnlyOperationServerInput { + /** + * @internal + */ + export const validate: (obj: Parameters[0]) => __ValidationFailure[] = + HttpQueryParamsOnlyInput.validate; +} +export interface HttpQueryParamsOnlyOperationServerOutput {} + +export type HttpQueryParamsOnlyOperationErrors = never; + +export class HttpQueryParamsOnlyOperationSerializer + implements + __OperationSerializer, "HttpQueryParamsOnlyOperation", HttpQueryParamsOnlyOperationErrors> +{ + serialize = serializeHttpQueryParamsOnlyOperationResponse; + deserialize = deserializeHttpQueryParamsOnlyOperationRequest; + + isOperationError(error: any): error is HttpQueryParamsOnlyOperationErrors { + return false; + } + + serializeError(error: HttpQueryParamsOnlyOperationErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + throw error; + } +} + +export const getHttpQueryParamsOnlyOperationHandler = ( + operation: __Operation, + customizer: __ValidationCustomizer<"HttpQueryParamsOnlyOperation"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "HttpQueryParamsOnlyOperation">([ + new httpbinding.UriSpec<"RestJson", "HttpQueryParamsOnlyOperation">( + "GET", + [{ type: "path_literal", value: "http-query-params-only" }], + [], + { service: "RestJson", operation: "HttpQueryParamsOnlyOperation" } + ), + ]); + return new HttpQueryParamsOnlyOperationHandler( + operation, + mux, + new HttpQueryParamsOnlyOperationSerializer(), + serializeFrameworkException, + customizer + ); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class HttpQueryParamsOnlyOperationHandler implements __ServiceHandler { + private readonly operation: __Operation< + HttpQueryParamsOnlyOperationServerInput, + HttpQueryParamsOnlyOperationServerOutput, + Context + >; + private readonly mux: __Mux<"RestJson", "HttpQueryParamsOnlyOperation">; + private readonly serializer: __OperationSerializer< + RestJsonService, + "HttpQueryParamsOnlyOperation", + HttpQueryParamsOnlyOperationErrors + >; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"HttpQueryParamsOnlyOperation">; + /** + * Construct a HttpQueryParamsOnlyOperation handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for HttpQueryParamsOnlyOperation + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for HttpQueryParamsOnlyOperation that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation, + mux: __Mux<"RestJson", "HttpQueryParamsOnlyOperation">, + serializer: __OperationSerializer< + RestJsonService, + "HttpQueryParamsOnlyOperation", + HttpQueryParamsOnlyOperationErrors + >, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"HttpQueryParamsOnlyOperation"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.HttpQueryParamsOnlyOperation. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "HttpQueryParamsOnlyOperation", + this.serializer, + this.operation, + this.serializeFrameworkException, + HttpQueryParamsOnlyOperationServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/InputStream.ts b/private/aws-restjson-server/src/server/operations/InputStream.ts new file mode 100644 index 0000000000000..4c31bb71e1329 --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/InputStream.ts @@ -0,0 +1,174 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { InputStreamInput } from "../../models/models_0"; +import { + deserializeInputStreamRequest, + serializeFrameworkException, + serializeInputStreamResponse, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type InputStream = __Operation; + +export interface InputStreamServerInput extends InputStreamInput {} +export namespace InputStreamServerInput { + /** + * @internal + */ + export const validate: (obj: Parameters[0]) => __ValidationFailure[] = + InputStreamInput.validate; +} +export interface InputStreamServerOutput {} + +export type InputStreamErrors = never; + +export class InputStreamSerializer + implements __OperationSerializer, "InputStream", InputStreamErrors> +{ + serialize = serializeInputStreamResponse; + deserialize = deserializeInputStreamRequest; + + isOperationError(error: any): error is InputStreamErrors { + return false; + } + + serializeError(error: InputStreamErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + throw error; + } +} + +export const getInputStreamHandler = ( + operation: __Operation, + customizer: __ValidationCustomizer<"InputStream"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "InputStream">([ + new httpbinding.UriSpec<"RestJson", "InputStream">("POST", [{ type: "path_literal", value: "InputStream" }], [], { + service: "RestJson", + operation: "InputStream", + }), + ]); + return new InputStreamHandler(operation, mux, new InputStreamSerializer(), serializeFrameworkException, customizer); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class InputStreamHandler implements __ServiceHandler { + private readonly operation: __Operation; + private readonly mux: __Mux<"RestJson", "InputStream">; + private readonly serializer: __OperationSerializer, "InputStream", InputStreamErrors>; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"InputStream">; + /** + * Construct a InputStream handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for InputStream + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for InputStream that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation, + mux: __Mux<"RestJson", "InputStream">, + serializer: __OperationSerializer, "InputStream", InputStreamErrors>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"InputStream"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.InputStream. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "InputStream", + this.serializer, + this.operation, + this.serializeFrameworkException, + InputStreamServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/InputStreamWithInitialRequest.ts b/private/aws-restjson-server/src/server/operations/InputStreamWithInitialRequest.ts new file mode 100644 index 0000000000000..ccf01651100f7 --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/InputStreamWithInitialRequest.ts @@ -0,0 +1,204 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { InputStreamWithInitialRequestInput } from "../../models/models_0"; +import { + deserializeInputStreamWithInitialRequestRequest, + serializeFrameworkException, + serializeInputStreamWithInitialRequestResponse, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type InputStreamWithInitialRequest = __Operation< + InputStreamWithInitialRequestServerInput, + InputStreamWithInitialRequestServerOutput, + Context +>; + +export interface InputStreamWithInitialRequestServerInput extends InputStreamWithInitialRequestInput {} +export namespace InputStreamWithInitialRequestServerInput { + /** + * @internal + */ + export const validate: ( + obj: Parameters[0] + ) => __ValidationFailure[] = InputStreamWithInitialRequestInput.validate; +} +export interface InputStreamWithInitialRequestServerOutput {} + +export type InputStreamWithInitialRequestErrors = never; + +export class InputStreamWithInitialRequestSerializer + implements + __OperationSerializer, "InputStreamWithInitialRequest", InputStreamWithInitialRequestErrors> +{ + serialize = serializeInputStreamWithInitialRequestResponse; + deserialize = deserializeInputStreamWithInitialRequestRequest; + + isOperationError(error: any): error is InputStreamWithInitialRequestErrors { + return false; + } + + serializeError(error: InputStreamWithInitialRequestErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + throw error; + } +} + +export const getInputStreamWithInitialRequestHandler = ( + operation: __Operation, + customizer: __ValidationCustomizer<"InputStreamWithInitialRequest"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "InputStreamWithInitialRequest">([ + new httpbinding.UriSpec<"RestJson", "InputStreamWithInitialRequest">( + "POST", + [{ type: "path_literal", value: "InputStreamWithInitialRequest" }], + [], + { service: "RestJson", operation: "InputStreamWithInitialRequest" } + ), + ]); + return new InputStreamWithInitialRequestHandler( + operation, + mux, + new InputStreamWithInitialRequestSerializer(), + serializeFrameworkException, + customizer + ); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class InputStreamWithInitialRequestHandler implements __ServiceHandler { + private readonly operation: __Operation< + InputStreamWithInitialRequestServerInput, + InputStreamWithInitialRequestServerOutput, + Context + >; + private readonly mux: __Mux<"RestJson", "InputStreamWithInitialRequest">; + private readonly serializer: __OperationSerializer< + RestJsonService, + "InputStreamWithInitialRequest", + InputStreamWithInitialRequestErrors + >; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"InputStreamWithInitialRequest">; + /** + * Construct a InputStreamWithInitialRequest handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for InputStreamWithInitialRequest + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for InputStreamWithInitialRequest that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation< + InputStreamWithInitialRequestServerInput, + InputStreamWithInitialRequestServerOutput, + Context + >, + mux: __Mux<"RestJson", "InputStreamWithInitialRequest">, + serializer: __OperationSerializer< + RestJsonService, + "InputStreamWithInitialRequest", + InputStreamWithInitialRequestErrors + >, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"InputStreamWithInitialRequest"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.InputStreamWithInitialRequest. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "InputStreamWithInitialRequest", + this.serializer, + this.operation, + this.serializeFrameworkException, + InputStreamWithInitialRequestServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/OutputStream.ts b/private/aws-restjson-server/src/server/operations/OutputStream.ts new file mode 100644 index 0000000000000..4932d71e9f2cc --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/OutputStream.ts @@ -0,0 +1,184 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __BaseException, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { ServiceUnavailableError } from "../../models/errors"; +import { OutputStreamOutput } from "../../models/models_0"; +import { + deserializeOutputStreamRequest, + serializeFrameworkException, + serializeOutputStreamResponse, + serializeServiceUnavailableErrorError, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type OutputStream = __Operation; + +export interface OutputStreamServerInput {} +export namespace OutputStreamServerInput { + /** + * @internal + */ + export const validate: () => __ValidationFailure[] = () => []; +} +export interface OutputStreamServerOutput extends OutputStreamOutput {} + +export type OutputStreamErrors = ServiceUnavailableError; + +export class OutputStreamSerializer + implements __OperationSerializer, "OutputStream", OutputStreamErrors> +{ + serialize = serializeOutputStreamResponse; + deserialize = deserializeOutputStreamRequest; + + isOperationError(error: any): error is OutputStreamErrors { + const names: OutputStreamErrors["name"][] = ["ServiceUnavailableError"]; + return names.includes(error.name); + } + + serializeError(error: OutputStreamErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + switch (error.name) { + case "ServiceUnavailableError": { + return serializeServiceUnavailableErrorError(error, ctx); + } + default: { + throw error; + } + } + } +} + +export const getOutputStreamHandler = ( + operation: __Operation, + customizer: __ValidationCustomizer<"OutputStream"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "OutputStream">([ + new httpbinding.UriSpec<"RestJson", "OutputStream">("POST", [{ type: "path_literal", value: "OutputStream" }], [], { + service: "RestJson", + operation: "OutputStream", + }), + ]); + return new OutputStreamHandler(operation, mux, new OutputStreamSerializer(), serializeFrameworkException, customizer); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class OutputStreamHandler implements __ServiceHandler { + private readonly operation: __Operation; + private readonly mux: __Mux<"RestJson", "OutputStream">; + private readonly serializer: __OperationSerializer, "OutputStream", OutputStreamErrors>; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"OutputStream">; + /** + * Construct a OutputStream handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for OutputStream + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for OutputStream that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation, + mux: __Mux<"RestJson", "OutputStream">, + serializer: __OperationSerializer, "OutputStream", OutputStreamErrors>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"OutputStream"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.OutputStream. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "OutputStream", + this.serializer, + this.operation, + this.serializeFrameworkException, + OutputStreamServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/OutputStreamWithInitialResponse.ts b/private/aws-restjson-server/src/server/operations/OutputStreamWithInitialResponse.ts new file mode 100644 index 0000000000000..783f96215286a --- /dev/null +++ b/private/aws-restjson-server/src/server/operations/OutputStreamWithInitialResponse.ts @@ -0,0 +1,210 @@ +// smithy-typescript generated code +import { + httpbinding, + InternalFailureException as __InternalFailureException, + isFrameworkException as __isFrameworkException, + Mux as __Mux, + Operation as __Operation, + OperationInput as __OperationInput, + OperationOutput as __OperationOutput, + OperationSerializer as __OperationSerializer, + SerializationException as __SerializationException, + ServerSerdeContext as __ServerSerdeContext, + ServerSerdeContext, + ServiceException as __ServiceException, + ServiceHandler as __ServiceHandler, + SmithyFrameworkException as __SmithyFrameworkException, + ValidationCustomizer as __ValidationCustomizer, + ValidationFailure as __ValidationFailure, +} from "@aws-smithy/server-common"; +import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { OutputStreamWithInitialResponseOutput } from "../../models/models_0"; +import { + deserializeOutputStreamWithInitialResponseRequest, + serializeFrameworkException, + serializeOutputStreamWithInitialResponseResponse, +} from "../../protocols/Aws_restJson1"; +import { RestJsonService } from "../RestJsonService"; + +export type OutputStreamWithInitialResponse = __Operation< + OutputStreamWithInitialResponseServerInput, + OutputStreamWithInitialResponseServerOutput, + Context +>; + +export interface OutputStreamWithInitialResponseServerInput {} +export namespace OutputStreamWithInitialResponseServerInput { + /** + * @internal + */ + export const validate: () => __ValidationFailure[] = () => []; +} +export interface OutputStreamWithInitialResponseServerOutput extends OutputStreamWithInitialResponseOutput {} + +export type OutputStreamWithInitialResponseErrors = never; + +export class OutputStreamWithInitialResponseSerializer + implements + __OperationSerializer< + RestJsonService, + "OutputStreamWithInitialResponse", + OutputStreamWithInitialResponseErrors + > +{ + serialize = serializeOutputStreamWithInitialResponseResponse; + deserialize = deserializeOutputStreamWithInitialResponseRequest; + + isOperationError(error: any): error is OutputStreamWithInitialResponseErrors { + return false; + } + + serializeError(error: OutputStreamWithInitialResponseErrors, ctx: ServerSerdeContext): Promise<__HttpResponse> { + throw error; + } +} + +export const getOutputStreamWithInitialResponseHandler = ( + operation: __Operation< + OutputStreamWithInitialResponseServerInput, + OutputStreamWithInitialResponseServerOutput, + Context + >, + customizer: __ValidationCustomizer<"OutputStreamWithInitialResponse"> +): __ServiceHandler => { + const mux = new httpbinding.HttpBindingMux<"RestJson", "OutputStreamWithInitialResponse">([ + new httpbinding.UriSpec<"RestJson", "OutputStreamWithInitialResponse">( + "POST", + [{ type: "path_literal", value: "OutputStreamWithInitialResponse" }], + [], + { service: "RestJson", operation: "OutputStreamWithInitialResponse" } + ), + ]); + return new OutputStreamWithInitialResponseHandler( + operation, + mux, + new OutputStreamWithInitialResponseSerializer(), + serializeFrameworkException, + customizer + ); +}; + +const serdeContextBase = { + base64Encoder: toBase64, + base64Decoder: fromBase64, + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + streamCollector: streamCollector, + requestHandler: new NodeHttpHandler(), + disableHostPrefix: true, +}; +async function handle( + request: __HttpRequest, + context: Context, + operationName: O, + serializer: __OperationSerializer, + operation: __Operation<__OperationInput, __OperationOutput, Context>, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationFn: (input: __OperationInput) => __ValidationFailure[], + validationCustomizer: __ValidationCustomizer +): Promise<__HttpResponse> { + let input; + try { + input = await serializer.deserialize(request, { + endpoint: () => Promise.resolve(request), + ...serdeContextBase, + }); + } catch (error: unknown) { + if (__isFrameworkException(error)) { + return serializeFrameworkException(error, serdeContextBase); + } + return serializeFrameworkException(new __SerializationException(), serdeContextBase); + } + try { + const validationFailures = validationFn(input); + if (validationFailures && validationFailures.length > 0) { + const validationException = validationCustomizer({ operation: operationName }, validationFailures); + if (validationException) { + return serializer.serializeError(validationException, serdeContextBase); + } + } + const output = await operation(input, context); + return serializer.serialize(output, serdeContextBase); + } catch (error: unknown) { + if (serializer.isOperationError(error)) { + return serializer.serializeError(error, serdeContextBase); + } + console.log("Received an unexpected error", error); + return serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } +} +export class OutputStreamWithInitialResponseHandler implements __ServiceHandler { + private readonly operation: __Operation< + OutputStreamWithInitialResponseServerInput, + OutputStreamWithInitialResponseServerOutput, + Context + >; + private readonly mux: __Mux<"RestJson", "OutputStreamWithInitialResponse">; + private readonly serializer: __OperationSerializer< + RestJsonService, + "OutputStreamWithInitialResponse", + OutputStreamWithInitialResponseErrors + >; + private readonly serializeFrameworkException: ( + e: __SmithyFrameworkException, + ctx: __ServerSerdeContext + ) => Promise<__HttpResponse>; + private readonly validationCustomizer: __ValidationCustomizer<"OutputStreamWithInitialResponse">; + /** + * Construct a OutputStreamWithInitialResponse handler. + * @param operation The {@link __Operation} implementation that supplies the business logic for OutputStreamWithInitialResponse + * @param mux The {@link __Mux} that verifies which service and operation are being invoked by a given {@link __HttpRequest} + * @param serializer An {@link __OperationSerializer} for OutputStreamWithInitialResponse that + * handles deserialization of requests and serialization of responses + * @param serializeFrameworkException A function that can serialize {@link __SmithyFrameworkException}s + * @param validationCustomizer A {@link __ValidationCustomizer} for turning validation failures into {@link __SmithyFrameworkException}s + */ + constructor( + operation: __Operation< + OutputStreamWithInitialResponseServerInput, + OutputStreamWithInitialResponseServerOutput, + Context + >, + mux: __Mux<"RestJson", "OutputStreamWithInitialResponse">, + serializer: __OperationSerializer< + RestJsonService, + "OutputStreamWithInitialResponse", + OutputStreamWithInitialResponseErrors + >, + serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) => Promise<__HttpResponse>, + validationCustomizer: __ValidationCustomizer<"OutputStreamWithInitialResponse"> + ) { + this.operation = operation; + this.mux = mux; + this.serializer = serializer; + this.serializeFrameworkException = serializeFrameworkException; + this.validationCustomizer = validationCustomizer; + } + async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> { + const target = this.mux.match(request); + if (target === undefined) { + console.log( + "Received a request that did not match aws.protocoltests.restjson#RestJson.OutputStreamWithInitialResponse. This indicates a misconfiguration." + ); + return this.serializeFrameworkException(new __InternalFailureException(), serdeContextBase); + } + return handle( + request, + context, + "OutputStreamWithInitialResponse", + this.serializer, + this.operation, + this.serializeFrameworkException, + OutputStreamWithInitialResponseServerInput.validate, + this.validationCustomizer + ); + } +} diff --git a/private/aws-restjson-server/src/server/operations/index.ts b/private/aws-restjson-server/src/server/operations/index.ts index 83d314c7260bf..1129d17c4ca4e 100644 --- a/private/aws-restjson-server/src/server/operations/index.ts +++ b/private/aws-restjson-server/src/server/operations/index.ts @@ -7,6 +7,9 @@ export * from "./DatetimeOffsets"; export * from "./DocumentType"; export * from "./DocumentTypeAsMapValue"; export * from "./DocumentTypeAsPayload"; +export * from "./DuplexStream"; +export * from "./DuplexStreamWithDistinctStreams"; +export * from "./DuplexStreamWithInitialMessages"; export * from "./EmptyInputAndEmptyOutput"; export * from "./EndpointOperation"; export * from "./EndpointWithHostLabelOperation"; @@ -22,6 +25,7 @@ export * from "./HttpPayloadWithStructure"; export * from "./HttpPayloadWithUnion"; export * from "./HttpPrefixHeaders"; export * from "./HttpPrefixHeadersInResponse"; +export * from "./HttpQueryParamsOnlyOperation"; export * from "./HttpRequestWithFloatLabels"; export * from "./HttpRequestWithGreedyLabelInPath"; export * from "./HttpRequestWithLabels"; @@ -31,6 +35,8 @@ export * from "./HttpResponseCode"; export * from "./HttpStringPayload"; export * from "./IgnoreQueryParamsInResponse"; export * from "./InputAndOutputWithHeaders"; +export * from "./InputStream"; +export * from "./InputStreamWithInitialRequest"; export * from "./JsonBlobs"; export * from "./JsonEnums"; export * from "./JsonIntEnums"; @@ -80,6 +86,8 @@ export * from "./OmitsNullSerializesEmptyString"; export * from "./OmitsSerializingEmptyLists"; export * from "./OperationWithDefaults"; export * from "./OperationWithNestedStructure"; +export * from "./OutputStream"; +export * from "./OutputStreamWithInitialResponse"; export * from "./PostPlayerAction"; export * from "./PostUnionWithJsonName"; export * from "./PutWithContentEncoding"; diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index 486ebf802a15a..4561d927c07d8 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -2,8 +2,8 @@ module.exports = { // Use full commit hash as we explicitly fetch it. // Comparison link (update with previous hash): - // https://github.com/smithy-lang/smithy-typescript/compare/2cadea188e393e3deab55f5fc4f59d1a4c5da571...7be577c4d67a62cb304470718cc11222c991bcbf - SMITHY_TS_COMMIT: "7be577c4d67a62cb304470718cc11222c991bcbf", + // https://github.com/smithy-lang/smithy-typescript/compare/7be577c4d67a62cb304470718cc11222c991bcbf...775cd5b119247e544cfa1c51feb89b9e18805725 + SMITHY_TS_COMMIT: "775cd5b119247e544cfa1c51feb89b9e18805725", }; if (module.exports.SMITHY_TS_COMMIT.length < 40) { diff --git a/yarn.lock b/yarn.lock index b9fa356cf8e62..089d3abc813d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -994,6 +994,8 @@ __metadata: "@aws-crypto/sha256-js": "npm:5.2.0" "@aws-sdk/core": "npm:*" "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/eventstream-handler-node": "npm:*" + "@aws-sdk/middleware-eventstream": "npm:*" "@aws-sdk/middleware-host-header": "npm:*" "@aws-sdk/middleware-logger": "npm:*" "@aws-sdk/middleware-recursion-detection": "npm:*" @@ -1005,6 +1007,9 @@ __metadata: "@aws-sdk/util-user-agent-node": "npm:*" "@smithy/config-resolver": "npm:^4.4.3" "@smithy/core": "npm:^3.18.5" + "@smithy/eventstream-serde-browser": "npm:^4.2.5" + "@smithy/eventstream-serde-config-resolver": "npm:^4.3.5" + "@smithy/eventstream-serde-node": "npm:^4.2.5" "@smithy/fetch-http-handler": "npm:^5.3.6" "@smithy/hash-blob-browser": "npm:^4.2.6" "@smithy/hash-node": "npm:^4.2.5" @@ -1054,6 +1059,8 @@ __metadata: "@aws-crypto/sha256-js": "npm:5.2.0" "@aws-sdk/core": "npm:*" "@aws-sdk/credential-provider-node": "npm:*" + "@aws-sdk/eventstream-handler-node": "npm:*" + "@aws-sdk/middleware-eventstream": "npm:*" "@aws-sdk/middleware-host-header": "npm:*" "@aws-sdk/middleware-logger": "npm:*" "@aws-sdk/middleware-recursion-detection": "npm:*" @@ -1065,6 +1072,10 @@ __metadata: "@aws-sdk/util-user-agent-node": "npm:*" "@smithy/config-resolver": "npm:^4.4.3" "@smithy/core": "npm:^3.18.5" + "@smithy/eventstream-codec": "npm:^4.2.5" + "@smithy/eventstream-serde-browser": "npm:^4.2.5" + "@smithy/eventstream-serde-config-resolver": "npm:^4.3.5" + "@smithy/eventstream-serde-node": "npm:^4.2.5" "@smithy/fetch-http-handler": "npm:^5.3.6" "@smithy/hash-blob-browser": "npm:^4.2.6" "@smithy/hash-node": "npm:^4.2.5" @@ -1334,6 +1345,7 @@ __metadata: "@aws-sdk/types": "npm:*" "@aws-smithy/server-common": "npm:1.0.0-alpha.10" "@smithy/config-resolver": "npm:^4.4.3" + "@smithy/eventstream-codec": "npm:^4.2.5" "@smithy/fetch-http-handler": "npm:^5.3.6" "@smithy/hash-node": "npm:^4.2.5" "@smithy/invalid-dependency": "npm:^4.2.5"